diff options
| author | Gerd Moellmann | 2000-05-03 19:24:18 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-05-03 19:24:18 +0000 |
| commit | ba080a3c56f7babfd5956b51455f81fc451ba28f (patch) | |
| tree | 172d9d9c258525fa673682547c8a275c69be55ab | |
| parent | 7ce278f3ad9f7796046ed349407336c40d53e560 (diff) | |
| download | emacs-ba080a3c56f7babfd5956b51455f81fc451ba28f.tar.gz emacs-ba080a3c56f7babfd5956b51455f81fc451ba28f.zip | |
(makefile-mode-abbrev-table): New variable.
(makefile-mode): Set local abbrev table to
makefile-mode-abbrev-table.
(makefile-font-lock-keywords): Fontify includes and conditionals.
| -rw-r--r-- | lisp/progmodes/make-mode.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 2c016ec5444..7235ec3d6ef 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el | |||
| @@ -285,6 +285,15 @@ not be enclosed in { } or ( )." | |||
| 285 | '("^[ \t]*\\(else\\|endif\\)[ \t]*\\(#.*$\\)?" | 285 | '("^[ \t]*\\(else\\|endif\\)[ \t]*\\(#.*$\\)?" |
| 286 | (1 font-lock-warning-face)) | 286 | (1 font-lock-warning-face)) |
| 287 | 287 | ||
| 288 | ;; Fontify conditionals and includes. | ||
| 289 | ;; Note that plain `if' is an automake conditional, and not a bug. | ||
| 290 | '("^[ \t]*\\(-?include\\|if\\(n?eq\\|n?def\\)?\\)[ \t]+\\([^: \t\n#]+\\)" | ||
| 291 | (1 font-lock-reference-face) (3 font-lock-variable-name-face)) | ||
| 292 | |||
| 293 | ;; Fontify endif and else. | ||
| 294 | '("^[ \t]*\\(else\\|endif\\)[ \t]*\\(#.*$\\)?" | ||
| 295 | (1 font-lock-reference-face)) | ||
| 296 | |||
| 288 | ;; Highlight lines that contain just whitespace. | 297 | ;; Highlight lines that contain just whitespace. |
| 289 | ;; They can cause trouble, especially if they start with a tab. | 298 | ;; They can cause trouble, especially if they start with a tab. |
| 290 | '("^[ \t]+$" . makefile-space-face) | 299 | '("^[ \t]+$" . makefile-space-face) |
| @@ -359,6 +368,12 @@ The function must satisfy this calling convention: | |||
| 359 | () | 368 | () |
| 360 | (define-abbrev-table 'makefile-mode-abbrev-table ())) | 369 | (define-abbrev-table 'makefile-mode-abbrev-table ())) |
| 361 | 370 | ||
| 371 | (defvar makefile-mode-abbrev-table nil | ||
| 372 | "Abbrev table in use in Makefile buffers.") | ||
| 373 | (if makefile-mode-abbrev-table | ||
| 374 | () | ||
| 375 | (define-abbrev-table 'makefile-mode-abbrev-table ())) | ||
| 376 | |||
| 362 | (defvar makefile-mode-map nil | 377 | (defvar makefile-mode-map nil |
| 363 | "The keymap that is used in Makefile mode.") | 378 | "The keymap that is used in Makefile mode.") |
| 364 | 379 | ||
| @@ -595,6 +610,9 @@ makefile-special-targets-list: | |||
| 595 | ;; Other abbrevs. | 610 | ;; Other abbrevs. |
| 596 | (setq local-abbrev-table makefile-mode-abbrev-table) | 611 | (setq local-abbrev-table makefile-mode-abbrev-table) |
| 597 | 612 | ||
| 613 | ;; Other abbrevs. | ||
| 614 | (setq local-abbrev-table makefile-mode-abbrev-table) | ||
| 615 | |||
| 598 | ;; Filling. | 616 | ;; Filling. |
| 599 | (make-local-variable 'fill-paragraph-function) | 617 | (make-local-variable 'fill-paragraph-function) |
| 600 | (setq fill-paragraph-function 'makefile-fill-paragraph) | 618 | (setq fill-paragraph-function 'makefile-fill-paragraph) |