[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 9cf9f7c 09/57: Correctly exclude hypenation and
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 9cf9f7c 09/57: Correctly exclude hypenation and thin spaces from command matches |
Date: |
Tue, 25 Jul 2017 14:02:28 -0400 (EDT) |
branch: externals/auctex
commit 9cf9f7cf9ff7fda2d697998fbb44e48f756659a3
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>
Correctly exclude hypenation and thin spaces from command matches
* font-latex.el (font-latex-match-simple-command): Skip matches starting
with
\- or \,.
---
font-latex.el | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/font-latex.el b/font-latex.el
index 4b687af..746193b 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1781,11 +1781,17 @@ marks boundaries for searching for group ends."
(defun font-latex-match-simple-command (limit)
"Search for command like \\foo before LIMIT."
- ;; The \\\\[^ ,-] makes sure we don't highlight hyphenation as
- ;; 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))
+ ;; \s_ matches chars with symbol syntax, \sw chars with word syntax. We must
+ ;; exclude matches where the first character after the \ is a , (thin space:
+ ;; foo\,bar) or a - (hyphenation: foo\-bar).
+ (let* ((search (lambda ()
+ (TeX-re-search-forward-unescaped
+ "\\\\\\(\\s_\\|\\sw\\)\\(?:\\s_\\|\\sw\\)*" limit t)))
+ (pos (funcall search)))
+ (while (and pos
+ (member (match-string 1) '("-" ",")))
+ (setq pos (funcall search)))
+ pos))
(defun font-latex-match-math-env (limit)
"Match math pattern up to LIMIT.
- [elpa] externals/auctex f6e7767 06/57: Do not highlight control spaces with "\ ", (continued)
- [elpa] externals/auctex f6e7767 06/57: Do not highlight control spaces with "\ ", Tassilo Horn, 2017/07/25
- [elpa] externals/auctex 38b413e 05/57: Adjust macros acc. to change in `LaTeX-paragraph-commands-regexp-make', Tassilo Horn, 2017/07/25
- [elpa] externals/auctex 93123b6 18/57: Query for expl3 package options, Tassilo Horn, 2017/07/25
- [elpa] externals/auctex f039132 16/57: Use `ispell-tex-arg-end' on parsed elements, Tassilo Horn, 2017/07/25
- [elpa] externals/auctex e21d071 24/57: Exclude arguments to math environments from fontification, Tassilo Horn, 2017/07/25
- [elpa] externals/auctex dcd5503 26/57: * doc/changes.texi: Document recent changes., Tassilo Horn, 2017/07/25
- [elpa] externals/auctex 6fd235f 32/57: ; * tex-buf.el (TeX-adjust-process-coding-system): Avoid a compilation warning., Tassilo Horn, 2017/07/25
- [elpa] externals/auctex cd36aa8 45/57: Check and set `TeX-quote-language' if necessary, Tassilo Horn, 2017/07/25
- [elpa] externals/auctex ef68910 44/57: Add new style/australian.el and style/newzealand.el, Tassilo Horn, 2017/07/25
- [elpa] externals/auctex 6e584e9 04/57: * style/exam.el ("exam"): Remove duplicate entries and backslash., Tassilo Horn, 2017/07/25
- [elpa] externals/auctex 9cf9f7c 09/57: Correctly exclude hypenation and thin spaces from command matches,
Tassilo Horn <=
- [elpa] externals/auctex 7eab03a 20/57: * tex-ispell.el: Move entries from style/empheq.el to this file., Tassilo Horn, 2017/07/25
- [elpa] externals/auctex 0e4ad85 21/57: * latex/preview.dtx: Adjust contact email address., Tassilo Horn, 2017/07/25
- [elpa] externals/auctex d004ac7 28/57: * tex.el (TeX-command-list): Fix typo in help string (mendex -> upmendex), Tassilo Horn, 2017/07/25
- [elpa] externals/auctex cd28c6f 23/57: Improve further the exclusion of reserved characters, Tassilo Horn, 2017/07/25
- [elpa] externals/auctex f472378 22/57: Work around bug#26694, Tassilo Horn, 2017/07/25
- [elpa] externals/auctex bde89b9 27/57: * latex.el (LaTeX-env-label-as-keyval): Use `buffer-substring-no-properties'., Tassilo Horn, 2017/07/25
- [elpa] externals/auctex 7249c78 11/57: * latex.el (LaTeX-common-initialization): Add eminnershape macro., Tassilo Horn, 2017/07/25
- [elpa] externals/auctex 00c76fb 29/57: Don't discard process output with `TeX-run-silent', Tassilo Horn, 2017/07/25
- [elpa] externals/auctex aed9191 33/57: * tests/tex/compilation-log.txt:, Tassilo Horn, 2017/07/25
- [elpa] externals/auctex 4d426ea 37/57: Suggest to rerun LaTeX if xsim properties changed, Tassilo Horn, 2017/07/25