auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] Changes to auctex/tex-info.el,v


From: Ralf Angeli
Subject: [AUCTeX-diffs] Changes to auctex/tex-info.el,v
Date: Sat, 12 Jun 2010 17:36:40 +0000

CVSROOT:        /cvsroot/auctex
Module name:    auctex
Changes by:     Ralf Angeli <angeli>    10/06/12 17:36:40

Index: tex-info.el
===================================================================
RCS file: /cvsroot/auctex/auctex/tex-info.el,v
retrieving revision 5.159
retrieving revision 5.160
diff -u -b -r5.159 -r5.160
--- tex-info.el 4 Apr 2009 20:10:18 -0000       5.159
+++ tex-info.el 12 Jun 2010 17:36:39 -0000      5.160
@@ -112,14 +112,18 @@
   (let* ((envs (mapcar 'car Texinfo-environment-list))
         (regexp (concat "^[ \t]*" (regexp-quote TeX-esc) "\\(end \\)*"
                         (regexp-opt envs t) "\\b"))
+        (orig-pos (point))
         (level 1)
         case-fold-search)
     (save-restriction
       (save-excursion
        (save-excursion
          (beginning-of-line)
+         ;; Stop if point is inside of an @end <env> command, but not
+         ;; if it is behind it.
          (when (and (looking-at regexp)
-                    (match-string 1))
+                    (match-string 1)
+                    (> (match-end 0) orig-pos))
            (setq level 0)))
        (while (and (> level 0) (re-search-forward regexp nil t))
          (if (match-string 1)
@@ -133,19 +137,23 @@
   "Move point to the start of the current environment."
   (interactive)
   (let* ((envs (mapcar 'car Texinfo-environment-list))
-        (regexp (concat "^[ \t]*" (regexp-quote TeX-esc) "\\(end \\)*"
+        (regexp (concat "^[ \t]*\\(" (regexp-quote TeX-esc) "\\)\\(end \\)*"
                         (regexp-opt envs t) "\\b"))
         (level 1)
+        (orig-pos (point))
         case-fold-search)
     (save-restriction
       (save-excursion
        (save-excursion
          (beginning-of-line)
+         ;; Stop if point is inside of an @<env> command, but not if
+         ;; it is before it.
          (when (and (looking-at regexp)
-                    (not (match-string 1)))
+                    (not (match-string 2))
+                    (< (match-beginning 1) orig-pos))
            (setq level 0)))
        (while (and (> level 0) (re-search-backward regexp nil t))
-         (if (match-string 1)
+         (if (match-string 2)
              (setq level (1+ level))
            (setq level (1- level)))))
       (if (= level 0)



reply via email to

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