From 6f57c44850a330b7e3eacd91e2df28b71caffb36 Mon Sep 17 00:00:00 2001 From: paldepind Date: Thu, 12 May 2016 16:08:09 +0200 Subject: [PATCH] Mark paragraph will extend backwards (Bug#17555) --- lisp/textmodes/paragraphs.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index b7523ca..cc17941 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -382,22 +382,23 @@ at beginning of this or a previous paragraph. Interactively (or if ALLOW-EXTEND is non-nil), 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) + (interactive "P\np") + (when (and arg (zerop (prefix-numeric-value arg))) (error "Cannot mark zero paragraphs")) (cond ((and allow-extend (or (and (eq last-command this-command) (mark t)) (and transient-mark-mode mark-active))) + (setq arg (if arg (prefix-numeric-value arg) + (if (< (mark) (point)) -1 1))) (set-mark (save-excursion (goto-char (mark)) (forward-paragraph arg) (point)))) (t - (forward-paragraph arg) + (forward-paragraph (prefix-numeric-value arg)) (push-mark nil t t) - (backward-paragraph arg)))) + (backward-paragraph (prefix-numeric-value arg))))) (defun kill-paragraph (arg) "Kill forward to end of paragraph. -- 2.8.2