Arash Esbati <[email protected]> writes:

> as for the next iteration, I also added " " (space) to the ignored
> characters list.  Otherwise,
>
>     \foo\ bar
>
> had "bar" highlighted.

Following up myself, the patch was not good enough.  Here a test case of
fontification right now:

Applying this patch:

--8<---------------cut here---------------start------------->8---
diff --git a/font-latex.el b/font-latex.el
index 83e21158..8a6fef4a 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1785,7 +1785,7 @@ marks boundaries for searching for group ends."
   ;; commands (foo\-bar), nor thin spaces (foo\,bar) nor control
   ;; spaces (foo\ bar).  \s_ matches chars with symbol syntax, \sw
   ;; chars with word syntax.
-  (TeX-re-search-forward-unescaped "\\\\[^ ,-]\\(?:\\s_\\|\\sw\\)+" limit t))
+  (TeX-re-search-forward-unescaped "\\\\[^{}$&#_ %/,-]\\(?:\\s_\\|\\sw\\)*" 
limit t))

 (defun font-latex-match-math-env (limit)
   "Match math pattern up to LIMIT.
--8<---------------cut here---------------end--------------->8---

gives this:

Anything else I'm missing?

Best, Arash
_______________________________________________
auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex

Reply via email to