diff options
| -rw-r--r-- | lisp/progmodes/make-mode.el | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index f758cf191cb..45e042a546b 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el | |||
| @@ -103,6 +103,13 @@ | |||
| 103 | :group 'tools | 103 | :group 'tools |
| 104 | :prefix "makefile-") | 104 | :prefix "makefile-") |
| 105 | 105 | ||
| 106 | (defface makefile-space-face | ||
| 107 | '((((class color)) (:background "hotpink")) | ||
| 108 | (t (:reverse-video t))) | ||
| 109 | "Face to use for highlighting leading spaces in Font-Lock mode." | ||
| 110 | :group 'faces | ||
| 111 | :group 'makemode) | ||
| 112 | |||
| 106 | (defcustom makefile-browser-buffer-name "*Macros and Targets*" | 113 | (defcustom makefile-browser-buffer-name "*Macros and Targets*" |
| 107 | "Name of the macro- and target browser buffer." | 114 | "Name of the macro- and target browser buffer." |
| 108 | :type 'string | 115 | :type 'string |
| @@ -538,8 +545,6 @@ makefile-special-targets-list: | |||
| 538 | (make-local-variable 'makefile-need-macro-pickup) | 545 | (make-local-variable 'makefile-need-macro-pickup) |
| 539 | 546 | ||
| 540 | ;; Font lock. | 547 | ;; Font lock. |
| 541 | (if (fboundp 'make-face) | ||
| 542 | (makefile-define-space-face)) | ||
| 543 | (make-local-variable 'font-lock-defaults) | 548 | (make-local-variable 'font-lock-defaults) |
| 544 | (setq font-lock-defaults '(makefile-font-lock-keywords)) | 549 | (setq font-lock-defaults '(makefile-font-lock-keywords)) |
| 545 | 550 | ||
| @@ -1518,20 +1523,4 @@ If it isn't in one, return nil." | |||
| 1518 | (imenu-progress-message stupid 100) | 1523 | (imenu-progress-message stupid 100) |
| 1519 | (nreverse alist))) | 1524 | (nreverse alist))) |
| 1520 | 1525 | ||
| 1521 | (defun makefile-define-space-face () | ||
| 1522 | (make-face 'makefile-space-face) | ||
| 1523 | (or (not (eq window-system 'x)) | ||
| 1524 | (face-differs-from-default-p 'makefile-space-face) | ||
| 1525 | (let* ((params (frame-parameters)) | ||
| 1526 | (light-bg (cdr (assq 'background-mode params))) | ||
| 1527 | (bg-color (cond ((eq (cdr (assq 'display-type params)) 'mono) | ||
| 1528 | (if light-bg "black" "white")) | ||
| 1529 | ((eq (cdr (assq 'display-type params)) 'grayscale) | ||
| 1530 | (if light-bg "black" "white")) | ||
| 1531 | (light-bg ; Light color background. | ||
| 1532 | "hotpink") | ||
| 1533 | (t ; Dark color background. | ||
| 1534 | "hotpink")))) | ||
| 1535 | (set-face-background 'makefile-space-face bg-color)))) | ||
| 1536 | |||
| 1537 | ;;; make-mode.el ends here | 1526 | ;;; make-mode.el ends here |