Mandar Mitra <mandar.mi...@gmail.com> writes:

> Arash Esbati wrote (Fri, Aug 25, 2023 at 11:38:36AM +0200):
>> Can you please file a bug report for this, incl. a MWE starting with
>> emacs -Q?  TIA.
>> 
>> For the time being, you can use delimiters instead of braces for the
>> optional argument which works, e.g.:
>> 
>> \lstinline[language=C,basicstyle=\ttfamily]|for (i=0; i<8; i++) 
>> printf("%c\n"), str1 [ i]);|
>
> Thanks very much for confirming, and for the work-around! Will file
> the bug report with an MWE this weekend.

I think I now see what's going wrong.  Can you please apply this patch
to font-latex.el and try it again?  I presume you're using AUCTeX from
the repo.

--8<---------------cut here---------------start------------->8---
diff --git a/font-latex.el b/font-latex.el
index 7617b5cc..083f72b4 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1084,7 +1084,7 @@ have changed."
                   ;; An opening curly brace as delimiter is valid, but
                   ;; allowing it might screw up fontification of stuff
                   ;; like "\url{...} foo \textbf{<--!...}".
-                  "\\([^a-z@*\n\f{]\\).*?"
+                  "\\([^a-z@*\n\f{[]\\).*?"
                   ;; Give an escape char at the end of the verbatim
                   ;; construct punctuation syntax.  Prevents wrong
                   ;; fontification of stuff like "\verb|foo\|".
--8<---------------cut here---------------end--------------->8---

Best, Arash

Reply via email to