changeset 59179:4b5e5c2f1ee0

(mark-paragraph): New arg ALLOW-EXTEND enables the feature to extend the existing region.
author Richard M. Stallman <rms@gnu.org>
date Wed, 29 Dec 2004 01:34:31 +0000
parents abe8f4f2982c
children 25ad9a970ee3
files lisp/textmodes/paragraphs.el
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/paragraphs.el	Wed Dec 29 01:33:04 2004 +0000
+++ b/lisp/textmodes/paragraphs.el	Wed Dec 29 01:34:31 2004 +0000
@@ -347,7 +347,7 @@
   (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 @@
 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))