auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 03df111d49927521cb178


From: Tassilo Horn
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 03df111d49927521cb178f46387e29817203398e
Date: Wed, 28 Apr 2021 15:36:41 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  03df111d49927521cb178f46387e29817203398e (commit)
      from  0a87fe0a0a63b4bf26cec1af0cc372304e548c6c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 03df111d49927521cb178f46387e29817203398e
Author: Tassilo Horn <tsdh@gnu.org>
Date:   Wed Apr 28 21:35:15 2021 +0200

    Allow one level of braces in verbatim environment args (bug#48078)
    
    * font-latex.el (font-latex-set-syntactic-keywords): Allow one level
    of braces in verbatim environment args (bug#48078).

diff --git a/font-latex.el b/font-latex.el
index 906afc9..df38b69 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1010,67 +1010,67 @@ have changed."
                                        (regexp-opt verb-macros-with-braces))
           font-latex-syntactic-keywords nil)
     (unless (= (length verb-envs) 0)
-      (add-to-list 'font-latex-syntactic-keywords
-                   `(,(concat
-                       "^[ \t]*\\\\begin *{\\(?:" verb-envs "\\)}"
-                       ;; 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
-                       ;; inside the argument (e.g., the dialect of a language
-                       ;; in the `lstlisting' environment by the `listings'
-                       ;; package).
-                       "\\(?:\\[[^\]\[]*\\(?:\\[[^\]\[]*\\][^\]\[]*\\)*\\]\\)?"
-                       ;; After the optional argument, there may also be
-                       ;; another mandatory argument(s) (e.g. with VerbatimOut 
or
-                       ;; the minted envs or defined with `lstnewenvironment').
-                       "\\(?:{[^}]*}\\)*"
-                       ;; Now match the final newline.  The "." alternative
-                       ;; catches the case where verbatim content is written
-                       ;; immediately after the \begin{verbatim}.
-                       "\\(\n\\|.\\)")
-                     (1 "|" t)))
-      (add-to-list 'font-latex-syntactic-keywords
-                   ;; Using the newline character for the syntax
-                   ;; property often resulted in fontification
-                   ;; problems when text was inserted at the end of
-                   ;; the verbatim environment.  That's why we now use
-                   ;; the starting backslash of \end.  There is a hack
-                   ;; in `font-latex-make-user-keywords' to remove the
-                   ;; spurious fontification of the backslash.
-                   `(,(concat "\\(\\\\\\)end *{\\(?:" verb-envs "\\)}")
-                     (1 "|" t))))
+      (add-to-list
+       'font-latex-syntactic-keywords
+       `(,(concat
+           "^[ \t]*\\\\begin *{\\(?:" verb-envs "\\)}"
+           ;; 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
+           ;; inside the argument (e.g., the dialect of a language in
+           ;; the `lstlisting' environment by the `listings' package).
+           "\\(?:\\[[^\]\[]*\\(?:\\[[^\]\[]*\\][^\]\[]*\\)*\\]\\)?"
+           ;; After the optional argument, there may also be another
+           ;; mandatory argument(s) (e.g. with VerbatimOut or the
+           ;; minted envs or defined with `lstnewenvironment').  Use
+           ;; the same trick as above in order to allow one level of
+           ;; braces in the argument.
+           "\\(?:{[^{}]*\\(?:{[^{}]*}[^{}]*\\)*}\\)*"
+           ;; Now match the final newline.  The "." alternative
+           ;; catches the case where verbatim content is written
+           ;; immediately after the \begin{verbatim}.
+           "\\(\n\\|.\\)")
+         (1 "|" t)))
+      (add-to-list
+       'font-latex-syntactic-keywords
+       ;; Using the newline character for the syntax property often
+       ;; resulted in fontification problems when text was inserted at
+       ;; the end of the verbatim environment.  That's why we now use
+       ;; the starting backslash of \end.  There is a hack in
+       ;; `font-latex-make-user-keywords' to remove the spurious
+       ;; fontification of the backslash.
+       `(,(concat "\\(\\\\\\)end *{\\(?:" verb-envs "\\)}")
+         (1 "|" t))))
     (unless (= (length verb-macros-with-delims) 0)
-      (add-to-list 'font-latex-syntactic-keywords
-                   `(,(concat "\\\\\\(?:" verb-macros-with-delims "\\)"
-                              ;; Some macros take an optional
-                              ;; argument.  This is the same line as
-                              ;; above for environments.
-                              
"\\(?:\\[[^][]*\\(?:\\[[^][]*\\][^][]*\\)*\\]\\)?"
-                              ;; An opening curly brace as delimiter
-                              ;; is valid, but allowing it might screw
-                              ;; up fontification of stuff like
-                              ;; "\url{...} foo \textbf{<--!...}".
-                              "\\([^a-z@*\n\f{]\\).*?"
-                              ;; Give an escape char at the end of the
-                              ;; verbatim construct punctuation syntax.
-                              ;; Prevents wrong fontification of stuff
-                              ;; like "\verb|foo\|".
-                              "\\(" (regexp-quote TeX-esc) "*\\)\\(\\1\\)")
-                     (1 "\"") (2 ".") (3 "\""))))
+      (add-to-list
+       'font-latex-syntactic-keywords
+       `(,(concat "\\\\\\(?:" verb-macros-with-delims "\\)"
+                  ;; Some macros take an optional argument.  This is
+                  ;; the same line as above for environments.
+                  "\\(?:\\[[^][]*\\(?:\\[[^][]*\\][^][]*\\)*\\]\\)?"
+                  ;; An opening curly brace as delimiter is valid, but
+                  ;; allowing it might screw up fontification of stuff
+                  ;; like "\url{...} foo \textbf{<--!...}".
+                  "\\([^a-z@*\n\f{]\\).*?"
+                  ;; Give an escape char at the end of the verbatim
+                  ;; construct punctuation syntax.  Prevents wrong
+                  ;; fontification of stuff like "\verb|foo\|".
+                  "\\(" (regexp-quote TeX-esc) "*\\)\\(\\1\\)")
+         (1 "\"") (2 ".") (3 "\""))))
     (unless (= (length verb-macros-with-braces) 0)
-      (add-to-list 'font-latex-syntactic-keywords
-                   `(,(concat "\\\\\\(?:" verb-macros-with-braces "\\)"
-                              ;; Some macros take an optional
-                              ;; argument.  This is the same line as
-                              ;; above for environments.
-                              
"\\(?:\\[[^][]*\\(?:\\[[^][]*\\][^][]*\\)*\\]\\)?"
-                              "\\({\\).*?[^\\]\\(?:\\\\\\\\\\)*\\(}\\)")
-                     (1 "|") (2 "|")))))
+      (add-to-list
+       'font-latex-syntactic-keywords
+       `(,(concat "\\\\\\(?:" verb-macros-with-braces "\\)"
+                  ;; Some macros take an optional argument.  This is
+                  ;; the same line as above for environments.
+                  "\\(?:\\[[^][]*\\(?:\\[[^][]*\\][^][]*\\)*\\]\\)?"
+                  "\\({\\).*?[^\\]\\(?:\\\\\\\\\\)*\\(}\\)")
+         (1 "|") (2 "|")))))
   (when font-latex-syntactic-keywords-extra
     (nconc font-latex-syntactic-keywords font-latex-syntactic-keywords-extra))
   ;; Cater for docTeX mode.

-----------------------------------------------------------------------

Summary of changes:
 font-latex.el | 118 +++++++++++++++++++++++++++++-----------------------------
 1 file changed, 59 insertions(+), 59 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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