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 20:20:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2

Tassilo Horn <address@hidden> writes:

> Arash Esbati <address@hidden> writes:
>
>> Following up myself, the patch was not good enough.
>
> Oh, yeah, I introduced the bug.

To avoid any misunderstandings: I meant that my last patch was not good
enough.

> My change said that the first char after the \ must not be a - or a ,.
> However, then it did not need to be a symbol or word character, too!
> ;-)
>
> Ok, I fixed it now but that "\ followed by word and symbol chars but not
> starting with - or ," couldn't be captured in a regex anymore (tell me
> if I'm wrong).

Thanks for your patch, it looks much better.  I think the only thing
missing is when you have a character with punctuation syntax after \
like \"o, \^o or \~o.  What do you think about a variation like this:

--8<---------------cut here---------------start------------->8---
diff --git a/font-latex.el b/font-latex.el
index 746193bc..d6bf8d37 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1786,10 +1786,10 @@ marks boundaries for searching for group ends."
   ;; foo\,bar) or a - (hyphenation: foo\-bar).
   (let* ((search (lambda ()
                   (TeX-re-search-forward-unescaped
-                   "\\\\\\(\\s_\\|\\sw\\)\\(?:\\s_\\|\\sw\\)*" limit t)))
+                   "\\\\\\(\\s.\\|\\s_\\|\\sw\\)\\(?:\\s_\\|\\sw\\)*" limit 
t)))
         (pos (funcall search)))
     (while (and pos
-               (member (match-string 1) '("-" ",")))
+               (member (match-string 1) '("-" "," "/" "&" "#" "_")))
       (setq pos (funcall search)))
     pos))
--8<---------------cut here---------------end--------------->8---

We can extend the exclude list if other characters appear.

Best, Arash



reply via email to

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