aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1999-02-02 03:47:08 +0000
committerRichard M. Stallman1999-02-02 03:47:08 +0000
commitdb85e69ca484aea0aa0b352dceaf73237de42ae1 (patch)
tree4bbe7f599af0dd34cd9cb4992cd627ea5dfc5797
parente6c0f5191020c3e700ae9495bbc9aee98e840feb (diff)
downloademacs-db85e69ca484aea0aa0b352dceaf73237de42ae1.tar.gz
emacs-db85e69ca484aea0aa0b352dceaf73237de42ae1.zip
(makefile-imenu-generic-expression): New var.
(makefile-menu-index-function): Function deleted. (makefile-mode): Use makefile-imenu-generic-expression.
-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 ( )."
280 ;; They can make a tab fail to be effective. 280 ;; They can make a tab fail to be effective.
281 '("^\\( +\\)\t" 1 makefile-space-face))) 281 '("^\\( +\\)\t" 1 makefile-space-face)))
282 282
283(defvar makefile-imenu-generic-expression
284 (list
285 (list "Dependencies" makefile-dependency-regex 1)
286 (list "Macro Assignment" makefile-macroassign-regex 1))
287 "Imenu generic expression for makefile-mode. See `imenu-generic-expression'.")
288
283;;; ------------------------------------------------------------ 289;;; ------------------------------------------------------------
284;;; The following configurable variables are used in the 290;;; The following configurable variables are used in the
285;;; up-to-date overview . 291;;; up-to-date overview .
@@ -556,8 +562,8 @@ makefile-special-targets-list:
556 (setq add-log-current-defun-function 'makefile-add-log-defun) 562 (setq add-log-current-defun-function 'makefile-add-log-defun)
557 563
558 ;; Imenu. 564 ;; Imenu.
559 (make-local-variable 'imenu-create-index-function) 565 (make-local-variable 'imenu-generic-expression)
560 (setq imenu-create-index-function 'makefile-menu-index-function) 566 (setq imenu-generic-expression makefile-imenu-generic-expression)
561 567
562 ;; Dabbrev. 568 ;; Dabbrev.
563 (make-local-variable 'dabbrev-abbrev-skip-leading-regexp) 569 (make-local-variable 'dabbrev-abbrev-skip-leading-regexp)
@@ -1505,25 +1511,4 @@ If it isn't in one, return nil."
1505 (forward-line -1))) 1511 (forward-line -1)))
1506 (if (stringp found) found)))) 1512 (if (stringp found) found))))
1507 1513
1508;; FIXME it might be nice to have them separated by macro vs target.
1509(defun makefile-menu-index-function ()
1510 ;; "Generate alist of indices for imenu."
1511 (let (alist
1512 stupid
1513 (re (concat makefile-dependency-regex
1514 "\\|"
1515 makefile-macroassign-regex)))
1516 (imenu-progress-message stupid 0)
1517 (goto-char (point-min))
1518 (while (re-search-forward re nil t)
1519 (imenu-progress-message stupid)
1520 (let ((n (if (match-beginning 1) 1 5)))
1521 (setq alist (cons
1522 (cons (buffer-substring (match-beginning n)
1523 (match-end n))
1524 (match-beginning n))
1525 alist))))
1526 (imenu-progress-message stupid 100)
1527 (nreverse alist)))
1528
1529;;; make-mode.el ends here 1514;;; make-mode.el ends here