From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "H. Dieter Wilhelm" Newsgroups: gmane.emacs.bugs Subject: bug#45318: 28.0.50; mark-paragraph Date: Tue, 05 Jan 2021 23:27:30 +0100 Message-ID: <86czyjj9yl.fsf@duenenhof-wilhelm.de> References: <87wnxdhh54.fsf@gnus.org> <86pn2lk637.fsf@duenenhof-wilhelm.de> <871rf16our.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13179"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: 45318@debbugs.gnu.org, Richard Stallman To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 05 23:28:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kwuoF-0003Ic-GM for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Jan 2021 23:28:11 +0100 Original-Received: from localhost ([::1]:55838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwuoE-0002hZ-GK for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Jan 2021 17:28:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwuo8-0002hC-ET for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2021 17:28:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59579) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kwuo6-0008D3-Mm for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2021 17:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kwuo6-0000Zr-JD for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2021 17:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "H. Dieter Wilhelm" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Jan 2021 22:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45318 X-GNU-PR-Package: emacs Original-Received: via spool by 45318-submit@debbugs.gnu.org id=B45318.16098856592183 (code B ref 45318); Tue, 05 Jan 2021 22:28:02 +0000 Original-Received: (at 45318) by debbugs.gnu.org; 5 Jan 2021 22:27:39 +0000 Original-Received: from localhost ([127.0.0.1]:42892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwuni-0000Z9-Qd for submit@debbugs.gnu.org; Tue, 05 Jan 2021 17:27:39 -0500 Original-Received: from mout.kundenserver.de ([212.227.17.10]:54929) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwunh-0000Yx-HX for 45318@debbugs.gnu.org; Tue, 05 Jan 2021 17:27:38 -0500 Original-Received: from ping ([92.116.141.22]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MEF87-1knFdH4BCn-00ABVg; Tue, 05 Jan 2021 23:27:31 +0100 In-Reply-To: <871rf16our.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 04 Jan 2021 10:19:40 +0100") X-Provags-ID: V03:K1:6LJv30BPKliyUH8eZqmbJsYu+f7YPPAQ0QnngVBmtHFSiborv7W x+ZNC3Zc8vyRK+EpARwOWq7fd8/CPBXi2SDg3TLaQIgGYX7UX4KPto+p29FCVyYHl5YpFbb gjSgAM0LcQbQC7bfU/vYHZHkC7TUpZX8DMrTpdqfqIZrdgEXG6TM16pzFZIZtP5I4knku/r qO014YiUHZ9FwB3bRJHDg== X-UI-Out-Filterresults: notjunk:1;V03:K0:eSkiXj8gFGg=:Dm1wf3d8G2XcfBKoQoZdMp nkEnpJQW+fsb2E7nd8otUjLa6W7HBLxfyRHw7loP8F0c1wh8FDTUDQxFTOxx80JW/AuX5AbWm DZyRtosviXrTcb1ZQNxrcUA42W7UAm9UJObhuBpCoIzk9erJPxep/HFu6wdp1Oml2qVtV7VFD 5zQMj8LAarJYRLWJhsoh8okXgz4zCNdmDDJWN8bLrFpzx+up4bgdbVXd//wp9y7aJGK/s9NKv ESSIPx64dPh2XTX+rzQYxkfNQKxlGTEsdVBK/DItDQM0mf1B9keYYoxG1X7/AcZgENn4t/ct7 nRyNtTYu8CG1imshem37a2yD7dMHFhD4GDCRQ33S8yWPnXDFL7lwrET0PY6NpB4t5o7EYVxTH vwh3W4MIcI/XF1bbZGNFYjgajArv5PHShtlACxzSn4OOBC3hBJed8XFUR8531P0Zj+FI+MCIi 5UCmoEB2uQ== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:197401 Archived-At: Lars Ingebrigtsen writes: > 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. Many thanks Dieter PS: Please tell me if I can prepare patches in a better way or format.. >From 35743faf181b04101ecdc61c6f6a3de3f9c6b10f Mon Sep 17 00:00:00 2001 From: Dieter Wilhelm 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 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -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." (interactive "P\np") - (let ((numeric-arg (prefix-numeric-value arg))) + (let ((numeric-arg (prefix-numeric-value arg)) + (pt)) (cond ((zerop numeric-arg)) ((and allow-extend (or (and (eq last-command this-command) mark-active) @@ -401,8 +402,13 @@ mark-paragraph (goto-char (mark)) (forward-paragraph arg) (point)))) - ;; 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)))) (t (unless (save-excursion (forward-line 0) -- 2.17.1 -- Best wishes H. Dieter Wilhelm Zwingenberg, Germany