aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/make-mode.el28
1 files changed, 19 insertions, 9 deletions
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index 33ffc31a9ec..486d2086682 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.21 1995/05/30 23:02:13 kwzh Exp kwzh $ 17;; $Id: makefile.el,v 1.22 1995/06/15 20:42:24 kwzh Exp rms $
18 18
19;; This file is part of GNU Emacs. 19;; This file is part of GNU Emacs.
20 20
@@ -207,14 +207,7 @@ not be enclosed in { } or ( ).")
207 207
208;; TABs are important in Makefiles. So highlight them in font-lock. 208;; TABs are important in Makefiles. So highlight them in font-lock.
209;; Thanks to Job Ganzevoort <Job.Ganzevoort@cwi.nl> for this. 209;; Thanks to Job Ganzevoort <Job.Ganzevoort@cwi.nl> for this.
210(defvar makefile-tab-face 210(defvar makefile-tab-face 'makefile-tab-face
211 (if (fboundp 'make-face)
212 (progn
213 (make-face 'makefile-tab-face)
214 (or (face-differs-from-default-p 'makefile-tab-face)
215 (set-face-background 'makefile-tab-face "hotpink"))
216 'makefile-tab-face)
217 '())
218 "Face to use for highlighting leading tabs in font-lock-mode.") 211 "Face to use for highlighting leading tabs in font-lock-mode.")
219 212
220(defconst makefile-font-lock-keywords 213(defconst makefile-font-lock-keywords
@@ -494,6 +487,7 @@ makefile-special-targets-list:
494 (make-local-variable 'makefile-need-macro-pickup) 487 (make-local-variable 'makefile-need-macro-pickup)
495 488
496 ;; Font lock. 489 ;; Font lock.
490 (makefile-define-tab-face)
497 (make-local-variable 'font-lock-defaults) 491 (make-local-variable 'font-lock-defaults)
498 (setq font-lock-defaults '(makefile-font-lock-keywords)) 492 (setq font-lock-defaults '(makefile-font-lock-keywords))
499 493
@@ -1367,4 +1361,20 @@ Uses `makefile-use-curly-braces-for-macros-p'."
1367 (imenu-progress-message stupid 100) 1361 (imenu-progress-message stupid 100)
1368 (nreverse alist))) 1362 (nreverse alist)))
1369 1363
1364(defun makefile-define-tab-face ()
1365 (make-face 'makefile-tab-face)
1366 (or (face-differs-from-default-p 'makefile-tab-face)
1367 (let* ((light-bg (eq font-lock-background-mode 'light))
1368 (bg-color
1369 (cond ((memq font-lock-display-type '(mono monochrome))
1370 (if light-bg "black" "white"))
1371 ((memq font-lock-display-type '(grayscale greyscale
1372 grayshade greyshade))
1373 (if light-bg "black" "white"))
1374 (light-bg ; Light color background.
1375 "hotpink")
1376 (t ; Dark color background.
1377 "hotpink"))))
1378 (set-face-background 'makefile-tab-face bg-color))))
1379
1370;;; makefile.el ends here 1380;;; makefile.el ends here