summaryrefslogtreecommitdiff
path: root/lisp/textmodes/paragraphs.el
diff options
context:
space:
mode:
authorKai Großjohann <kgrossjo@eu.uu.net>2001-11-30 17:18:27 +0000
committerKai Großjohann <kgrossjo@eu.uu.net>2001-11-30 17:18:27 +0000
commitf48b59a233c74b1ec21489591ec101b48c779323 (patch)
treecd659265082d093ede5369e9c3d090cf133928c1 /lisp/textmodes/paragraphs.el
parente294aed74f1d8e4a7e6ed62c1bed8781891219eb (diff)
downloademacs-f48b59a233c74b1ec21489591ec101b48c779323.tar.gz
(mark-paragraph): Clarify doc. Clarify
error message. Suggestion from Richard M. Stallman.
Diffstat (limited to 'lisp/textmodes/paragraphs.el')
-rw-r--r--lisp/textmodes/paragraphs.el19
1 files changed, 14 insertions, 5 deletions
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 8b9ca150ea9..ed9a78696fd 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -317,13 +317,22 @@ See `forward-paragraph' for more information."
(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.