From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 27 13:14:50 2022 Received: (at submit) by debbugs.gnu.org; 27 Dec 2022 18:14:50 +0000 Received: from localhost ([127.0.0.1]:56446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAETR-0000aW-R8 for submit@debbugs.gnu.org; Tue, 27 Dec 2022 13:14:50 -0500 Received: from lists.gnu.org ([209.51.188.17]:60200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAETL-0000aJ-TB for submit@debbugs.gnu.org; Tue, 27 Dec 2022 13:14:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAETL-0006MD-O9 for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2022 13:14:43 -0500 Received: from relay10.mail.gandi.net ([2001:4b98:dc4:8::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAETK-0006Zl-0w for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2022 13:14:43 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id D9CD3240003 for ; Tue, 27 Dec 2022 18:14:36 +0000 (UTC) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: 30.0.50; prog-fill-reindent-defun doesn't use region Organization: LINKOV.NET Date: Tue, 27 Dec 2022 20:13:02 +0200 Message-ID: <865ydwc3p1.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2001:4b98:dc4:8::230; envelope-from=juri@linkov.net; helo=relay10.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) X-Debbugs-CC: Theodor Thornhill After selecting the region in a docstring, M-q used to fill the region, but new prog-fill-reindent-defun doesn't do this. The original function had the argument REGION for that, described thusly: The REGION argument is non-nil if called interactively; in that case, if Transient Mark mode is enabled and the mark is active, call ‘fill-region’ to fill each of the paragraphs in the active region, instead of just filling the current paragraph. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 27 16:01:36 2022 Received: (at 60360) by debbugs.gnu.org; 27 Dec 2022 21:01:36 +0000 Received: from localhost ([127.0.0.1]:56564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAH4p-0007G1-RU for submit@debbugs.gnu.org; Tue, 27 Dec 2022 16:01:36 -0500 Received: from out-28.mta0.migadu.com ([91.218.175.28]:58899) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAH4n-0007Fr-27 for 60360@debbugs.gnu.org; Tue, 27 Dec 2022 16:01:34 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1672174891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RWsw4NBrgeEe53RG6k58JKzETJYrmx30I83xosRj02A=; b=CMYTmiqTn95LyXpwJnlwqZzGT9OyFI7JQcwjdM2n9ZN6cYLpGkE74UCtmD4K4MFhR6x/RS zRUsOhyVzseP8aTZSet61GVowGPjJR9tfHmlQoJxjwh1OHo9jW4tyTcT700gxIQu7k6RhR pJBKWDe6xASfZlzZLEUH/uk9L7ytS8KFIpDsgUrQC17jd4ezcB6zWA+wWAvnvuzpJlNUAI oQRNAEKeYLOtNcSR7FIy0MiwO8iJ9j8xIhxJWsy4QHgvyvFczAQokiqZBB7oTUFOQW8V24 dBjYOWFmFa5Y+rsf74YMeFN8ZNpfwfRCgY/8xTQyChWOYqeNnhwzR0eBeEe/fw== From: Theodor Thornhill To: Juri Linkov , 60360@debbugs.gnu.org Subject: Re: bug#60360: 30.0.50; prog-fill-reindent-defun doesn't use region In-Reply-To: <865ydwc3p1.fsf@mail.linkov.net> References: <865ydwc3p1.fsf@mail.linkov.net> Date: Tue, 27 Dec 2022 22:01:28 +0100 Message-ID: <871qoky313.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60360 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Juri! > X-Debbugs-CC: Theodor Thornhill > > After selecting the region in a docstring, M-q used to fill the region, > but new prog-fill-reindent-defun doesn't do this. The original > function had the argument REGION for that, described thusly: > > The REGION argument is non-nil if called interactively; in that > case, if Transient Mark mode is enabled and the mark is active, > call =E2=80=98fill-region=E2=80=99 to fill each of the paragraphs in th= e active > region, instead of just filling the current paragraph. Thanks, does the below patch solve your problem? If so, feel free to install it, as I can't :-) Theo --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fixes-in-prog-fill-reindent-defun.patch >From bafb70b02577aaabec3d92a4a25557504dec25f3 Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Sun, 25 Dec 2022 22:47:36 +0100 Subject: [PATCH] Fixes in prog-fill-reindent-defun Ensure that we don't consider lines such as switch (foo) { case 2: // If point on 'c' in 'case' return 2; not to be considered for filling. Also make sure we check for the active region, to replicate the normal fill-paragraph behavior. * lisp/progmodes/prog-mode.el (prog-fill-reindent-defun): Adjust regex, and make sure fill-paragraph checks for active region. (bug#60360, bug#60322) --- lisp/progmodes/prog-mode.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index aa37a4ac86..5e692980b2 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -164,10 +164,8 @@ prog-fill-reindent-defun (treesit-node-type (treesit-node-at (point))))))) (if (or treesit-text-node (nth 8 (syntax-ppss)) - (re-search-forward comment-start-skip (line-end-position) t)) - (if (memq fill-paragraph-function '(t nil)) - (lisp-fill-paragraph argument) - (funcall fill-paragraph-function argument)) + (re-search-forward "^\\s<" (line-end-position) t)) + (fill-paragraph argument (region-active-p)) (beginning-of-defun) (let ((start (point))) (end-of-defun) -- 2.34.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 28 12:23:09 2022 Received: (at 60360) by debbugs.gnu.org; 28 Dec 2022 17:23:09 +0000 Received: from localhost ([127.0.0.1]:58532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAa8z-0000qR-19 for submit@debbugs.gnu.org; Wed, 28 Dec 2022 12:23:09 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:33831) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAa8x-0000pX-Jk; Wed, 28 Dec 2022 12:23:08 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 7F95D1BF203; Wed, 28 Dec 2022 17:22:57 +0000 (UTC) From: Juri Linkov To: Theodor Thornhill Subject: Re: bug#60360: 30.0.50; prog-fill-reindent-defun doesn't use region In-Reply-To: <871qoky313.fsf@thornhill.no> (Theodor Thornhill's message of "Tue, 27 Dec 2022 22:01:28 +0100") Organization: LINKOV.NET References: <865ydwc3p1.fsf@mail.linkov.net> <871qoky313.fsf@thornhill.no> Date: Wed, 28 Dec 2022 19:22:26 +0200 Message-ID: <86r0wjphnx.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 60360 Cc: 60360@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 60360 30.0.50 thanks >> After selecting the region in a docstring, M-q used to fill the region, >> but new prog-fill-reindent-defun doesn't do this. The original >> function had the argument REGION for that, described thusly: > > Thanks, does the below patch solve your problem? If so, feel free to > install it, as I can't :-) Thanks for the patch. I confirmed that it works, and then pushed to master. > @@ -164,10 +164,8 @@ prog-fill-reindent-defun > ... > + (re-search-forward "^\\s<" (line-end-position) t)) > + (fill-paragraph argument (region-active-p)) Usually use-region-p would be a better choice, but in this case region-active-p is fine since it follows the logic used by the REGION arg of fill-paragraph. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 28 12:25:31 2022 Received: (at control) by debbugs.gnu.org; 28 Dec 2022 17:25:32 +0000 Received: from localhost ([127.0.0.1]:58541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAaBH-0000vB-MR for submit@debbugs.gnu.org; Wed, 28 Dec 2022 12:25:31 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:43283) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAaBF-0000uw-KJ for control@debbugs.gnu.org; Wed, 28 Dec 2022 12:25:30 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id E5853240007 for ; Wed, 28 Dec 2022 17:25:22 +0000 (UTC) From: Juri Linkov To: control@debbugs.gnu.org Subject: Re: bug#60360: 30.0.50; prog-fill-reindent-defun doesn't use region In-Reply-To: <871qoky313.fsf@thornhill.no> (Theodor Thornhill's message of "Tue, 27 Dec 2022 22:01:28 +0100") Organization: LINKOV.NET References: <865ydwc3p1.fsf@mail.linkov.net> <871qoky313.fsf@thornhill.no> Date: Wed, 28 Dec 2022 19:24:47 +0200 Message-ID: <86k02bphk0.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) forcemerge 60322 60360 thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 28 12:27:24 2022 Received: (at control) by debbugs.gnu.org; 28 Dec 2022 17:27:24 +0000 Received: from localhost ([127.0.0.1]:58547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAaD6-0000yt-2U for submit@debbugs.gnu.org; Wed, 28 Dec 2022 12:27:24 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:56847) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAaD4-0000yf-Gi for control@debbugs.gnu.org; Wed, 28 Dec 2022 12:27:22 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 8B7A91BF206 for ; Wed, 28 Dec 2022 17:27:16 +0000 (UTC) From: Juri Linkov To: control@debbugs.gnu.org Subject: Re: bug#60360: 30.0.50; prog-fill-reindent-defun doesn't use region In-Reply-To: <871qoky313.fsf@thornhill.no> (Theodor Thornhill's message of "Tue, 27 Dec 2022 22:01:28 +0100") Organization: LINKOV.NET References: <865ydwc3p1.fsf@mail.linkov.net> <871qoky313.fsf@thornhill.no> Date: Wed, 28 Dec 2022 19:27:03 +0200 Message-ID: <86bknnphg8.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 60360 30.0.50 thanks From unknown Mon Jun 23 07:51:17 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 27 Jan 2023 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator