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: "Trudeau, John" <JFTrudeau <at> aetna.com>
To: "'Lars Ingebrigtsen'" <larsi <at> gnus.org>
Cc: "'20787 <at> debbugs.gnu.org'" <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 18:21:55 +0000
Here is the changed part of the REGEX:

Original:
 *override\\) *

New:
[ \t]*override\\)[ \t]*

This is important for target-specific variable assignment.
Change the `SPACES' to `[\t ]' (TAB SPACE).

Thanks,
John

-----Original Message-----
From: Lars Ingebrigtsen [mailto:larsi <at> gnus.org] 
Sent: Tuesday, February 23, 2016 3:07 AM
To: Trudeau, John
Cc: 20787 <at> debbugs.gnu.org
Subject: Re: bug#20787: 24.3; make-mode doesn't hightlight macro assignments preceeded by a TAB

"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: https://urldefense.proofpoint.com/v2/url?u=http-3A__lars.ingebrigtsen.no&d=BQIBAg&c=wluqKIiwffOpZ6k5sqMWMBOn0vyYnlulRJmmvOXCFpM&r=g4hGb7ya7TWqP8eeUhVvlXxQ2rc8iw5TNL7JTeOc9gI&m=WNK5_pDm2RMy9qGPAFHUiAgYvBKrYL80X_PPIZncXbo&s=VxPNZRd_NEc0l0y2i6qrkcZz2wuSCK9c_Eypq7yoiiQ&e= 

This e-mail may contain confidential or privileged information. If you think you have received this e-mail in error, please advise the sender by reply e-mail and then delete this e-mail immediately. Thank you. Aetna




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.