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

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

[elpa] externals/auctex 524b45b 05/69: Merge branch 'master' into simpli


From: Tassilo Horn
Subject: [elpa] externals/auctex 524b45b 05/69: Merge branch 'master' into simplify-TeX-parse-error
Date: Sat, 26 Mar 2016 21:36:31 +0000

branch: externals/auctex
commit 524b45bd1daaa2891d5854ef7fe4b265515a1c2c
Merge: a7f4839 32fc9bd
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>

    Merge branch 'master' into simplify-TeX-parse-error
---
 ChangeLog     |    6 ++++++
 font-latex.el |   16 ++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d5dc59f..56743ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-05-01  Mos� Giordano  <address@hidden>
+
+       * font-latex.el (font-latex-set-syntactic-keywords): Fix
+       fontification of the optional argument to a verbatim-like
+       environment.
+
 2014-04-16  Tassilo Horn  <address@hidden>
 
        * tex-buf.el (TeX-parse-error): Add another exception.
diff --git a/font-latex.el b/font-latex.el
index 33eb1ad..39be372 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -896,8 +896,20 @@ have changed."
          font-latex-syntactic-keywords nil)
     (unless (= (length verb-envs) 0)
       (add-to-list 'font-latex-syntactic-keywords
-                  `(,(concat "^[ \t]*\\\\begin *{\\(?:" verb-envs
-                             "\\)}.*\\(\n\\)")
+                  `(,(concat
+                      "^[ \t]*\\\\begin *{\\(?:" verb-envs "\\)}"
+                      ;; Some environments accept an optional argument that can
+                      ;; span over more lines.  Between "\begin{<envname>}" and
+                      ;; the optional argument there can be whitespaces and the
+                      ;; newline can be commented by a "%" character.
+                      "[ \t]*\\(?:%.*\n[ \t]*\\)?"
+                      ;; The following line of the regexp matches the optional
+                      ;; argument and allows for up to one level of brackets
+                      ;; inside the argument (e.g., the dialect of a language
+                      ;; in the `lstlisting' environment by the `listings'
+                      ;; package).
+                      "\\(?:\\[[^\]\[]*\\(?:\\[[^\]\[]*\\][^\]\[]*\\)*\\]\\)?"
+                      "\\(\n\\)")
                     (1 "|" t)))
       (add-to-list 'font-latex-syntactic-keywords
                   ;; Using the newline character for the syntax



reply via email to

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