summaryrefslogtreecommitdiff
path: root/lisp/progmodes/make-mode.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1999-02-02 03:47:08 +0000
committerRichard M. Stallman <rms@gnu.org>1999-02-02 03:47:08 +0000
commitdb85e69ca484aea0aa0b352dceaf73237de42ae1 (patch)
tree4bbe7f599af0dd34cd9cb4992cd627ea5dfc5797 /lisp/progmodes/make-mode.el
parente6c0f5191020c3e700ae9495bbc9aee98e840feb (diff)
downloademacs-db85e69ca484aea0aa0b352dceaf73237de42ae1.tar.gz
emacs-db85e69ca484aea0aa0b352dceaf73237de42ae1.tar.bz2
emacs-db85e69ca484aea0aa0b352dceaf73237de42ae1.zip
(makefile-imenu-generic-expression): New var.
(makefile-menu-index-function): Function deleted. (makefile-mode): Use makefile-imenu-generic-expression.
Diffstat (limited to 'lisp/progmodes/make-mode.el')
-rw-r--r--lisp/progmodes/make-mode.el31
1 files changed, 8 insertions, 23 deletions
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index 75d177853ad..7a18bebcce6 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -280,6 +280,12 @@ not be enclosed in { } or ( )."
;; They can make a tab fail to be effective.
'("^\\( +\\)\t" 1 makefile-space-face)))
+(defvar makefile-imenu-generic-expression
+ (list
+ (list "Dependencies" makefile-dependency-regex 1)
+ (list "Macro Assignment" makefile-macroassign-regex 1))
+ "Imenu generic expression for makefile-mode. See `imenu-generic-expression'.")
+
;;; ------------------------------------------------------------
;;; The following configurable variables are used in the
;;; up-to-date overview .
@@ -556,8 +562,8 @@ makefile-special-targets-list:
(setq add-log-current-defun-function 'makefile-add-log-defun)
;; Imenu.
- (make-local-variable 'imenu-create-index-function)
- (setq imenu-create-index-function 'makefile-menu-index-function)
+ (make-local-variable 'imenu-generic-expression)
+ (setq imenu-generic-expression makefile-imenu-generic-expression)
;; Dabbrev.
(make-local-variable 'dabbrev-abbrev-skip-leading-regexp)
@@ -1505,25 +1511,4 @@ If it isn't in one, return nil."
(forward-line -1)))
(if (stringp found) found))))
-;; FIXME it might be nice to have them separated by macro vs target.
-(defun makefile-menu-index-function ()
- ;; "Generate alist of indices for imenu."
- (let (alist
- stupid
- (re (concat makefile-dependency-regex
- "\\|"
- makefile-macroassign-regex)))
- (imenu-progress-message stupid 0)
- (goto-char (point-min))
- (while (re-search-forward re nil t)
- (imenu-progress-message stupid)
- (let ((n (if (match-beginning 1) 1 5)))
- (setq alist (cons
- (cons (buffer-substring (match-beginning n)
- (match-end n))
- (match-beginning n))
- alist))))
- (imenu-progress-message stupid 100)
- (nreverse alist)))
-
;;; make-mode.el ends here