summaryrefslogtreecommitdiff
path: root/lisp/textmodes/paragraphs.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2004-12-29 01:35:21 +0000
committerRichard M. Stallman <rms@gnu.org>2004-12-29 01:35:21 +0000
commit94ed093133a86d71b3dff6a1c07d36428949331a (patch)
tree99b2eab13ee5c58168aacfd41959da6a0f82ffa5 /lisp/textmodes/paragraphs.el
parenta1a801de6aaafa061d304322e9f51a026fe98ed0 (diff)
downloademacs-94ed093133a86d71b3dff6a1c07d36428949331a.tar.gz
(mark-paragraph): New arg ALLOW-EXTEND
enables the feature to extend the existing region.
Diffstat (limited to 'lisp/textmodes/paragraphs.el')
-rw-r--r--lisp/textmodes/paragraphs.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 353aa0ee8a2..7728ea7b463 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -347,7 +347,7 @@ See `forward-paragraph' for more information."
(or arg (setq arg 1))
(forward-paragraph (- arg)))
-(defun mark-paragraph (&optional arg)
+(defun mark-paragraph (&optional arg allow-extend)
"Put point at beginning of this paragraph, mark at end.
The paragraph marked is the one that contains point or follows point.
@@ -357,15 +357,16 @@ the number of paragraphs marked equals ARG.
If ARG is negative, point is put at end of this paragraph, mark is put
at beginning of this or a previous paragraph.
-If this command is repeated or mark is active in Transient Mark mode,
-it marks the next ARG paragraphs after (or before, if arg is negative)
-the ones already marked."
- (interactive "p")
+Interactively, if this command is repeated
+or (in Transient Mark mode) if the mark is active,
+it marks the next ARG paragraphs after the ones already marked."
+ (interactive "p\np")
(unless arg (setq arg 1))
(when (zerop arg)
(error "Cannot mark zero paragraphs"))
- (cond ((or (and (eq last-command this-command) (mark t))
- (and transient-mark-mode mark-active))
+ (cond ((and allow-extend
+ (or (and (eq last-command this-command) (mark t))
+ (and transient-mark-mode mark-active)))
(set-mark
(save-excursion
(goto-char (mark))