unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Patch to m4-mode.el
@ 2015-09-19  1:13 Drew Csillag
  2015-09-19 20:12 ` Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Drew Csillag @ 2015-09-19  1:13 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 2312 bytes --]

Hi,

Somebody noticed that if you use the m4_ prefixed versions of m4 keywords, they weren't being highlighted correctly.  I have a patch.  Also updated my email address as author and maintainer.

diff -u build/emacs-24.5/lisp/progmodes/m4-mode.el m4-mode.el
--- build/emacs-24.5/lisp/progmodes/m4-mode.el    2015-04-02 03:23:06.000000000 -0400
+++ m4-mode.el    2015-09-18 21:12:54.606254163 -0400
@@ -2,8 +2,8 @@
 
 ;; Copyright (C) 1996-1997, 2001-2015 Free Software Foundation, Inc.
 
-;; Author: Andrew Csillag 
-;; Maintainer: Andrew Csillag 
+;; Author: Andrew Csillag 
+;; Maintainer: Andrew Csillag 
 ;; Keywords: languages, faces
 
 ;; This file is part of GNU Emacs.
@@ -70,8 +70,7 @@
     ("\$[*#@0-9]" . font-lock-variable-name-face)
     ("\$\@" . font-lock-variable-name-face)
     ("\$\*" . font-lock-variable-name-face)
-    ("\b\(builtin\|change\(com\|quote\|word\)\|d\(e\(bug\(file\|mode\)\|cr\|f\(ine\|n\)\)\|iv\(ert\|num\)\|nl\|umpdef\)\|e\(rrprint\|syscmd\|val\)\|f\(ile\|ormat\)\|gnu\|i\(f\(def\|else\)\|n\(c\(lude\|r\)\|d\(ex\|ir\)\)\)\|l\(en\|ine\)\|m\(4\(exit\|wrap\)\|aketemp\)\|p\(atsubst\|opdef\|ushdef\)\|regexp\|s\(hift\|include\|ubstr\|ys\(cmd\|val\)\)\|tra\(ceo\(ff\|n\)\|nslit\)\|un\(d\(efine\|ivert\)\|ix\)\)\b" . font-lock-keyword-face)
-    ("\b\(m4_\(builtin\|change\(com\|quote\|word\)\|d\(e\(bug\(file\|mode\)\|cr\|f\(ine\|n\)\)\|iv\(ert\|num\)\|nl\|umpdef\)\|e\(rrprint\|syscmd\|val\)\|f\(ile\|ormat\)\|i\(f\(def\|else\)\|n\(c\(lude\|r\)\|d\(ex\|ir\)\)\)\|l\(en\|ine\)\|m\(4\(_undefine\|exit\|wrap\)\|aketemp\)\|p\(atsubst\|opdef\|ushdef\)\|regexp\|s\(hift\|include\|ubstr\|ys\(cmd\|val\)\)\|tra\(ceo\(ff\|n\)\|nslit\)\|undivert\)\)\b" . font-lock-keyword-face))
+    ("\b\(m4_\)?\(builtin\|change\(com\|quote\|word\)\|d\(e\(bug\(file\|mode\)\|cr\|f\(ine\|n\)\)\|iv\(ert\|num\)\|nl\|umpdef\)\|e\(rrprint\|syscmd\|val\)\|f\(ile\|ormat\)\|gnu\|i\(f\(def\|else\)\|n\(c\(lude\|r\)\|d\(ex\|ir\)\)\)\|l\(en\|ine\)\|m\(4\(exit\|wrap\)\|aketemp\)\|p\(atsubst\|opdef\|ushdef\)\|regexp\|s\(hift\|include\|ubstr\|ys\(cmd\|val\)\)\|tra\(ceo\(ff\|n\)\|nslit\)\|un\(d\(efine\|ivert\)\|ix\)\)\b" . font-lock-keyword-face))
   "Default font-lock-keywords for `m4 mode'.")
 
 (defcustom m4-mode-hook nil

Cheers,
Drew

[-- Attachment #2: Type: text/html, Size: 3013 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch to m4-mode.el
  2015-09-19  1:13 Patch to m4-mode.el Drew Csillag
@ 2015-09-19 20:12 ` Stefan Monnier
  2015-09-20 17:28 ` Drew Csillag
  2015-09-20 18:48 ` Andreas Schwab
  2 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2015-09-19 20:12 UTC (permalink / raw)
  To: Drew Csillag; +Cc: emacs-devel

> Somebody noticed that if you use the m4_ prefixed versions of m4 keywords,
> they weren't being highlighted correctly.  I have a patch.  Also updated my
> email address as author and maintainer.

It looks like the patch was somewhat mangled along the way.  Could you
resend it, maybe as an attachment?


        Stefan



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch to m4-mode.el
  2015-09-19  1:13 Patch to m4-mode.el Drew Csillag
  2015-09-19 20:12 ` Stefan Monnier
@ 2015-09-20 17:28 ` Drew Csillag
  2015-09-20 18:20   ` Paul Eggert
  2015-09-20 19:35   ` Stefan Monnier
  2015-09-20 18:48 ` Andreas Schwab
  2 siblings, 2 replies; 6+ messages in thread
From: Drew Csillag @ 2015-09-20 17:28 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

Diff attached.

Drew 

September 19 2015 4:12 PM, "Stefan Monnier" <monnier@iro.umontreal.ca> wrote:
>> Somebody noticed that if you use the m4_ prefixed versions of m4 keywords,
>> they weren't being highlighted correctly.  I have a patch.  Also updated my
>> email address as author and maintainer.
> 
> It looks like the patch was somewhat mangled along the way. Could you
> resend it, maybe as an attachment?
> 
> Stefan

[-- Attachment #2: m4-mode.diff --]
[-- Type: application/octet-stream, Size: 1844 bytes --]

5,6c5,6
< ;; Author: Andrew Csillag <drew@thecsillags.com>
< ;; Maintainer: Andrew Csillag <drew@thecsillags.com>
---
> ;; Author: Andrew Csillag <drew_csillag@geocities.com>
> ;; Maintainer: Andrew Csillag <drew_csillag@geocities.com>
73c73,74
<     ("\\b\\(m4_\\)?\\(builtin\\|change\\(com\\|quote\\|word\\)\\|d\\(e\\(bug\\(file\\|mode\\)\\|cr\\|f\\(ine\\|n\\)\\)\\|iv\\(ert\\|num\\)\\|nl\\|umpdef\\)\\|e\\(rrprint\\|syscmd\\|val\\)\\|f\\(ile\\|ormat\\)\\|gnu\\|i\\(f\\(def\\|else\\)\\|n\\(c\\(lude\\|r\\)\\|d\\(ex\\|ir\\)\\)\\)\\|l\\(en\\|ine\\)\\|m\\(4\\(exit\\|wrap\\)\\|aketemp\\)\\|p\\(atsubst\\|opdef\\|ushdef\\)\\|regexp\\|s\\(hift\\|include\\|ubstr\\|ys\\(cmd\\|val\\)\\)\\|tra\\(ceo\\(ff\\|n\\)\\|nslit\\)\\|un\\(d\\(efine\\|ivert\\)\\|ix\\)\\)\\b" . font-lock-keyword-face))
---
>     ("\\b\\(builtin\\|change\\(com\\|quote\\|word\\)\\|d\\(e\\(bug\\(file\\|mode\\)\\|cr\\|f\\(ine\\|n\\)\\)\\|iv\\(ert\\|num\\)\\|nl\\|umpdef\\)\\|e\\(rrprint\\|syscmd\\|val\\)\\|f\\(ile\\|ormat\\)\\|gnu\\|i\\(f\\(def\\|else\\)\\|n\\(c\\(lude\\|r\\)\\|d\\(ex\\|ir\\)\\)\\)\\|l\\(en\\|ine\\)\\|m\\(4\\(exit\\|wrap\\)\\|aketemp\\)\\|p\\(atsubst\\|opdef\\|ushdef\\)\\|regexp\\|s\\(hift\\|include\\|ubstr\\|ys\\(cmd\\|val\\)\\)\\|tra\\(ceo\\(ff\\|n\\)\\|nslit\\)\\|un\\(d\\(efine\\|ivert\\)\\|ix\\)\\)\\b" . font-lock-keyword-face)
>     ("\\b\\(m4_\\(builtin\\|change\\(com\\|quote\\|word\\)\\|d\\(e\\(bug\\(file\\|mode\\)\\|cr\\|f\\(ine\\|n\\)\\)\\|iv\\(ert\\|num\\)\\|nl\\|umpdef\\)\\|e\\(rrprint\\|syscmd\\|val\\)\\|f\\(ile\\|ormat\\)\\|i\\(f\\(def\\|else\\)\\|n\\(c\\(lude\\|r\\)\\|d\\(ex\\|ir\\)\\)\\)\\|l\\(en\\|ine\\)\\|m\\(4\\(_undefine\\|exit\\|wrap\\)\\|aketemp\\)\\|p\\(atsubst\\|opdef\\|ushdef\\)\\|regexp\\|s\\(hift\\|include\\|ubstr\\|ys\\(cmd\\|val\\)\\)\\|tra\\(ceo\\(ff\\|n\\)\\|nslit\\)\\|undivert\\)\\)\\b" . font-lock-keyword-face))

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch to m4-mode.el
  2015-09-20 17:28 ` Drew Csillag
@ 2015-09-20 18:20   ` Paul Eggert
  2015-09-20 19:35   ` Stefan Monnier
  1 sibling, 0 replies; 6+ messages in thread
From: Paul Eggert @ 2015-09-20 18:20 UTC (permalink / raw)
  To: Drew Csillag; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

Drew Csillag wrote:
> Diff attached.

That regexp collection is already pretty hairy because of the preceding line, 
which is a near-duplicate.  How about refactoring it as per attached untested 
patch instead?  The idea is to surround the entire keyword with \(...\), so that 
the matching regexp is of the form \(\(m4_\)?\(keyword1\|keyword2\|...\)\).



[-- Attachment #2: m4.diff --]
[-- Type: text/plain, Size: 2059 bytes --]

diff --git a/lisp/progmodes/m4-mode.el b/lisp/progmodes/m4-mode.el
index b0b0bdc..2467e8a 100644
--- a/lisp/progmodes/m4-mode.el
+++ b/lisp/progmodes/m4-mode.el
@@ -69,8 +69,7 @@ If m4 is not in your PATH, set this to an absolute file name."
     ("\\$[*#@0-9]" . font-lock-variable-name-face)
     ("\\$\\@" . font-lock-variable-name-face)
     ("\\$\\*" . font-lock-variable-name-face)
-    ("\\b\\(builtin\\|change\\(com\\|quote\\|word\\)\\|d\\(e\\(bug\\(file\\|mode\\)\\|cr\\|f\\(ine\\|n\\)\\)\\|iv\\(ert\\|num\\)\\|nl\\|umpdef\\)\\|e\\(rrprint\\|syscmd\\|val\\)\\|f\\(ile\\|ormat\\)\\|gnu\\|i\\(f\\(def\\|else\\)\\|n\\(c\\(lude\\|r\\)\\|d\\(ex\\|ir\\)\\)\\)\\|l\\(en\\|ine\\)\\|m\\(4\\(exit\\|wrap\\)\\|aketemp\\)\\|p\\(atsubst\\|opdef\\|ushdef\\)\\|regexp\\|s\\(hift\\|include\\|ubstr\\|ys\\(cmd\\|val\\)\\)\\|tra\\(ceo\\(ff\\|n\\)\\|nslit\\)\\|un\\(d\\(efine\\|ivert\\)\\|ix\\)\\)\\b" . font-lock-keyword-face)
-    ("\\b\\(m4_\\(builtin\\|change\\(com\\|quote\\|word\\)\\|d\\(e\\(bug\\(file\\|mode\\)\\|cr\\|f\\(ine\\|n\\)\\)\\|iv\\(ert\\|num\\)\\|nl\\|umpdef\\)\\|e\\(rrprint\\|syscmd\\|val\\)\\|f\\(ile\\|ormat\\)\\|i\\(f\\(def\\|else\\)\\|n\\(c\\(lude\\|r\\)\\|d\\(ex\\|ir\\)\\)\\)\\|l\\(en\\|ine\\)\\|m\\(4\\(_undefine\\|exit\\|wrap\\)\\|aketemp\\)\\|p\\(atsubst\\|opdef\\|ushdef\\)\\|regexp\\|s\\(hift\\|include\\|ubstr\\|ys\\(cmd\\|val\\)\\)\\|tra\\(ceo\\(ff\\|n\\)\\|nslit\\)\\|undivert\\)\\)\\b" . font-lock-keyword-face))
+    ("\\b\\(\\(m4_\\)?\\(builtin\\|change\\(com\\|quote\\|word\\)\\|d\\(e\\(bug\\(file\\|mode\\)\\|cr\\|f\\(ine\\|n\\)\\)\\|iv\\(ert\\|num\\)\\|nl\\|umpdef\\)\\|e\\(rrprint\\|syscmd\\|val\\)\\|f\\(ile\\|ormat\\)\\|i\\(f\\(def\\|else\\)\\|n\\(c\\(lude\\|r\\)\\|d\\(ex\\|ir\\)\\)\\)\\|l\\(en\\|ine\\)\\|m\\(4\\(exit\\|wrap\\)\\|aketemp\\)\\|p\\(atsubst\\|opdef\\|ushdef\\)\\|regexp\\|s\\(hift\\|include\\|ubstr\\|ys\\(cmd\\|val\\)\\)\\|tra\\(ceo\\(ff\\|n\\)\\|nslit\\)\\|un\\(d\\(efine\\|ivert\\)\\|ix\\)\\)\\)\\b" . font-lock-keyword-face))
   "Default `font-lock-keywords' for M4 mode.")
 
 (defcustom m4-mode-hook nil

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: Patch to m4-mode.el
  2015-09-19  1:13 Patch to m4-mode.el Drew Csillag
  2015-09-19 20:12 ` Stefan Monnier
  2015-09-20 17:28 ` Drew Csillag
@ 2015-09-20 18:48 ` Andreas Schwab
  2 siblings, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2015-09-20 18:48 UTC (permalink / raw)
  To: Drew Csillag; +Cc: emacs-devel

"Drew Csillag" <drew@thecsillags.com> writes:

> +    ("\b\(m4_\)?\(builtin\|change\(com\|quote\|word\)\|d\(e\(bug\(file\|mode\)\|cr\|f\(ine\|n\)\)\|iv\(ert\|num\)\|nl\|umpdef\)\|e\(rrprint\|syscmd\|val\)\|f\(ile\|ormat\)\|gnu\|i\(f\(def\|else\)\|n\(c\(lude\|r\)\|d\(ex\|ir\)\)\)\|l\(en\|ine\)\|m\(4\(exit\|wrap\)\|aketemp\)\|p\(atsubst\|opdef\|ushdef\)\|regexp\|s\(hift\|include\|ubstr\|ys\(cmd\|val\)\)\|tra\(ceo\(ff\|n\)\|nslit\)\|un\(d\(efine\|ivert\)\|ix\)\)\b" . font-lock-keyword-face))

`m4_gnu', `m4_m4exit' and `m4_m4wrap' aren't keywords (and `gnu' isn't
either).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch to m4-mode.el
  2015-09-20 17:28 ` Drew Csillag
  2015-09-20 18:20   ` Paul Eggert
@ 2015-09-20 19:35   ` Stefan Monnier
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2015-09-20 19:35 UTC (permalink / raw)
  To: Drew Csillag; +Cc: emacs-devel

> Diff attached.

Hmm... please try and use context (or unified) diffs, and try to avoid
sending it "reversed" ;-)

I just removed the Maintainer: line while I was at it, since this
automatically defaults to the Author:.  Also I replaced \b with \_< and
\_>.

Installed, thank you,


        Stefan



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-09-20 19:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-19  1:13 Patch to m4-mode.el Drew Csillag
2015-09-19 20:12 ` Stefan Monnier
2015-09-20 17:28 ` Drew Csillag
2015-09-20 18:20   ` Paul Eggert
2015-09-20 19:35   ` Stefan Monnier
2015-09-20 18:48 ` Andreas Schwab

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).