branch: externals/auctex
commit d3d9dc089b4b4f1aa07d162da6c054f45d42e28a
Author: Arash Esbati <[email protected]>
Commit: Arash Esbati <[email protected]>

    Disallow opening square brackets as verb delimiter
    
    * font-latex.el (font-latex-set-syntactic-keywords): Disallow '['
    as verbatim delimiter in order to fix fontification problems and
    catch up with `LaTeX-verbatim-macro-boundaries'.
---
 font-latex.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/font-latex.el b/font-latex.el
index 7617b5cc84..8fc567e292 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1083,8 +1083,10 @@ have changed."
                   "\\(?:\\[[^][]*\\(?:\\[[^][]*\\][^][]*\\)*\\]\\)?"
                   ;; 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{]\\).*?"
+                  ;; like "\url{...} foo \textbf{<--!...}".  Also
+                  ;; disallow an opening square bracket which produces
+                  ;; confusion in "\Verb[key-val]{foo[<--!}"
+                  "\\([^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\|".


Reply via email to