diff options
| author | Richard M. Stallman | 2005-06-06 12:50:01 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-06-06 12:50:01 +0000 |
| commit | dce16363d3c65f0e2e5b8cd70e6b929687e69021 (patch) | |
| tree | 62968f3a1f187fe22a6a2014134a2bc87be4fff0 /lisp | |
| parent | ccba8bb6e250c785266eacae4bbe103c9360a331 (diff) | |
| download | emacs-dce16363d3c65f0e2e5b8cd70e6b929687e69021.tar.gz emacs-dce16363d3c65f0e2e5b8cd70e6b929687e69021.zip | |
(makefile-dependency-regex): Handle whitespace
just like other allowed characters.
(makefile-match-dependency): Exclude leading and training whitespace
from the range of regexp subexp 1.
(makefile-macroassign-regex): Don't try to match the body,
just the name of the macro being defined.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/make-mode.el | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 7356583fb90..35fcc37a29c 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el | |||
| @@ -262,7 +262,7 @@ not be enclosed in { } or ( )." | |||
| 262 | ;; index in makefile-imenu-generic-expression. | 262 | ;; index in makefile-imenu-generic-expression. |
| 263 | (defvar makefile-dependency-regex | 263 | (defvar makefile-dependency-regex |
| 264 | ;; Allow for two nested levels $(v1:$(v2:$(v3:a=b)=c)=d) | 264 | ;; Allow for two nested levels $(v1:$(v2:$(v3:a=b)=c)=d) |
| 265 | "^ *\\(\\(?: *\\$\\(?:[({]\\(?:\\$\\(?:[({]\\(?:\\$\\(?:[^({]\\|.[^\n$#})]+?[})]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\| *[^ \n$#:=]+\\)+?\\)[ \t]*\\(:\\)\\(?:[ \t]*$\\|[^=\n]\\(?:[^#\n]*?;[ \t]*\\(.+\\)\\)?\\)" | 265 | "^\\(\\(?:\\$\\(?:[({]\\(?:\\$\\(?:[({]\\(?:\\$\\(?:[^({]\\|.[^\n$#})]+?[})]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\|[^\n$#:=]\\)+?\\)\\(:\\)\\(?:[ \t]*$\\|[^=\n]\\(?:[^#\n]*?;[ \t]*\\(bb.+\\)\\)?\\)" |
| 266 | "Regex used to find dependency lines in a makefile.") | 266 | "Regex used to find dependency lines in a makefile.") |
| 267 | 267 | ||
| 268 | (defconst makefile-bsdmake-dependency-regex | 268 | (defconst makefile-bsdmake-dependency-regex |
| @@ -291,7 +291,7 @@ not be enclosed in { } or ( )." | |||
| 291 | ;; that if you change this regexp you might have to fix the imenu index in | 291 | ;; that if you change this regexp you might have to fix the imenu index in |
| 292 | ;; makefile-imenu-generic-expression. | 292 | ;; makefile-imenu-generic-expression. |
| 293 | (defconst makefile-macroassign-regex | 293 | (defconst makefile-macroassign-regex |
| 294 | "^ *\\([^ \n\t][^:#= \t\n]*\\)[ \t]*\\(?:!=[ \t]*\\(\\(?:.+\\\\\n\\)*.+\\)\\|[*:+]?[:?]?=[ \t]*\\(\\(?:.*\\\\\n\\)*.*\\)\\)" | 294 | "^ *\\([^ \n\t][^:#= \t\n]*\\)[ \t]*\\(?:!=\\|[*:+]?[:?]?=\\)" |
| 295 | "Regex used to find macro assignment lines in a makefile.") | 295 | "Regex used to find macro assignment lines in a makefile.") |
| 296 | 296 | ||
| 297 | (defconst makefile-var-use-regex | 297 | (defconst makefile-var-use-regex |
| @@ -1704,6 +1704,19 @@ matched in a rule action." | |||
| 1704 | (when (save-excursion | 1704 | (when (save-excursion |
| 1705 | (beginning-of-line) | 1705 | (beginning-of-line) |
| 1706 | (looking-at makefile-dependency-regex)) | 1706 | (looking-at makefile-dependency-regex)) |
| 1707 | (save-excursion | ||
| 1708 | (let ((deps-end (match-end 1)) | ||
| 1709 | (match-data (match-data))) | ||
| 1710 | (goto-char deps-end) | ||
| 1711 | (skip-chars-backward " \t") | ||
| 1712 | (setq deps-end (point)) | ||
| 1713 | (beginning-of-line) | ||
| 1714 | (skip-chars-forward " \t") | ||
| 1715 | ;; Alter the bounds recorded for subexp 1, | ||
| 1716 | ;; which is what is supposed to match the targets. | ||
| 1717 | (setcar (nthcdr 2 match-data) (point)) | ||
| 1718 | (setcar (nthcdr 3 match-data) deps-end) | ||
| 1719 | (store-match-data match-data))) | ||
| 1707 | (end-of-line) | 1720 | (end-of-line) |
| 1708 | (throw 'found (point))))) | 1721 | (throw 'found (point))))) |
| 1709 | (goto-char pt)) | 1722 | (goto-char pt)) |