GNU bug report logs - #68827
29.1; Latex mode: tex-verbatim face has priority on font-lock-comment-face

Previous Next

Package: emacs;

Reported by: Gabriele Nicolardi <gabriele <at> medialab.sissa.it>

Date: Tue, 30 Jan 2024 18:18:02 UTC

Severity: normal

Found in version 29.1

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: Gabriele Nicolardi <gabriele <at> medialab.sissa.it>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 68827 <at> debbugs.gnu.org
Subject: bug#68827: Possible solution
Date: Sat, 10 Feb 2024 10:25:38 +0200
> Date: Wed, 31 Jan 2024 20:56:12 +0100
> From: Gabriele Nicolardi <gabriele <at> medialab.sissa.it>
> 
> I checked the value of the font-lock-keywords variable and found: 
> 
> ```lang-el
> 
> ("\\\(ProvidesFile\|href\|nolinkurl\|path\|url\) \(\[[^]]\] \){\(\(?:[^{}\]\|\\.\|{[^}]}\)+\)" 3 'tex-verbatim t)
> 
> ```
> 
> If I use this command to add fontification:
> 
> ```lang-el
> 
> (font-lock-add-keywords nil '(("\\\(ProvidesFile\|href\|nolinkurl\|path\|url\) \(\[[^]]\] \){\(\(?:[^{}\]\|\\.\|{[^}]}\)+\)" 3
> 'tex-verbatim keep)))
> 
> ```
> 
> the problem disappears.
> 
> From the manual, I read:
> 
> The last two values in subexp-highlighter, override and laxmatch, are optional flags. If override is t, this
> element can override existing fontification made by previous elements of font-lock-keywords. If it is
> keep, then each character is fontified if it has not been fontified already by some other element. If it is
> prepend, the face specified by facespec is added to the beginning of the font-lock-face property. If it
> is append, the face is added to the end of the font-lock-face property. 
> 
> So I think that "keep" should be the right choice.

Stefan, any comments to this proposed solution?




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

Previous Next


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