GNU bug report logs -
#19882
25.0.50; Backwards font-lock regex in m4-mode
Previous Next
Reported by: Rupert Swarbrick <ruperts <at> broadcom.com>
Date: Mon, 16 Feb 2015 11:34:02 UTC
Severity: normal
Tags: fixed
Found in version 25.0.50
Fixed in version 25.1
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19882 in the body.
You can then email your comments to 19882 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19882
; Package
emacs
.
(Mon, 16 Feb 2015 11:34:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Rupert Swarbrick <ruperts <at> broadcom.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 16 Feb 2015 11:34:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
In m4-mode.el, the last two sexps in m4-font-lock-keywords are the wrong
way around. As a result, if you are writing M4 code to be expanded in
"-P mode", so have things like
m4_define
in the file, then the "define" part gets matched by the penultimate
regex, so m4_ doesn't get highlighted as part of a keyword.
I think the fix for this is to just swap the two regexes around. That
said, the commented stuff at the bottom of the file is rather
ugly. Maybe it would be better to have a single regex, made with
something like:
(regexp-opt (append (mapcar (lambda (kw)
(concat "m4_" kw))
prefixed)
prefixed
unprefixed))
with prefixed containing:
'("builtin" "changecom" "changequote" "changeword" "debugfile"
"debugmode" "decr" "define" "defn" "divert" "divnum" "dnl"
"dumpdef" "errprint" "esyscmd" "eval" "file" "format"
"ifdef" "ifelse" "include" "incr" "index" "indir" "len" "line"
"m4exit" "m4wrap" "maketemp" "patsubst" "popdef" "pushdef" "regexp"
"shift" "sinclude" "substr" "syscmd" "sysval" "traceoff" "traceon"
"translit" "undefine" "undivert" "unix"))
and unprefixed containing:
'("gnu")
Or maybe the absence of m4_gnu is a typo, in which case the logic could
be slightly simpler. I'm assuming that "m4_m4_undefine" at the bottom of
the file is a mistake.
Sorry there's no patch: I've requested assignment papers, but they
haven't come through yet. Since I think I've hit my minimal change
limit, someone else gets to type the code...
Rupert
In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars)
of 2015-02-09 on <an-internal-hostname>
Repository revision: 2f7008715326a49770fcb82003ed78eab28c0626
Windowing system distributor `The X.Org Foundation', version 11.0.11300000
I'm trimming the rest of the build info because I'm pretty certain it's
not relevant to this report and contains lots of internal company paths.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19882
; Package
emacs
.
(Mon, 21 Mar 2016 05:31:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 19882 <at> debbugs.gnu.org (full text, mbox):
On 2015-02-16, at 11:32, Rupert Swarbrick <ruperts <at> broadcom.com> wrote:
> In m4-mode.el, the last two sexps in m4-font-lock-keywords are the wrong
> way around. As a result, if you are writing M4 code to be expanded in
> "-P mode", so have things like
>
> m4_define
>
> in the file, then the "define" part gets matched by the penultimate
> regex, so m4_ doesn't get highlighted as part of a keyword.
>
> I think the fix for this is to just swap the two regexes around. That
> said, the commented stuff at the bottom of the file is rather
> ugly. Maybe it would be better to have a single regex, made with
> something like:
>
> (regexp-opt (append (mapcar (lambda (kw)
> (concat "m4_" kw))
> prefixed)
> prefixed
> unprefixed))
>
> with prefixed containing:
>
> '("builtin" "changecom" "changequote" "changeword" "debugfile"
> "debugmode" "decr" "define" "defn" "divert" "divnum" "dnl"
> "dumpdef" "errprint" "esyscmd" "eval" "file" "format"
> "ifdef" "ifelse" "include" "incr" "index" "indir" "len" "line"
> "m4exit" "m4wrap" "maketemp" "patsubst" "popdef" "pushdef" "regexp"
> "shift" "sinclude" "substr" "syscmd" "sysval" "traceoff" "traceon"
> "translit" "undefine" "undivert" "unix"))
>
>
> and unprefixed containing:
>
> '("gnu")
>
>
> Or maybe the absence of m4_gnu is a typo, in which case the logic could
> be slightly simpler. I'm assuming that "m4_m4_undefine" at the bottom of
> the file is a mistake.
>
> Sorry there's no patch: I've requested assignment papers, but they
> haven't come through yet. Since I think I've hit my minimal change
> limit, someone else gets to type the code...
Hi,
in case the problem is still there (I don't use m4, so it's difficult
for me to verify it), would you be able to provide a patch now?
> Rupert
Best,
--
Marcin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19882
; Package
emacs
.
(Wed, 06 Jun 2018 00:10:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 19882 <at> debbugs.gnu.org (full text, mbox):
tags 19882 fixed
close 19882 25.1
quit
Marcin Borkowski <mbork <at> mbork.pl> writes:
> On 2015-02-16, at 11:32, Rupert Swarbrick <ruperts <at> broadcom.com> wrote:
>
>> In m4-mode.el, the last two sexps in m4-font-lock-keywords are the wrong
>> way around. As a result, if you are writing M4 code to be expanded in
>> "-P mode", so have things like
>>
>> m4_define
>>
>> in the file, then the "define" part gets matched by the penultimate
>> regex, so m4_ doesn't get highlighted as part of a keyword.
> in case the problem is still there (I don't use m4, so it's difficult
> for me to verify it), would you be able to provide a patch now?
Seems to be fixed in 25 (I did M-x m4-mode and typed in m4_define).
Added tag(s) fixed.
Request was from
Noam Postavsky <npostavs <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Wed, 06 Jun 2018 00:10:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 25.1, send any further explanations to
19882 <at> debbugs.gnu.org and Rupert Swarbrick <ruperts <at> broadcom.com>
Request was from
Noam Postavsky <npostavs <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Wed, 06 Jun 2018 00:10:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 04 Jul 2018 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 7 years and 65 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.