Create a buffer in Fundamental mode, insert the text
with no newline at the end, put point at the end, and type M-h.
It does not set the mark.
In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32, cairo version 1.15.10)
of 2020-12-08 built on freetop
Repository revision: 0155bd0fdb166c97a2ce76cc5bc64fd195a676d3
Repository branch: master
System Description: Trisquel GNU/Linux Etiona (9.0)
value of $LANG: en_US.UTF-8
Major mode: RMAIL
Minor modes in effect:
> I'm not quite sure I follow you, but either with the proposed patch, or
> what I take to be your suggestion here, `mark-paragraph' works quite
> differently here than in Emacs 27, and we should get the previous
> behaviour back.
Right, below is my suggestion, please have a look.
PS: Please tell me if I can prepare patches in a better way or
From 35743faf181b04101ecdc61c6f6a3de3f9c6b10f Mon Sep 17 00:00:00 2001
From: Dieter Wilhelm <[hidden email]>
Date: Tue, 5 Jan 2021 22:44:21 +0100
Subject: [PATCH] textmodes/paragraphs.el fix mark-paragraph (Bug#45318)
Thus aligning the behavior of mark-paragraph with mark-defun.
lisp/textmodes/paragraphs.el | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 217ae10fe4..699c2191b8 100644
@@ -386,7 +386,8 @@ mark-paragraph
This also means when activating the mark immediately before using
this command, the current paragraph is only marked from point."
- (let ((numeric-arg (prefix-numeric-value arg)))
+ (let ((numeric-arg (prefix-numeric-value arg))
(cond ((zerop numeric-arg))
(or (and (eq last-command this-command) mark-active)
@@ -401,8 +402,13 @@ mark-paragraph
- ;; don't activate the mark when at eob
- ((and (eobp) (> numeric-arg 0)))
+ ;; check if point is behind the very last paragraph and mark
+ ;; it when no arg is given.
+ ((if (> (save-excursion (forward-paragraph)) 0)
+ (progn (setq pt (point))
+ (forward-paragraph (- 1))
+ (set-mark (point))
+ (goto-char pt))))
H. Dieter Wilhelm
> "H. Dieter Wilhelm" <[hidden email]> writes:
>> Right, below is my suggestion, please have a look.
>> Many thanks
>> PS: Please tell me if I can prepare patches in a better way or
> The patch format looks good. :-)
> However, this still doesn't quite restore how mark-paragraph works in
> Emacs 27 -- it leaves point in other places than it was.
> So I've reverted the previous change for now, and I've added a test.
> Could you have a look at the test
> cd check; make paragraphs-tests
> (it's the last one), and redo your original patch in a way that doesn't
> break the behaviour as demonstrated by this test?