auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] Changes to auctex/font-latex.el, v [multiline-font-lock]


From: Ralf Angeli
Subject: [AUCTeX-diffs] Changes to auctex/font-latex.el, v [multiline-font-lock]
Date: Sun, 18 Jun 2006 14:55:14 +0000

CVSROOT:        /cvsroot/auctex
Module name:    auctex
Branch:         multiline-font-lock
Changes by:     Ralf Angeli <angeli>    06/06/18 14:55:14

Index: font-latex.el
===================================================================
RCS file: /cvsroot/auctex/auctex/font-latex.el,v
retrieving revision 5.147.2.4
retrieving revision 5.147.2.5
diff -u -b -r5.147.2.4 -r5.147.2.5
--- font-latex.el       6 Jun 2006 19:59:40 -0000       5.147.2.4
+++ font-latex.el       18 Jun 2006 14:55:14 -0000      5.147.2.5
@@ -1443,11 +1443,18 @@
 \\[ F = ma \\] but not \\\\ [len]"
   (catch 'match
     (while (re-search-forward "\\(\\\\(\\)\\|\\(\\\\\\[\\)" limit t)
+      (unless (save-excursion
       (goto-char (match-beginning 0))
-      (if (eq (preceding-char) ?\\)    ; \\[ is not a math environment
-         (goto-char (match-end 0))
-       (let ((beg (point)))
-         (if (search-forward (if (match-beginning 1) "\\)" "\\]") limit 'move)
+               (eq (preceding-char) ?\\)) ; \\[ is not a math environment
+       (let ((beg (match-beginning 0))
+             (open-tag (if (match-beginning 1) "\\(" "\\["))
+             (close-tag (if (match-beginning 1) "\\)" "\\]")))
+         ;; Search for both opening and closing tags in order to be
+         ;; able to avoid erroneously matching stuff like "\(foo \(bar\)".
+         (if (and (re-search-forward (concat (regexp-quote open-tag) "\\|"
+                                             (regexp-quote close-tag))
+                                     limit 'move)
+                  (string= (match-string 0) close-tag))
              ;; Found closing tag.
              (progn
                (font-latex-put-multiline-property-maybe beg (point))




reply via email to

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