all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rupert Swarbrick <ruperts@broadcom.com>
To: 19882@debbugs.gnu.org
Subject: bug#19882: 25.0.50; Backwards font-lock regex in m4-mode
Date: Mon, 16 Feb 2015 11:32:59 +0000	[thread overview]
Message-ID: <889iof2rt04.fsf@broadcom.com> (raw)

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.





             reply	other threads:[~2015-02-16 11:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16 11:32 Rupert Swarbrick [this message]
2016-03-21  5:30 ` bug#19882: 25.0.50; Backwards font-lock regex in m4-mode Marcin Borkowski
2018-06-06  0:09   ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=889iof2rt04.fsf@broadcom.com \
    --to=ruperts@broadcom.com \
    --cc=19882@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.