Subject: bug#45318: 28.0.50; mark-paragraph

From: "H. Dieter Wilhelm" <[email-masked]>
Date: Sun, 03 Jan 2021 23:29:00 +0100

Lars Ingebrigtsen <[email-masked]> writes:

> Richard Stallman <[email-masked]> writes:
>
>> Create a buffer in Fundamental mode, insert the text
>>
>> this is
>> a test
>>
>> with no newline at the end, put point at the end,  and type M-h.
>>
>> It does not set the mark.
>
> It's this bit:
>
> 	  ;; don't activate the mark when at eob
> 	  ((and (eobp) (> numeric-arg 0)))

I'm sorry for the mistake.  Here's the correction of M-h for above
bug report:

modified   lisp/textmodes/paragraphs.el
@@ -401,8 +401,9 @@ mark-paragraph
 	      (goto-char (mark))
 	      (forward-paragraph arg)
 	      (point))))
-	  ;; don't activate the mark when at eob
-	  ((and (eobp) (> numeric-arg 0)))
+	  ;; don't activate the mark when at eob in an empty paragraph
+	  ;; with a positive ARG
+	  ((and (eobp) (bolp) (> numeric-arg 0)))
 	  (t
 	   (unless (save-excursion
 		     (forward-line 0)

But I would like to extend this solution for the following case: (and
(eobp) (bolp)).  The current implementation of M-h is doing nothing (for
positive arguments) because - formally - the cursor sits in an "empty"
paragraph and there are no further paragraphs below.

But in this situation applying M-h clearly shows the user's intention to
mark the paragraph above the cursor (and possibly further ones above
when typing M-hhhh).

What is your opinion?

   Thank you

> commit eb090f65ceb0ae8a90829e911694348583135ba5
> Now added to the Cc's.

Thank you Lars

      Dieter

-- 
Best wishes
H. Dieter Wilhelm
Zwingenberg, Germany