From: Richard M. Stallman Date: Sat, 24 Jun 1995 07:34:27 +0000 (+0000) Subject: (makefile-define-tab-face): New function. X-Git-Tag: emacs-19.34~3486 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3fc9add97b53ce1dd2f972926d3155cc4eaceafe;p=emacs.git (makefile-define-tab-face): New function. (makefile-tab-face): Don't create face here. (makefile-mode): Call makefile-define-tab-face. --- 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 @@ ;; So, for the meantime, this is not the default mode for makefiles. -;; $Id: makefile.el,v 1.21 1995/05/30 23:02:13 kwzh Exp kwzh $ +;; $Id: makefile.el,v 1.22 1995/06/15 20:42:24 kwzh Exp rms $ ;; This file is part of GNU Emacs. @@ -207,14 +207,7 @@ not be enclosed in { } or ( ).") ;; TABs are important in Makefiles. So highlight them in font-lock. ;; Thanks to Job Ganzevoort for this. -(defvar makefile-tab-face - (if (fboundp 'make-face) - (progn - (make-face 'makefile-tab-face) - (or (face-differs-from-default-p 'makefile-tab-face) - (set-face-background 'makefile-tab-face "hotpink")) - 'makefile-tab-face) - '()) +(defvar makefile-tab-face 'makefile-tab-face "Face to use for highlighting leading tabs in font-lock-mode.") (defconst makefile-font-lock-keywords @@ -494,6 +487,7 @@ makefile-special-targets-list: (make-local-variable 'makefile-need-macro-pickup) ;; Font lock. + (makefile-define-tab-face) (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(makefile-font-lock-keywords)) @@ -1367,4 +1361,20 @@ Uses `makefile-use-curly-braces-for-macros-p'." (imenu-progress-message stupid 100) (nreverse alist))) +(defun makefile-define-tab-face () + (make-face 'makefile-tab-face) + (or (face-differs-from-default-p 'makefile-tab-face) + (let* ((light-bg (eq font-lock-background-mode 'light)) + (bg-color + (cond ((memq font-lock-display-type '(mono monochrome)) + (if light-bg "black" "white")) + ((memq font-lock-display-type '(grayscale greyscale + grayshade greyshade)) + (if light-bg "black" "white")) + (light-bg ; Light color background. + "hotpink") + (t ; Dark color background. + "hotpink")))) + (set-face-background 'makefile-tab-face bg-color)))) + ;;; makefile.el ends here