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


From: Ralf Angeli
Subject: [AUCTeX-diffs] Changes to auctex/font-latex.el
Date: Tue, 10 May 2005 10:36:51 -0400

Index: auctex/font-latex.el
diff -u auctex/font-latex.el:5.116 auctex/font-latex.el:5.117
--- auctex/font-latex.el:5.116  Tue May 10 13:05:07 2005
+++ auctex/font-latex.el        Tue May 10 14:36:51 2005
@@ -1257,7 +1257,7 @@
      (t
       (let ((kbeg (match-beginning 0))
            kend sbeg send cbeg cend
-           cache-reset
+           cache-reset opt-arg
            (parse-sexp-ignore-comments t)) ; scan-sexps ignores comments
        (save-restriction
          ;; Restrict to LIMIT.
@@ -1269,22 +1269,27 @@
          (while (font-latex-forward-comment))
          ;; Optional arguments [...]
          (while (eq (following-char) ?\[)
-           (setq sbeg (point))
+           (unless opt-arg (setq sbeg (point)) (setq opt-arg t))
            (if (font-latex-find-matching-close ?\[ ?\])
-               (setq send (point))
+               (progn
+                 (setq send (point))
+                 (while (font-latex-forward-comment)))
              (setq cache-reset t)
              (setq send (point-max))
              (goto-char send)))
          ;; Mandatory arguments {...}
-         (dotimes (i arg-count)
-           (while (font-latex-forward-comment))
-           (when (eq (following-char) ?\{)
-             (when (= i 0) (setq cbeg (point)))
-             (if (font-latex-find-matching-close ?\{ ?\})
-                 (setq cend (point))
-               (setq cache-reset t)
-               (setq cend (point-max))
-               (goto-char cend)))))
+         (catch 'runaway
+           (dotimes (i arg-count)
+             (when (eq (following-char) ?\{)
+               (when (= i 0) (setq cbeg (point)))
+               (if (font-latex-find-matching-close ?\{ ?\})
+                   (progn
+                     (setq cend (point))
+                     (while (font-latex-forward-comment)))
+                 (setq cache-reset t)
+                 (setq cend (point-max))
+                 (goto-char cend)
+                 (throw 'runaway nil))))))
        (store-match-data (list kbeg kend sbeg send cbeg cend))
 
           ;; Handle cache




reply via email to

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