Mercurial > emacs
changeset 63444:cc4a71461921
(makefile-space, makefile-makepp-perl): Eliminate "-face" suffix.
(makefile-targets): Inherit from font-lock-function-name-face and eliminate
"-face" suffix.
(makefile-shell): Remove attributes and eliminate "-face" suffix.
(makefile-*-font-lock-keywords): Append makefile-targets in rule actions,
instead of prepending, to make it less visible.
(makefile-previous-dependency, makefile-match-dependency): Don't match a target
on a continuation line.
author | Daniel Pfeiffer <occitan@esperanto.org> |
---|---|
date | Tue, 14 Jun 2005 22:33:56 +0000 |
parents | 24c727190495 |
children | d888311f9049 |
files | lisp/progmodes/make-mode.el |
diffstat | 1 files changed, 35 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/progmodes/make-mode.el Tue Jun 14 21:14:48 2005 +0000 +++ b/lisp/progmodes/make-mode.el Tue Jun 14 22:33:56 2005 +0000 @@ -99,30 +99,31 @@ :group 'tools :prefix "makefile-") -(defface makefile-space-face +(defface makefile-space '((((class color)) (:background "hotpink")) (t (:reverse-video t))) "Face to use for highlighting leading spaces in Font-Lock mode." :group 'faces :group 'makefile) -(defface makefile-targets-face +(defface makefile-targets ;; This needs to go along both with foreground and background colors (i.e. shell) - '((t (:underline t))) + '((t (:inherit font-lock-function-name-face))) "Face to use for additionally highlighting rule targets in Font-Lock mode." :group 'faces :group 'makefile :version "22.1") -(defface makefile-shell-face - '((((class color) (min-colors 88) (background light)) (:background "seashell1")) - (((class color) (min-colors 88) (background dark)) (:background "seashell4"))) +(defface makefile-shell + () + ;;'((((class color) (min-colors 88) (background light)) (:background "seashell1")) + ;; (((class color) (min-colors 88) (background dark)) (:background "seashell4"))) "Face to use for additionally highlighting Shell commands in Font-Lock mode." :group 'faces :group 'makefile :version "22.1") -(defface makefile-makepp-perl-face +(defface makefile-makepp-perl '((((class color) (background light)) (:background "LightBlue1")) ; Camel Book (((class color) (background dark)) (:background "DarkBlue")) (t (:reverse-video t))) @@ -302,8 +303,8 @@ "Regex for filenames that will NOT be included in the target list.") (if (fboundp 'facemenu-unlisted-faces) - (add-to-list 'facemenu-unlisted-faces 'makefile-space-face)) -(defvar makefile-space-face 'makefile-space-face + (add-to-list 'facemenu-unlisted-faces 'makefile-space)) +(defvar makefile-space 'makefile-space "Face to use for highlighting leading spaces in Font-Lock mode.") ;; These lists were inspired by the old solution. But they are silly, because @@ -348,14 +349,14 @@ (,makefile-macroassign-regex (1 font-lock-variable-name-face) ;; This is for after != - (2 'makefile-shell-face prepend t) + (2 'makefile-shell prepend t) ;; This is for after normal assignment (3 'font-lock-string-face prepend t)) ;; Rule actions. (makefile-match-action (1 font-lock-type-face) - (2 'makefile-shell-face prepend) + (2 'makefile-shell prepend) ;; Only makepp has builtin commands. (3 font-lock-builtin-face prepend t)) @@ -367,7 +368,7 @@ ("[^$]\\$\\([@%<?^+*_]\\|[a-zA-Z0-9]\\>\\)" 1 font-lock-constant-face prepend) ("[^$]\\(\\$[@%*]\\)" - 1 'makefile-targets-face prepend) + 1 'makefile-targets append) ;; Fontify conditionals and includes. (,(concat "^\\(?: [ \t]*\\)?" @@ -382,22 +383,22 @@ ,@(if space '(;; Highlight lines that contain just whitespace. ;; They can cause trouble, especially if they start with a tab. - ("^[ \t]+$" . makefile-space-face) + ("^[ \t]+$" . makefile-space) ;; Highlight shell comments that Make treats as commands, ;; since these can fool people. - ("^\t+#" 0 makefile-space-face t) + ("^\t+#" 0 makefile-space t) ;; Highlight spaces that precede tabs. ;; They can make a tab fail to be effective. - ("^\\( +\\)\t" 1 makefile-space-face))) + ("^\\( +\\)\t" 1 makefile-space))) ,@font-lock-keywords ;; Do dependencies. (makefile-match-dependency - (1 'makefile-targets-face prepend) - (3 'makefile-shell-face prepend t)))) + (1 'makefile-targets prepend) + (3 'makefile-shell prepend t)))) (defconst makefile-font-lock-keywords (makefile-make-font-lock-keywords @@ -419,7 +420,7 @@ "^\\(?: [ \t]*\\)?if\\(n\\)\\(?:def\\|eq\\)\\>" '("[^$]\\(\\$[({][@%*][DF][})]\\)" - 1 'makefile-targets-face prepend) + 1 'makefile-targets append) ;; $(function ...) ${function ...} '("[^$]\\$[({]\\([-a-zA-Z0-9_.]+\\s \\)" @@ -428,7 +429,7 @@ ;; $(shell ...) ${shell ...} '("[^$]\\$\\([({]\\)shell[ \t]+" makefile-match-function-end nil nil - (1 'makefile-shell-face prepend t)))) + (1 'makefile-shell prepend t)))) (defconst makefile-makepp-font-lock-keywords (makefile-make-font-lock-keywords @@ -438,7 +439,7 @@ "^\\(?: [ \t]*\\)?\\(?:and[ \t]+\\|else[ \t]+\\|or[ \t]+\\)?if\\(n\\)\\(?:def\\|eq\\|sys\\)\\>" '("[^$]\\(\\$[({]\\(?:output\\|stem\\|target\\)s?\\_>.*?[})]\\)" - 1 'makefile-targets-face prepend) + 1 'makefile-targets append) ;; Colon modifier keywords. '("\\(:\\s *\\)\\(build_c\\(?:ache\\|heck\\)\\|env\\(?:ironment\\)?\\|foreach\\|signature\\|scanner\\|quickscan\\|smartscan\\)\\>\\([^:\n]*\\)" @@ -453,32 +454,32 @@ ;; $(shell ...) $((shell ...)) ${shell ...} ${{shell ...}} '("[^$]\\$\\(((?\\|{{?\\)shell\\(?:[-_]\\(?:global[-_]\\)?once\\)?[ \t]+" makefile-match-function-end nil nil - (1 'makefile-shell-face prepend t)) + (1 'makefile-shell prepend t)) ;; $(perl ...) $((perl ...)) ${perl ...} ${{perl ...}} '("[^$]\\$\\(((?\\|{{?\\)makeperl[ \t]+" makefile-match-function-end nil nil - (1 'makefile-makepp-perl-face prepend t)) + (1 'makefile-makepp-perl prepend t)) '("[^$]\\$\\(((?\\|{{?\\)perl[ \t]+" makefile-match-function-end nil nil - (1 'makefile-makepp-perl-face t t)) + (1 'makefile-makepp-perl t t)) ;; Can we unify these with (if (match-end 1) 'prepend t)? - '("ifmakeperl\\s +\\(.*\\)" 1 'makefile-makepp-perl-face prepend) - '("ifperl\\s +\\(.*\\)" 1 'makefile-makepp-perl-face t) + '("ifmakeperl\\s +\\(.*\\)" 1 'makefile-makepp-perl prepend) + '("ifperl\\s +\\(.*\\)" 1 'makefile-makepp-perl t) ;; Perl block single- or multiline, as statement or rule action. ;; Don't know why the initial newline in 2nd variant of group 2 doesn't get skipped. '("\\<make\\(?:perl\\|sub\\s +\\S +\\)\\s *\n?\\s *{\\(?:{\\s *\n?\\(\\(?:.*\n\\)+?\\)\\s *}\\|\\s *\\(\\(?:.*?\\|\n?\\(?:.*\n\\)+?\\)\\)\\)}" - (1 'makefile-makepp-perl-face prepend t) - (2 'makefile-makepp-perl-face prepend t)) + (1 'makefile-makepp-perl prepend t) + (2 'makefile-makepp-perl prepend t)) '("\\<\\(?:perl\\|sub\\s +\\S +\\)\\s *\n?\\s *{\\(?:{\\s *\n?\\(\\(?:.*\n\\)+?\\)\\s *}\\|\\s *\\(\\(?:.*?\\|\n?\\(?:.*\n\\)+?\\)\\)\\)}" - (1 'makefile-makepp-perl-face t t) - (2 'makefile-makepp-perl-face t t)) + (1 'makefile-makepp-perl t t) + (2 'makefile-makepp-perl t t)) ;; Statement style perl block. '("perl[-_]begin\\s *\\(?:\\s #.*\\)?\n\\(\\(?:.*\n\\)+?\\)\\s *perl[-_]end\\>" - 1 'makefile-makepp-perl-face t))) + 1 'makefile-makepp-perl t))) (defconst makefile-bsdmake-font-lock-keywords (makefile-make-font-lock-keywords @@ -911,6 +912,8 @@ (backward-char)) (get-text-property (point) 'face) (beginning-of-line) + (if (> (point) (+ (point-min) 2)) + (eq (char-before (1- (point))) ?\\)) (if (looking-at makefile-dependency-regex) (throw 'found t)))) (goto-char pt) @@ -1700,6 +1703,8 @@ (forward-char) (or (eq (char-after) ?=) (get-text-property (1- (point)) 'face) + (if (> (line-beginning-position) (+ (point-min) 2)) + (eq (char-before (line-end-position 0)) ?\\)) (when (save-excursion (beginning-of-line) (looking-at makefile-dependency-regex))