auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] fontification question


From: Arash Esbati
Subject: Re: [AUCTeX] fontification question
Date: Tue, 25 Apr 2017 08:27:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2

Arash Esbati <address@hidden> 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:

PNG image

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:

PNG image

Anything else I'm missing?

Best, Arash

reply via email to

[Prev in Thread] Current Thread [Next in Thread]