diff options
| author | Richard M. Stallman | 1995-08-21 17:27:04 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-08-21 17:27:04 +0000 |
| commit | 118a98570ee84334fb86bfb69f2dfdda784f0fb2 (patch) | |
| tree | aec577134890b5b5c7d5640166e53f02cab5f7c2 /lisp/progmodes | |
| parent | 6e626f7e5bc0668739abfbd6fde7ed7d67bab86b (diff) | |
| download | emacs-118a98570ee84334fb86bfb69f2dfdda784f0fb2.tar.gz emacs-118a98570ee84334fb86bfb69f2dfdda784f0fb2.zip | |
(makefile-space-face): New variable.
(makefile-define-space-face): New function.
(makefile-tab-face): Variable deleted.
(makefile-define-tab-face): Function deleted.
(makefile-font-lock-keywords): Highlight leading spaces, not tabs.
Diffstat (limited to 'lisp/progmodes')
| -rw-r--r-- | lisp/progmodes/make-mode.el | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 486d2086682..f28cbf95a27 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | ;; So, for the meantime, this is not the default mode for makefiles. | 15 | ;; So, for the meantime, this is not the default mode for makefiles. |
| 16 | 16 | ||
| 17 | ;; $Id: makefile.el,v 1.22 1995/06/15 20:42:24 kwzh Exp rms $ | 17 | ;; $Id: makefile.el,v 1.23 1995/06/24 07:34:27 rms Exp rms $ |
| 18 | 18 | ||
| 19 | ;; This file is part of GNU Emacs. | 19 | ;; This file is part of GNU Emacs. |
| 20 | 20 | ||
| @@ -205,10 +205,8 @@ not be enclosed in { } or ( ).") | |||
| 205 | "\\(^\\..*\\)\\|\\(.*~$\\)\\|\\(.*,v$\\)\\|\\(\\.[chy]\\)" | 205 | "\\(^\\..*\\)\\|\\(.*~$\\)\\|\\(.*,v$\\)\\|\\(\\.[chy]\\)" |
| 206 | "Regex for filenames that will NOT be included in the target list.") | 206 | "Regex for filenames that will NOT be included in the target list.") |
| 207 | 207 | ||
| 208 | ;; TABs are important in Makefiles. So highlight them in font-lock. | 208 | (defvar makefile-space-face 'makefile-space-face |
| 209 | ;; Thanks to Job Ganzevoort <Job.Ganzevoort@cwi.nl> for this. | 209 | "Face to use for highlighting leading spaces in Font-Lock mode.") |
| 210 | (defvar makefile-tab-face 'makefile-tab-face | ||
| 211 | "Face to use for highlighting leading tabs in font-lock-mode.") | ||
| 212 | 210 | ||
| 213 | (defconst makefile-font-lock-keywords | 211 | (defconst makefile-font-lock-keywords |
| 214 | (list | 212 | (list |
| @@ -222,9 +220,11 @@ not be enclosed in { } or ( ).") | |||
| 222 | ;; Do dependencies. These get the function name face. | 220 | ;; Do dependencies. These get the function name face. |
| 223 | (list makefile-dependency-regex 1 'font-lock-function-name-face) | 221 | (list makefile-dependency-regex 1 'font-lock-function-name-face) |
| 224 | 222 | ||
| 225 | ;; Highlight leading tab. Maybe highlighting all leading TABs | 223 | ;; Highlight leading spaces, since they are hard to see and |
| 226 | ;; would be nice? I don't know. | 224 | ;; can make a makefile fail to function. |
| 227 | '("^\t" . makefile-tab-face))) | 225 | ;; Don't highlight leading tabs, because they are normal |
| 226 | ;; and people assume that 8 cols of whitespace means a tab. | ||
| 227 | '("^ " . makefile-space-face))) | ||
| 228 | 228 | ||
| 229 | ;;; ------------------------------------------------------------ | 229 | ;;; ------------------------------------------------------------ |
| 230 | ;;; The following configurable variables are used in the | 230 | ;;; The following configurable variables are used in the |
| @@ -487,7 +487,7 @@ makefile-special-targets-list: | |||
| 487 | (make-local-variable 'makefile-need-macro-pickup) | 487 | (make-local-variable 'makefile-need-macro-pickup) |
| 488 | 488 | ||
| 489 | ;; Font lock. | 489 | ;; Font lock. |
| 490 | (makefile-define-tab-face) | 490 | (makefile-define-space-face) |
| 491 | (make-local-variable 'font-lock-defaults) | 491 | (make-local-variable 'font-lock-defaults) |
| 492 | (setq font-lock-defaults '(makefile-font-lock-keywords)) | 492 | (setq font-lock-defaults '(makefile-font-lock-keywords)) |
| 493 | 493 | ||
| @@ -1361,9 +1361,9 @@ Uses `makefile-use-curly-braces-for-macros-p'." | |||
| 1361 | (imenu-progress-message stupid 100) | 1361 | (imenu-progress-message stupid 100) |
| 1362 | (nreverse alist))) | 1362 | (nreverse alist))) |
| 1363 | 1363 | ||
| 1364 | (defun makefile-define-tab-face () | 1364 | (defun makefile-define-space-face () |
| 1365 | (make-face 'makefile-tab-face) | 1365 | (make-face 'makefile-space-face) |
| 1366 | (or (face-differs-from-default-p 'makefile-tab-face) | 1366 | (or (face-differs-from-default-p 'makefile-space-face) |
| 1367 | (let* ((light-bg (eq font-lock-background-mode 'light)) | 1367 | (let* ((light-bg (eq font-lock-background-mode 'light)) |
| 1368 | (bg-color | 1368 | (bg-color |
| 1369 | (cond ((memq font-lock-display-type '(mono monochrome)) | 1369 | (cond ((memq font-lock-display-type '(mono monochrome)) |
| @@ -1375,6 +1375,6 @@ Uses `makefile-use-curly-braces-for-macros-p'." | |||
| 1375 | "hotpink") | 1375 | "hotpink") |
| 1376 | (t ; Dark color background. | 1376 | (t ; Dark color background. |
| 1377 | "hotpink")))) | 1377 | "hotpink")))) |
| 1378 | (set-face-background 'makefile-tab-face bg-color)))) | 1378 | (set-face-background 'makefile-space-face bg-color)))) |
| 1379 | 1379 | ||
| 1380 | ;;; makefile.el ends here | 1380 | ;;; makefile.el ends here |