[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex cd28c6f 23/57: Improve further the exclusion of
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex cd28c6f 23/57: Improve further the exclusion of reserved characters |
Date: |
Tue, 25 Jul 2017 14:02:30 -0400 (EDT) |
branch: externals/auctex
commit cd28c6f3b751c8c535b2cc3b0451a90f9430b642
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>
Improve further the exclusion of reserved characters
* font-latex.el (font-latex-match-simple-exclude-list): New
variable.
(font-latex-match-simple-command): Use
`font-latex-match-simple-exclude-list'. Add check for docTeX mode
in order to remove "_" from the list.
---
font-latex.el | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/font-latex.el b/font-latex.el
index ea3e829..dce118a 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1782,18 +1782,30 @@ marks boundaries for searching for group ends."
(throw 'extend group-start)))))
nil)))
+(defvar font-latex-match-simple-exclude-list
+ '("-" "," "/" "&" "#" "_" "`" "'" "^" "~" "=" "." "\"")
+ "List of characters directly after \"\\\" excluded from fontification.
+Each character is a string.")
+
(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, \s.
chars
- ;; with punctuation syntax. We must exclude matches where the first
character
- ;; after the \ is a , (thin space: foo\,bar), a - (hyphenation: foo\-bar), a
/
- ;; (italic correction \/) or other reserved chars like &, # or _ (\& \# \_)
+ ;; \s_ matches chars with symbol syntax, \sw chars with word syntax,
+ ;; \s. chars with punctuation syntax. We must exclude matches where
+ ;; the first character after the \ is a reserved character and
+ ;; should not be fontified (e.g. \, in foo\,bar or \- in foo\-bar).
+ ;; These characters are stored in
+ ;; `font-latex-match-simple-exclude-list'. In docTeX mode, we
+ ;; remove "_" from this list to get correct fontification for macros
+ ;; like `\__module_foo:nnn'
(let* ((search (lambda ()
(TeX-re-search-forward-unescaped
"\\\\\\(\\s_\\|\\sw\\|\\s.\\)\\(?:\\s_\\|\\sw\\)*" limit
t)))
(pos (funcall search)))
(while (and pos
- (member (match-string 1) '("-" "," "/" "&" "#" "_")))
+ (member (match-string 1)
+ (if (eq major-mode 'doctex-mode)
+ (remove "_" font-latex-match-simple-exclude-list)
+ font-latex-match-simple-exclude-list)))
(setq pos (funcall search)))
pos))
- [elpa] externals/auctex e21d071 24/57: Exclude arguments to math environments from fontification, (continued)
- [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, 2017/07/25
- [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 <=
- [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
- [elpa] externals/auctex 6cac3e5 13/57: Update style/fontspec.el to package version 2.6a, Tassilo Horn, 2017/07/25
- [elpa] externals/auctex e0d067f 53/57: Manually cherry-pick commit bc0db60e, Tassilo Horn, 2017/07/25
- [elpa] externals/auctex 42aa58c 40/57: Add support for xreader viewer, Tassilo Horn, 2017/07/25
- [elpa] externals/auctex cd1075b 43/57: Add new style/canadian.el, Tassilo Horn, 2017/07/25