]> git.eshelyaron.com Git - emacs.git/commitdiff
* emacs-lisp/lisp.el (mark-defun): Don't leave multiple marks
authorKai Großjohann <kgrossjo@eu.uu.net>
Sun, 17 Feb 2002 15:08:31 +0000 (15:08 +0000)
committerKai Großjohann <kgrossjo@eu.uu.net>
Sun, 17 Feb 2002 15:08:31 +0000 (15:08 +0000)
        when repeated.
        * textmodes/paragraphs.el (mark-paragraph): Ditto.

lisp/ChangeLog
lisp/emacs-lisp/lisp.el
lisp/textmodes/paragraphs.el

index 4730787118116f67f3e77df397d43d240be70861..0dd8ee7c470dc86776975866838d177ebbbf824a 100644 (file)
@@ -1,3 +1,9 @@
+2002-02-17  Kai Gro\e,A_\e(Bjohann  <Kai.Grossjohann@CS.Uni-Dortmund.DE>
+
+       * emacs-lisp/lisp.el (mark-defun): Don't leave multiple marks
+       when repeated.
+       * textmodes/paragraphs.el (mark-paragraph): Ditto.
+
 2002-02-17  Per Abrahamsen  <abraham@dina.kvl.dk>
 
        * menu-bar.el (menu-bar-showhide-menu): Added speedbar.
index a815eddfd78f0997754f7ed36fb393fa21fdeed6..57e507e4f67246eda7b7624b7c94d95af0df32ce 100644 (file)
@@ -259,17 +259,18 @@ The defun marked is the one that contains point or follows point.
 If this command is repeated, marks more defuns after the ones
 already marked."
   (interactive)
-  (let (here)
-    (when (and (eq last-command this-command) (mark t))
-      (setq here (point))
-      (goto-char (mark)))
-    (push-mark (point))
-    (end-of-defun)
-    (push-mark (point) nil t)
-    (if here
-       (goto-char here)
-      (beginning-of-defun)
-      (re-search-backward "^\n" (- (point) 1) t))))
+  (cond ((and (eq last-command this-command) (mark t))
+        (set-mark
+         (save-excursion
+           (goto-char (mark))
+           (end-of-defun)
+           (point))))
+       (t
+        (push-mark (point))
+        (end-of-defun)
+        (push-mark (point) nil t)
+        (beginning-of-defun)
+        (re-search-backward "^\n" (- (point) 1) t))))
 
 (defun narrow-to-defun (&optional arg)
   "Make text outside current defun invisible.
index 91d9b1699f9fa56f6489bab39f02b2acc237493d..bc4cac2a088f1a0c684fa1008ccea8cf4d460cf5 100644 (file)
@@ -330,18 +330,19 @@ at beginning of this or a previous paragraph.
 If this command is repeated, it marks the next ARG paragraphs after (or
 before, if arg is negative) the ones already marked."
   (interactive "p")
-  (let (here)
-    (unless arg (setq arg 1))
-    (when (zerop arg)
-      (error "Cannot mark zero paragraphs"))
-    (when (and (eq last-command this-command) (mark t))
-      (setq here (point))
-      (goto-char (mark)))
-    (forward-paragraph arg)
-    (push-mark nil t t)
-    (if here
-       (goto-char here)
-      (backward-paragraph arg))))
+  (unless arg (setq arg 1))
+  (when (zerop arg)
+    (error "Cannot mark zero paragraphs"))
+  (cond ((and (eq last-command this-command) (mark t))
+        (set-mark
+         (save-excursion
+           (goto-char (mark))
+           (forward-paragraph arg)
+           (point))))
+       (t
+        (forward-paragraph arg)
+        (push-mark nil t t)
+        (backward-paragraph arg))))
 
 (defun kill-paragraph (arg)
   "Kill forward to end of paragraph.