auctex-diffs
[Top][All Lists]
Advanced

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

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


From: Ralf Angeli
Subject: [AUCTeX-diffs] Changes to auctex/latex.el,v
Date: Sat, 19 Jul 2008 16:29:28 +0000

CVSROOT:        /cvsroot/auctex
Module name:    auctex
Changes by:     Ralf Angeli <angeli>    08/07/19 16:29:28

Index: latex.el
===================================================================
RCS file: /cvsroot/auctex/auctex/latex.el,v
retrieving revision 5.445
retrieving revision 5.446
diff -u -b -r5.445 -r5.446
--- latex.el    17 Jul 2008 18:21:32 -0000      5.445
+++ latex.el    19 Jul 2008 16:29:27 -0000      5.446
@@ -3344,17 +3344,24 @@
     (or (= level 0)
        (error "Can't locate beginning of current environment"))))
 
-(defun LaTeX-mark-environment ()
+(defun LaTeX-mark-environment (&optional count)
   "Set mark to end of current environment and point to the matching begin.
+If passed a prefix argument COUNT, mark the outer environnment by COUNT levels.
+Example: if point is --!-- and COUNT=2, env1 is the marked environment.
+
+    \\begin{env1} \\begin{env2} --!-- \\begin{env2} \\begin{env1}
+
 Will not work properly if there are unbalanced begin-end pairs in
 comments and verbatim environments"
-  (interactive)
-  (let ((cur (point)))
-    (LaTeX-find-matching-end)
+  (interactive "p")
+  (unless count (seq count 1))
+  (let ( (cur (point)))
+    (unless (> count 0) (error "invalid prefix arg, expects a positive 
number"))
+    (dotimes (c count) (LaTeX-find-matching-end))
     (beginning-of-line 2)
     (set-mark (point))
     (goto-char cur)
-    (LaTeX-find-matching-begin)
+    (dotimes (c count) (LaTeX-find-matching-begin))
     (TeX-activate-region)))
 
 (defun LaTeX-fill-environment (justify)




reply via email to

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