emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/make-mode.el


From: Daniel Pfeiffer
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/make-mode.el
Date: Tue, 14 Jun 2005 18:33:56 -0400

Index: emacs/lisp/progmodes/make-mode.el
diff -c emacs/lisp/progmodes/make-mode.el:1.102 
emacs/lisp/progmodes/make-mode.el:1.103
*** emacs/lisp/progmodes/make-mode.el:1.102     Wed Jun  8 15:43:59 2005
--- emacs/lisp/progmodes/make-mode.el   Tue Jun 14 22:33:56 2005
***************
*** 99,128 ****
    :group 'tools
    :prefix "makefile-")
  
! (defface makefile-space-face
    '((((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
    ;; This needs to go along both with foreground and background colors (i.e. 
shell)
!   '((t (:underline t)))
    "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")))
    "Face to use for additionally highlighting Shell commands in Font-Lock 
mode."
    :group 'faces
    :group 'makefile
    :version "22.1")
  
! (defface makefile-makepp-perl-face
    '((((class color) (background light)) (:background  "LightBlue1")) ; Camel 
Book
      (((class color) (background dark)) (:background  "DarkBlue"))
      (t (:reverse-video t)))
--- 99,129 ----
    :group 'tools
    :prefix "makefile-")
  
! (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
    ;; This needs to go along both with foreground and background colors (i.e. 
shell)
!   '((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
!   ()
!   ;;'((((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
    '((((class color) (background light)) (:background  "LightBlue1")) ; Camel 
Book
      (((class color) (background dark)) (:background  "DarkBlue"))
      (t (:reverse-video t)))
***************
*** 302,309 ****
    "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
    "Face to use for highlighting leading spaces in Font-Lock mode.")
  
  ;; These lists were inspired by the old solution.  But they are silly, because
--- 303,310 ----
    "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))
