aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Großjohann <[email protected]>2002-02-17 15:08:31 +0000
committerKai Großjohann <[email protected]>2002-02-17 15:08:31 +0000
commitbe0d25b6863857a290fba53006df20f28e26a2a2 (patch)
treee062e1fba64f5934b04629e39bb33083993f9455
parenta9c6d330d55b3c79780146346de165bb96ddfaba (diff)
* emacs-lisp/lisp.el (mark-defun): Don't leave multiple marks
when repeated. * textmodes/paragraphs.el (mark-paragraph): Ditto.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/emacs-lisp/lisp.el23
-rw-r--r--lisp/textmodes/paragraphs.el25
3 files changed, 31 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4730787118..0dd8ee7c47 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2002-02-17 Kai Gro,A_(Bjohann <[email protected]>
+
+ * emacs-lisp/lisp.el (mark-defun): Don't leave multiple marks
+ when repeated.
+ * textmodes/paragraphs.el (mark-paragraph): Ditto.
+
2002-02-17 Per Abrahamsen <[email protected]>
* menu-bar.el (menu-bar-showhide-menu): Added speedbar.
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index a815eddfd7..57e507e4f6 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -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.
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 91d9b1699f..bc4cac2a08 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -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.