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


Message #16 received at 68827-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Gabriele Nicolardi <gabriele <at> medialab.sissa.it>
Cc: 68827-done <at> debbugs.gnu.org
Subject: Re: bug#68827: Possible solution
Date: Thu, 15 Feb 2024 15:11:43 -0500
> I noticed that the tex-verbatim face used in latex-mode to highlight the
> \href argument has priority on font-lock-comment-face.

I'm not sure if it should qualify as a bug or as a feature, to be honest.

> (font-lock-add-keywords nil
>  '(("\\\(ProvidesFile\|href\|nolinkurl\|path\|url\) \(\[[^]]\]
>  \){\(\(?:[^{}\]\|\\.\|{[^}]}\)+\)" 3 'tex-verbatim keep)))

Thanks.  `keep` seems right for the case where the match is inside
a comment, as in your case, but there are other cases where we want
to override the previously applied face (e.g. $math$).

I pushed a patch which re-arranges the rules to avoid that
other problem.


        Stefan





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.