! (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,361 ****
      (,makefile-macroassign-regex
       (1 font-lock-variable-name-face)
       ;; This is for after !=
!      (2 'makefile-shell-face 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)
       ;; Only makepp has builtin commands.
       (3 font-lock-builtin-face prepend t))
  
--- 349,362 ----
      (,makefile-macroassign-regex
       (1 font-lock-variable-name-face)
       ;; This is for after !=
!      (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 prepend)
       ;; Only makepp has builtin commands.
       (3 font-lock-builtin-face prepend t))
  
***************
*** 367,373 ****
      ("[^$]\\$\\(address@hidden<?^+*_]\\|[a-zA-Z0-9]\\>\\)"
       1 font-lock-constant-face prepend)
      ("[^$]\\(address@hidden)"
!      1 'makefile-targets-face prepend)
  
      ;; Fontify conditionals and includes.
      (,(concat "^\\(?: [ \t]*\\)?"
--- 368,374 ----
      ("[^$]\\$\\(address@hidden<?^+*_]\\|[a-zA-Z0-9]\\>\\)"
       1 font-lock-constant-face prepend)
      ("[^$]\\(address@hidden)"
!      1 'makefile-targets append)
  
      ;; Fontify conditionals and includes.
      (,(concat "^\\(?: [ \t]*\\)?"
***************
*** 382,403 ****
      ,@(if space
          '(;; Highlight lines that contain just whitespace.
            ;; They can cause trouble, especially if they start with a tab.
!           ("^[ \t]+$" . makefile-space-face)
  
            ;; Highlight shell comments that Make treats as commands,
            ;; since these can fool people.
!           ("^\t+#" 0 makefile-space-face t)
  
            ;; Highlight spaces that precede tabs.
            ;; They can make a tab fail to be effective.
!           ("^\\( +\\)\t" 1 makefile-space-face)))
  
      ,@font-lock-keywords
  
      ;; Do dependencies.
      (makefile-match-dependency
!      (1 'makefile-targets-face prepend)
!      (3 'makefile-shell-face prepend t))))
  
  (defconst makefile-font-lock-keywords
    (makefile-make-font-lock-keywords
--- 383,404 ----
      ,@(if space
          '(;; Highlight lines that contain just whitespace.
            ;; They can cause trouble, especially if they start with a tab.
!           ("^[ \t]+$" . makefile-space)
  
            ;; Highlight shell comments that Make treats as commands,
            ;; since these can fool people.
!           ("^\t+#" 0 makefile-space t)
  
            ;; Highlight spaces that precede tabs.
            ;; They can make a tab fail to be effective.
!           ("^\\( +\\)\t" 1 makefile-space)))
  
      ,@font-lock-keywords
  
      ;; Do dependencies.
      (makefile-match-dependency
!      (1 'makefile-targets prepend)
!      (3 'makefile-shell prepend t))))
  
  (defconst makefile-font-lock-keywords
    (makefile-make-font-lock-keywords
***************
*** 419,425 ****
     "^\\(?: [ \t]*\\)?if\\(n\\)\\(?:def\\|eq\\)\\>"
  
     '("[^$]\\(\\$[(address@hidden)]\\)"
!      1 'makefile-targets-face prepend)
  
     ;; $(function ...) ${function ...}
     '("[^$]\\$[({]\\([-a-zA-Z0-9_.]+\\s \\)"
--- 420,426 ----
     "^\\(?: [ \t]*\\)?if\\(n\\)\\(?:def\\|eq\\)\\>"
  
     '("[^$]\\(\\$[(address@hidden)]\\)"
!      1 'makefile-targets append)
  
     ;; $(function ...) ${function ...}
     '("[^$]\\$[({]\\([-a-zA-Z0-9_.]+\\s \\)"
***************
*** 428,434 ****
     ;; $(shell ...) ${shell ...}
     '("[^$]\\$\\([({]\\)shell[ \t]+"
       makefile-match-function-end nil nil
!      (1 'makefile-shell-face prepend t))))
  
  (defconst makefile-makepp-font-lock-keywords
    (makefile-make-font-lock-keywords
--- 429,435 ----
     ;; $(shell ...) ${shell ...}
     '("[^$]\\$\\([({]\\)shell[ \t]+"
       makefile-match-function-end nil nil
!      (1 'makefile-shell prepend t))))
  
  (defconst makefile-makepp-font-lock-keywords
    (makefile-make-font-lock-keywords
***************
*** 438,444 ****
     "^\\(?: [ \t]*\\)?\\(?:and[ \t]+\\|else[ \t]+\\|or[ 
\t]+\\)?if\\(n\\)\\(?:def\\|eq\\|sys\\)\\>"
  
     '("[^$]\\(\\$[({]\\(?:output\\|stem\\|target\\)s?\\_>.*?[})]\\)"
!      1 'makefile-targets-face prepend)
  
     ;; Colon modifier keywords.
     '("\\(:\\s 
*\\)\\(build_c\\(?:ache\\|heck\\)\\|env\\(?:ironment\\)?\\|foreach\\|signature\\|scanner\\|quickscan\\|smartscan\\)\\>\\([^:\n]*\\)"
--- 439,445 ----
     "^\\(?: [ \t]*\\)?\\(?:and[ \t]+\\|else[ \t]+\\|or[ 
\t]+\\)?if\\(n\\)\\(?:def\\|eq\\|sys\\)\\>"
  
     '("[^$]\\(\\$[({]\\(?:output\\|stem\\|target\\)s?\\_>.*?[})]\\)"
!      1 'makefile-targets append)
  
     ;; Colon modifier keywords.
     '("\\(:\\s 
*\\)\\(build_c\\(?:ache\\|heck\\)\\|env\\(?:ironment\\)?\\|foreach\\|signature\\|scanner\\|quickscan\\|smartscan\\)\\>\\([^:\n]*\\)"
***************
*** 453,484 ****
     ;; $(shell ...) $((shell ...)) ${shell ...} ${{shell ...}}
     '("[^$]\\$\\(((?\\|{{?\\)shell\\(?:[-_]\\(?:global[-_]\\)?once\\)?[ \t]+"
       makefile-match-function-end nil nil
!      (1 'makefile-shell-face prepend t))
  
     ;; $(perl ...) $((perl ...)) ${perl ...} ${{perl ...}}
     '("[^$]\\$\\(((?\\|{{?\\)makeperl[ \t]+"
       makefile-match-function-end nil nil
!      (1 'makefile-makepp-perl-face prepend t))
     '("[^$]\\$\\(((?\\|{{?\\)perl[ \t]+"
       makefile-match-function-end nil nil
!      (1 'makefile-makepp-perl-face 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)
  
     ;; 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))
     '("\\<\\(?: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))
  
     ;; Statement style perl block.
     '("perl[-_]begin\\s *\\(?:\\s #.*\\)?\n\\(\\(?:.*\n\\)+?\\)\\s 
*perl[-_]end\\>"
!      1 'makefile-makepp-perl-face t)))
  
  (defconst makefile-bsdmake-font-lock-keywords
    (makefile-make-font-lock-keywords
--- 454,485 ----
     ;; $(shell ...) $((shell ...)) ${shell ...} ${{shell ...}}
     '("[^$]\\$\\(((?\\|{{?\\)shell\\(?:[-_]\\(?:global[-_]\\)?once\\)?[ \t]+"
       makefile-match-function-end nil nil
!      (1 'makefile-shell prepend t))
  
     ;; $(perl ...) $((perl ...)) ${perl ...} ${{perl ...}}
     '("[^$]\\$\\(((?\\|{{?\\)makeperl[ \t]+"
       makefile-match-function-end nil nil
!      (1 'makefile-makepp-perl prepend t))
     '("[^$]\\$\\(((?\\|{{?\\)perl[ \t]+"
       makefile-match-function-end nil nil
!      (1 'makefile-makepp-perl t t))
  
     ;; Can we unify these with (if (match-end 1) 'prepend 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 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 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 t)))
  
  (defconst makefile-bsdmake-font-lock-keywords
    (makefile-make-font-lock-keywords
***************
*** 911,916 ****
--- 912,919 ----
              (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,1705 ****
--- 1703,1710 ----
        (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))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]