GNU bug report logs - #70383
Conf-mode[toml] badly set face property

Previous Next

Package: emacs;

Reported by: Alastair Irving <alastair.j.irving <at> gmail.com>

Date: Sun, 14 Apr 2024 15:21:04 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alastair Irving <alastair.j.irving <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 70383 <at> debbugs.gnu.org, casouri <at> gmail.com, jostein <at> kjonigsen.net
Subject: bug#70383: Conf-mode[toml] badly set face property
Date: Mon, 15 Apr 2024 17:34:13 +0300
> Date: Sun, 14 Apr 2024 20:59:02 +0100
> Cc: 70383 <at> debbugs.gnu.org
> From: Alastair Irving <alastair.j.irving <at> gmail.com>
> 
> > I cannot reproduce this here, neither in Emacs 29 nor in Emacs 30.
> > What version of the TOML grammar library are you using?
> I don't think it's using a TOML grammar library, just conf-mode bundled 
> with EMACS "The major mode is Conf[TOML] mode defined in conf-mode.el".  
> I think an extra newline was inserted in the TOML I pasted (in the 
> comment before the URL), it should be 4 lines total. I've attached the 
> exact file.

Thanks.  Does the patch below give good results (I don't have too many
conf files around to test it).

Stefan, does the fix look good to you?

diff --git a/lisp/textmodes/conf-mode.el b/lisp/textmodes/conf-mode.el
index 5e16360..8a201bd 100644
--- a/lisp/textmodes/conf-mode.el
+++ b/lisp/textmodes/conf-mode.el
@@ -180,7 +180,7 @@ conf-font-lock-keywords
      (1 'font-lock-variable-name-face)
      (2 'font-lock-constant-face nil t))
     ;; section { ... } (do this last because some assign ...{...)
-    ("^[ \t]*\\([^#=:\n]+?\\)[ \t\n]*{[^{}]*?$" 1 'font-lock-type-face prepend))
+    ("^[ \t]*\\([^[#=:\n]+?\\)[ \t\n]*{[^{}]*?$" 1 'font-lock-type-face prepend))
   "Keywords to highlight in Conf mode.")
 
 (defvar conf-javaprop-font-lock-keywords




This bug report was last modified 1 year and 89 days ago.

Previous Next


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