comparison lisp/progmodes/make-mode.el @ 12373:58b96b3c285e

(makefile-define-tab-face): New function. (makefile-tab-face): Don't create face here. (makefile-mode): Call makefile-define-tab-face.
author Richard M. Stallman <rms@gnu.org>
date Sat, 24 Jun 1995 07:34:27 +0000
parents ac7375e60931
children e519963ce31a
comparison
equal deleted inserted replaced
12372:91dc931a32c8 12373:58b96b3c285e
12 ;; Also, the doc strings need fixing: the first line doesn't stand alone, 12 ;; Also, the doc strings need fixing: the first line doesn't stand alone,
13 ;; and other usage is not high quality. Symbol names don't have `...'. 13 ;; and other usage is not high quality. Symbol names don't have `...'.
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
21 ;; GNU Emacs is free software; you can redistribute it and/or modify 21 ;; GNU Emacs is free software; you can redistribute it and/or modify
22 ;; it under the terms of the GNU General Public License as published by 22 ;; it under the terms of the GNU General Public License as published by
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 ;; 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
221 (list 214 (list
222 ;; Do macro assignments. These get the "variable-name" face rather 215 ;; Do macro assignments. These get the "variable-name" face rather
492 (make-local-variable 'makefile-has-prereqs) 485 (make-local-variable 'makefile-has-prereqs)
493 (make-local-variable 'makefile-need-target-pickup) 486 (make-local-variable 'makefile-need-target-pickup)
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
500 ;; Add-log. 494 ;; Add-log.
501 (make-local-variable 'add-log-current-defun-function) 495 (make-local-variable 'add-log-current-defun-function)
1365 (match-beginning n)) 1359 (match-beginning n))
1366 alist)))) 1360 alist))))
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