1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-01 18:00:40 -08:00

* emacs-lisp/lisp.el (mark-defun): Don't leave multiple marks

when repeated.
        * textmodes/paragraphs.el (mark-paragraph): Ditto.
This commit is contained in:
Kai Großjohann 2002-02-17 15:08:31 +00:00
parent a9c6d330d5
commit be0d25b686
3 changed files with 31 additions and 23 deletions

View file

@ -1,3 +1,9 @@
2002-02-17 Kai Gro,A_(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> 2002-02-17 Per Abrahamsen <abraham@dina.kvl.dk>
* menu-bar.el (menu-bar-showhide-menu): Added speedbar. * menu-bar.el (menu-bar-showhide-menu): Added speedbar.

View 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 If this command is repeated, marks more defuns after the ones
already marked." already marked."
(interactive) (interactive)
(let (here) (cond ((and (eq last-command this-command) (mark t))
(when (and (eq last-command this-command) (mark t)) (set-mark
(setq here (point)) (save-excursion
(goto-char (mark))) (goto-char (mark))
(push-mark (point)) (end-of-defun)
(end-of-defun) (point))))
(push-mark (point) nil t) (t
(if here (push-mark (point))
(goto-char here) (end-of-defun)
(beginning-of-defun) (push-mark (point) nil t)
(re-search-backward "^\n" (- (point) 1) t)))) (beginning-of-defun)
(re-search-backward "^\n" (- (point) 1) t))))
(defun narrow-to-defun (&optional arg) (defun narrow-to-defun (&optional arg)
"Make text outside current defun invisible. "Make text outside current defun invisible.

View 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 If this command is repeated, it marks the next ARG paragraphs after (or
before, if arg is negative) the ones already marked." before, if arg is negative) the ones already marked."
(interactive "p") (interactive "p")
(let (here) (unless arg (setq arg 1))
(unless arg (setq arg 1)) (when (zerop arg)
(when (zerop arg) (error "Cannot mark zero paragraphs"))
(error "Cannot mark zero paragraphs")) (cond ((and (eq last-command this-command) (mark t))
(when (and (eq last-command this-command) (mark t)) (set-mark
(setq here (point)) (save-excursion
(goto-char (mark))) (goto-char (mark))
(forward-paragraph arg) (forward-paragraph arg)
(push-mark nil t t) (point))))
(if here (t
(goto-char here) (forward-paragraph arg)
(backward-paragraph arg)))) (push-mark nil t t)
(backward-paragraph arg))))
(defun kill-paragraph (arg) (defun kill-paragraph (arg)
"Kill forward to end of paragraph. "Kill forward to end of paragraph.