comparison lisp/textmodes/paragraphs.el @ 43384:cc3ba2d0d471

* emacs-lisp/lisp.el (mark-defun): Don't leave multiple marks when repeated. * textmodes/paragraphs.el (mark-paragraph): Ditto.
author Kai Großjohann <kgrossjo@eu.uu.net>
date Sun, 17 Feb 2002 15:07:35 +0000
parents 898b4b31410f
children 75f4a9fc7b34
comparison
equal deleted inserted replaced
43383:d21a74d23497 43384:cc3ba2d0d471
328 at beginning of this or a previous paragraph. 328 at beginning of this or a previous paragraph.
329 329
330 If this command is repeated, it marks the next ARG paragraphs after (or 330 If this command is repeated, it marks the next ARG paragraphs after (or
331 before, if arg is negative) the ones already marked." 331 before, if arg is negative) the ones already marked."
332 (interactive "p") 332 (interactive "p")
333 (let (here) 333 (unless arg (setq arg 1))
334 (unless arg (setq arg 1)) 334 (when (zerop arg)
335 (when (zerop arg) 335 (error "Cannot mark zero paragraphs"))
336 (error "Cannot mark zero paragraphs")) 336 (cond ((and (eq last-command this-command) (mark t))
337 (when (and (eq last-command this-command) (mark t)) 337 (set-mark
338 (setq here (point)) 338 (save-excursion
339 (goto-char (mark))) 339 (goto-char (mark))
340 (forward-paragraph arg) 340 (forward-paragraph arg)
341 (push-mark nil t t) 341 (point))))
342 (if here 342 (t
343 (goto-char here) 343 (forward-paragraph arg)
344 (backward-paragraph arg)))) 344 (push-mark nil t t)
345 (backward-paragraph arg))))
345 346
346 (defun kill-paragraph (arg) 347 (defun kill-paragraph (arg)
347 "Kill forward to end of paragraph. 348 "Kill forward to end of paragraph.
348 With arg N, kill forward to Nth end of paragraph; 349 With arg N, kill forward to Nth end of paragraph;
349 negative arg -N means kill backward to Nth start of paragraph." 350 negative arg -N means kill backward to Nth start of paragraph."