[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex e21d071 24/57: Exclude arguments to math environ
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex e21d071 24/57: Exclude arguments to math environments from fontification |
Date: |
Tue, 25 Jul 2017 14:02:31 -0400 (EDT) |
branch: externals/auctex
commit e21d071e52cbdf2382c0636aa723354df9e2983a
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>
Exclude arguments to math environments from fontification
* font-latex.el (font-latex-match-math-envII)
(font-latex-extend-region-backwards-math-envII): Match and exclude
optional and mandatory argument(s) to math environments from
fontification.
---
font-latex.el | 35 ++++++++++++++++++++++++++---------
1 file changed, 26 insertions(+), 9 deletions(-)
diff --git a/font-latex.el b/font-latex.el
index dce118a..e4f9713 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1871,18 +1871,30 @@ END marks boundaries for searching for environment
ends."
Used for patterns like:
\\begin{equation}
fontified stuff
-\\end{equation}
-The \\begin{equation} and \\end{equation} are not fontified here."
+\\end{equation} or
+\\begin{empheq}[X=Y\\Rightarrow]{alignat=3}
+ fontified stuff
+\\end{empheq}
+The \\begin{equation} incl. arguments in the same line and
+\\end{equation} are not fontified here."
(when (re-search-forward (concat "\\\\begin[ \t]*{"
(regexp-opt font-latex-math-environments t)
- "\\*?}")
+ ;; Subexpression 2 is used to build
+ ;; the \end{<env>} construct below
+ "\\(\\*?}\\)"
+ ;; Match an optional and possible
+ ;; mandatory argument(s) as long as
+ ;; they are on the same line with
+ ;; no spaces in-between
+
"\\(?:\\[[^][]*\\(?:\\[[^][]*\\][^][]*\\)*\\]\\)?"
+ "\\(?:{[^}]*}\\)*")
limit t)
(let ((beg (match-end 0)) end)
(if (re-search-forward (concat "\\\\end[ \t]*{"
(regexp-quote
(buffer-substring-no-properties
(match-beginning 1)
- (match-end 0))))
+ (match-end 2))))
;; XXX: Should this rather be done by
;; extending the region to be fontified?
(+ limit font-latex-multiline-boundary) 'move)
@@ -1905,11 +1917,16 @@ END marks boundaries for searching for environment
ends."
(concat "\\\\end[ \t]*{"
(regexp-opt font-latex-math-environments t)
"\\*?}") beg t)
- (when (and (re-search-backward (concat "\\\\begin[ \t]*{"
- (buffer-substring-no-properties
- (match-beginning 1)
- (match-end 0)))
- (- beg font-latex-multiline-boundary) t)
+ (when (and (re-search-backward
+ (concat "\\\\begin[ \t]*{"
+ (buffer-substring-no-properties
+ (match-beginning 1)
+ (match-end 0))
+ ;; Match an optional and possible
+ ;; mandatory argument(s)
+ "\\(?:\\[[^][]*\\(?:\\[[^][]*\\][^][]*\\)*\\]\\)?"
+ "\\(?:{[^}]*}\\)*")
+ (- beg font-latex-multiline-boundary) t)
(< (point) beg))
(throw 'extend (point))))
nil)))
- [elpa] externals/auctex ef7e48b 12/57: Consider the return value of `assq-delete-all', (continued)
- [elpa] externals/auctex ef7e48b 12/57: Consider the return value of `assq-delete-all', Tassilo Horn, 2017/07/25
- [elpa] externals/auctex 272c9d6 15/57: Improve exclusion of reserved characters from command matches, Tassilo Horn, 2017/07/25
- [elpa] externals/auctex 4ddee01 38/57: * style/beamer.el ("beamer"): Query for optional argument after \pause., Tassilo Horn, 2017/07/25
- [elpa] externals/auctex d2dfab6 30/57: Fix indentation in ConTeXt mode after indented optional argument, Tassilo Horn, 2017/07/25
- [elpa] externals/auctex 0c03e4a 36/57: Catch expl3 warnings, Tassilo Horn, 2017/07/25
- [elpa] externals/auctex a90cab5 02/57: Fix comment environment highlighting, Tassilo Horn, 2017/07/25
- [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 <=
- [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, 2017/07/25