]> git.eshelyaron.com Git - emacs.git/commitdiff
(makefile-imenu-generic-expression): Use function to find dependencies, because regex...
authorDaniel Pfeiffer <occitan@esperanto.org>
Sat, 21 May 2005 02:46:37 +0000 (02:46 +0000)
committerDaniel Pfeiffer <occitan@esperanto.org>
Sat, 21 May 2005 02:46:37 +0000 (02:46 +0000)
(makefile-makepp-mode): Also add submenu for Perl functions defined in the makefile.
(makefile-bsdmake-mode): Special imenu-generic-expression no longer needed, due to function call.
(makefile-match-dependency): Take BOUND into account when checking if we're through.

lisp/ChangeLog
lisp/progmodes/make-mode.el

index b14240139add0c753029ad216a6ee38d8c4630a3..65fd9a68889dbf4fd273e7bb7ff6c48e1730de9f 100644 (file)
@@ -1,3 +1,23 @@
+2005-05-21  Daniel Pfeiffer  <occitan@esperanto.org>
+
+       * files.el (auto-mode-alist): Check GNUmakefile before makefile.
+       Default to makefile-bsdmake-mode on BSD systems.
+
+       * imenu.el (imenu-generic-expression, imenu--generic-function'):
+       REGEXP may also be a search function now.  The part of doc-string
+       for describing the structure was 95% identical to that of
+       `imenu--generic-function'.  Unify it there.
+
+       * progmodes/make-mode.el (makefile-imenu-generic-expression): Use
+       function to find dependencies, because regexp alone is so complex,
+       it easily goes into an endless loop.
+       (makefile-makepp-mode): Also add submenu for Perl functions
+       defined in the makefile.
+       (makefile-bsdmake-mode): Special imenu-generic-expression no
+       longer needed, due to function call.
+       (makefile-match-dependency): Take BOUND into account when checking
+       if we're through.
+
 2005-05-20  Jay Belanger  <belanger@truman.edu>
 
        * calc/calc-units.el (calc-invalidate-units-table):
index 86002768757a3c493fe57a82c0eee6dd1d8d57bd..05c3ac50787a9ebdd5de4b683bcc3044e9855c87 100644 (file)
@@ -484,7 +484,7 @@ not be enclosed in { } or ( )."
     ("\\\\\n" 0 ".")))
 
 (defvar makefile-imenu-generic-expression
-  `(("Dependencies" ,makefile-dependency-regex 1)
+  `(("Dependencies" makefile-previous-dependency 1)
     ("Macro Assignment" ,makefile-macroassign-regex 1))
   "Imenu generic expression for Makefile mode.  See `imenu-generic-expression'.")
 
@@ -854,7 +854,10 @@ Makefile mode can be configured by modifying the following variables:
        "^\t[ \t]*\\(\\(?:\\(?:noecho\\|ignore[-_]error\\|[-@]+\\)[ \t]*\\)*\\)\\(\\(&\\S +\\)?\\(?:.+\\\\\n\\)*.+\\)")
 
   (setq font-lock-defaults
-       `(makefile-makepp-font-lock-keywords ,@(cdr font-lock-defaults))))
+       `(makefile-makepp-font-lock-keywords ,@(cdr font-lock-defaults))
+       imenu-generic-expression
+       `(("Functions" "^[ \t]*\\(?:make\\)?sub[ \t]+\\([A-Za-z0-9_]+\\)" 1)
+         ,@imenu-generic-expression)))
 
 ;;;###autoload
 (define-derived-mode makefile-bsdmake-mode makefile-mode "BSDmakefile"
@@ -866,10 +869,7 @@ Makefile mode can be configured by modifying the following variables:
   (set (make-local-variable 'makefile-rule-action-regex)
        "^\t[ \t]*\\([-+@]*\\)[ \t]*\\(\\(?:.+\\\\\n\\)*.+\\)")
   (setq font-lock-defaults
-       `(makefile-bsdmake-font-lock-keywords ,@(cdr font-lock-defaults))
-       imenu-generic-expression
-       `(("Dependencies" ,makefile-dependency-regex 1)
-         ,@(cdr imenu-generic-expression))))
+       `(makefile-bsdmake-font-lock-keywords ,@(cdr font-lock-defaults))))
 
 \f
 
@@ -1682,7 +1682,7 @@ matched in a rule action."
   (catch 'found
     (let ((pt (point)))
       (while (progn (skip-chars-forward makefile-dependency-skip bound)
-                   (not (eobp)))
+                   (< (point) (or bound (point-max))))
        (forward-char)
        (or (eq (char-after) ?=)
            (get-text-property (1- (point)) 'face)