monnier pushed a commit to branch externals/auctex
in repository elpa.

commit e515ecd5da1ebada550cd8d62a2f48c569671d85
Author: Tassilo Horn <t...@gnu.org>
Date:   Mon Aug 18 09:56:05 2014 +0200

    Font-lock fix for verbatim environment args.
    
    * font-latex.el (font-latex-set-syntactic-keywords): Allow for a
    mandatory argument for a verbatim environment.
---
 ChangeLog     |    5 +++++
 font-latex.el |   13 +++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 19e019c..791a5a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-18  Tassilo Horn  <t...@gnu.org>
+
+       * font-latex.el (font-latex-set-syntactic-keywords): Allow for a
+       mandatory argument for a verbatim environment.
+
 2014-08-15  Vladimir Lomov  <lomov...@gmail.com>
 
        * style/mathtools.el ("mathtools"): Don't use the removed
diff --git a/font-latex.el b/font-latex.el
index 217d302..b6226b1 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -906,10 +906,11 @@ have changed."
       (add-to-list 'font-latex-syntactic-keywords
                   `(,(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.
+                      ;; Some environments accept an optional and/or mandatory
+                      ;; 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
@@ -917,6 +918,10 @@ have changed."
                       ;; in the `lstlisting' environment by the `listings'
                       ;; package).
                       "\\(?:\\[[^\]\[]*\\(?:\\[[^\]\[]*\\][^\]\[]*\\)*\\]\\)?"
+                      ;; After the optional argument, there may also be
+                      ;; another mandatory argument (e.g. with VerbatimOut or
+                      ;; the minted envs).
+                      "\\(?:{[^}]+}\\)?"
                       "\\(\n\\)")
                     (1 "|" t)))
       (add-to-list 'font-latex-syntactic-keywords

Reply via email to