GNU bug report logs - #20787
24.3; make-mode doesn't hightlight macro assignments preceeded by a TAB

Previous Next

Package: emacs;

Reported by: "John F. Trudeau" <JFTrudeau <at> aetna.com>

Date: Thu, 11 Jun 2015 20:05:02 UTC

Severity: minor

Tags: fixed, patch

Found in version 24.3

Fixed in version 25.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "John F. Trudeau" <JFTrudeau <at> aetna.com>
Cc: 20787 <at> debbugs.gnu.org
Subject: bug#20787: 24.3; make-mode doesn't hightlight macro assignments preceeded by a TAB
Date: Tue, 23 Feb 2016 21:07:19 +1100
"John F. Trudeau" <JFTrudeau <at> aetna.com> writes:

> The constant makefile-macroassign-regex (used for highlighting), in
> make-mode.el, does not find an assignment that is preceded by a TAB
> character.  The attached patch corrects the regular expression to allow
> TAB as well as SPACE before an assignment, which corrects highlighting.
>
>  -rw-r--r-- trudeajo/users       158 ChangeLog
>  -rw-r--r-- trudeajo/users      2101 make-mode.el.patch
>
> This bug has endured through many emacs releases.

I've detarred the patch and included it below, but I can't really say
whether it makes sense or not.  Anybody?

diff -C7 -L /home/trudeajo/.emacs.d/lisp/make-mode.el.gz.\~1\~ -L /home/trudeajo/.emacs.d/lisp/make-mode.el.gz /tmp/jka-com58327184q60 /tmp/jka-com58327184pOK
*** /home/trudeajo/.emacs.d/lisp/make-mode.el.gz.~1~
--- /home/trudeajo/.emacs.d/lisp/make-mode.el.gz
***************
*** 287,301 ****
  ;; that if you change this regexp you might have to fix the imenu index in
  ;; makefile-imenu-generic-expression.
  (defconst makefile-macroassign-regex
    ;; We used to match not just the varname but also the whole value
    ;; (spanning potentially several lines).
    ;; "^ *\\([^ \n\t][^:#= \t\n]*\\)[ \t]*\\(?:!=[ \t]*\\(\\(?:.+\\\\\n\\)*.+\\)\\|[*:+]?[:?]?=[ \t]*\\(\\(?:.*\\\\\n\\)*.*\\)\\)"
    ;; What about the define statement?  What about differentiating this for makepp?
!   "\\(?:^\\|^export\\|^override\\|:\\|: *override\\) *\\([^ \n\t][^:#= \t\n]*\\)[ \t]*\\(?:!=\\|[*:+]?[:?]?=\\)"
    "Regex used to find macro assignment lines in a makefile.")
  
  (defconst makefile-var-use-regex
    "[^$]\\$[({]\\([-a-zA-Z0-9_.]+\\|[@%<?^+*][FD]?\\)"
    "Regex used to find $(macro) uses in a makefile.")
  
  (defconst makefile-ignored-files-in-pickup-regex
--- 287,301 ----
  ;; that if you change this regexp you might have to fix the imenu index in
  ;; makefile-imenu-generic-expression.
  (defconst makefile-macroassign-regex
    ;; We used to match not just the varname but also the whole value
    ;; (spanning potentially several lines).
    ;; "^ *\\([^ \n\t][^:#= \t\n]*\\)[ \t]*\\(?:!=[ \t]*\\(\\(?:.+\\\\\n\\)*.+\\)\\|[*:+]?[:?]?=[ \t]*\\(\\(?:.*\\\\\n\\)*.*\\)\\)"
    ;; What about the define statement?  What about differentiating this for makepp?
!   "\\(?:^\\|^export\\|^override\\|:\\|:[ \t]*override\\)[ \t]*\\([^ \n\t][^:#= \t\n]*\\)[ \t]*\\(?:!=\\|[*:+]?[:?]?=\\)"
    "Regex used to find macro assignment lines in a makefile.")
  
  (defconst makefile-var-use-regex
    "[^$]\\$[({]\\([-a-zA-Z0-9_.]+\\|[@%<?^+*][FD]?\\)"
    "Regex used to find $(macro) uses in a makefile.")
  
  (defconst makefile-ignored-files-in-pickup-regex



-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 9 years and 145 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.