diff lisp/textmodes/paragraphs.el @ 41709:df0a6a02b580

(mark-paragraph): Clarify doc. Clarify error message. Suggestion from Richard Stallman.
author Kai Großjohann <kgrossjo@eu.uu.net>
date Fri, 30 Nov 2001 17:18:27 +0000
parents ca833879aa7b
children 898b4b31410f
line wrap: on
line diff
--- a/lisp/textmodes/paragraphs.el	Fri Nov 30 13:49:28 2001 +0000
+++ b/lisp/textmodes/paragraphs.el	Fri Nov 30 17:18:27 2001 +0000
@@ -317,13 +317,22 @@
   (or arg (setq arg 1))
   (forward-paragraph (- arg)))
 
-(defun mark-paragraph ()
+(defun mark-paragraph (&optional arg)
   "Put point at beginning of this paragraph, mark at end.
-The paragraph marked is the one that contains point or follows point."
-  (interactive)
-  (forward-paragraph 1)
+The paragraph marked is the one that contains point or follows point.
+
+With argument ARG, puts mark at end of a following paragraph, so that
+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."
+  (interactive "p")
+  (unless arg (setq arg 1))
+  (when (zerop arg)
+    (error "Cannot mark zero paragraphs"))
+  (forward-paragraph arg)
   (push-mark nil t t)
-  (backward-paragraph 1))
+  (backward-paragraph arg))
 
 (defun kill-paragraph (arg)
   "Kill forward to end of paragraph.