emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/auctex 3320d1e 1/7: Improve command highlighting to not


From: Tassilo Horn
Subject: [elpa] externals/auctex 3320d1e 1/7: Improve command highlighting to not be triggered by hyphenation
Date: Fri, 21 Apr 2017 10:59:07 -0400 (EDT)

branch: externals/auctex
commit 3320d1eb0f35f458325892adccce61fa3bbbe74b
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>

    Improve command highlighting to not be triggered by hyphenation
    
    Reported by François Patte.
---
 font-latex.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/font-latex.el b/font-latex.el
index 0f2c893..e1c8e55 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1781,8 +1781,10 @@ marks boundaries for searching for group ends."
 
 (defun font-latex-match-simple-command (limit)
   "Search for command like \\foo before LIMIT."
-  ;; \s_ matches chars with symbol syntax, \sw chars with word syntax
-  (TeX-re-search-forward-unescaped "\\\\\\(?:\\s_\\|\\sw\\)+" limit t))
+  ;; The \\\\[^-] makes sure we don't highlight hyphenation as commands
+  ;; (foo\-bar).  \s_ matches chars with symbol syntax, \sw chars with word
+  ;; syntax.
+  (TeX-re-search-forward-unescaped "\\\\[^-]\\(?:\\s_\\|\\sw\\)+" limit t))
 
 (defun font-latex-match-math-env (limit)
   "Match math pattern up to LIMIT.



reply via email to

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