From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 25 16:54:55 2022 Received: (at submit) by debbugs.gnu.org; 25 Dec 2022 21:54:55 +0000 Received: from localhost ([127.0.0.1]:50215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9YxL-0003SK-GG for submit@debbugs.gnu.org; Sun, 25 Dec 2022 16:54:55 -0500 Received: from lists.gnu.org ([209.51.188.17]:50058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9YxJ-0003SB-JP for submit@debbugs.gnu.org; Sun, 25 Dec 2022 16:54:54 -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 1p9YxJ-0000mu-E2 for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 16:54:53 -0500 Received: from out2.migadu.com ([188.165.223.204]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9YxH-00088O-Af for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 16:54:53 -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=1672005287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=i7BRjIZQ+f0Rg9GYG50wzYAJS3N+LAYxg/KdsGa+zew=; b=MvH8XjsWKDCVIQuHRz2vaFjsW+LN7kVBfRZS1tju5XfHGKG8vT9rc67ClUWildAEqGvYiX TGFh79tOA8sxUraoHSIS0ajCLKM9NTlflKcFrGJEiiGG9s5TExOEtjkjqRp66raSvsb/+h c1PX0Y1I2txfZcqzmV9LB0BV77wNC5ozS4q8Xczc+LWobW4M5BAtUfPUkeAAgX9iGRD/+o BSqPeQjtTZHnTjytkn3czv2FU/3+l3AozXphwygKzN3myu1lDN/aSKoFXM9CCTA7283CNv nKQ+RK2Bhj81h55t9Qb+5U07yVDzCJVYLirdTktAWC6qdujWGeZDInZ27iqwtg== From: Theodor Thornhill To: bug-gnu-emacs@gnu.org Subject: 30.0.50; [PATCH]: Search for comment at bol in prog-fill-reindent-defun Date: Sun, 25 Dec 2022 22:54:44 +0100 Message-ID: <87r0wn87yz.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=188.165.223.204; envelope-from=theo@thornhill.no; helo=out2.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) 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.4 (--) --=-=-= Content-Type: text/plain Hi! Attached is a small adjustment to the regex used in prog-fill-reindent-defun. The point is that we shouldn't consider lines where comments come after actual code as inside a comment. Theo --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Search-for-comment-at-bol-in-prog-fill-reindent-defu.patch >From 8cbd514496d45e3b22523c5dc303abf97b3761f7 Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Sun, 25 Dec 2022 22:47:36 +0100 Subject: [PATCH] Search for comment at bol 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. * lisp/progmodes/prog-mode.el (prog-fill-reindent-defun): Adjust regex. --- lisp/progmodes/prog-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index aa37a4ac86..cebd759a4e 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -164,7 +164,7 @@ 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)) + (re-search-forward "^\\s<" (line-end-position) t)) (if (memq fill-paragraph-function '(t nil)) (lisp-fill-paragraph argument) (funcall fill-paragraph-function argument)) -- 2.34.1 --=-=-=-- 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 debbugs-submit-bounces@debbugs.gnu.org Thu Dec 29 04:02:34 2022 Received: (at 60322) by debbugs.gnu.org; 29 Dec 2022 09:02:34 +0000 Received: from localhost ([127.0.0.1]:59235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAoo6-0002b4-2q for submit@debbugs.gnu.org; Thu, 29 Dec 2022 04:02:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAoo3-0002an-1T for 60322@debbugs.gnu.org; Thu, 29 Dec 2022 04:02:32 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAonx-0002Qa-GA; Thu, 29 Dec 2022 04:02:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=L9EUGVyVhOwXp64126YXbw55js9tH4HSm1X49CYcvQ0=; b=a0JW/+tSV622 +hDxhWY7Lyh3TBOPyuhlVSIdDKXIwBOkoUw0E7VDPelNHZQpi5DPCFsbaHTb8cI8AnTgYx6cZIn41 LK9aWFuKCbSXv2hNXiqIUMZsZrgKk26DaVF9AgDZ9Fr+eF00pVtN2smBYk9Zg9hDuhGfAtXk83l/V l9bOqsuMBcXPpzD0jxUt3sT4mfDP08XBi50uiAPL7wc8DAaqHHexhRTY9MasbzJRKTWYQ4yIseaR5 drqpHLdvSxaQxAPXJyaRcKFh1qlV6oIBi0b753qdCi3VPufnKlWHGhyJPkmdsJsnOtGZBcKg0R1Q/ /FrVFRhsNsG/yAllzMd6MA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAonw-0000zU-M9; Thu, 29 Dec 2022 04:02:25 -0500 Date: Thu, 29 Dec 2022 11:02:35 +0200 Message-Id: <83k02a8tw4.fsf@gnu.org> From: Eli Zaretskii To: Theodor Thornhill , Dmitry Gutov , Yuan Fu In-Reply-To: <87r0wn87yz.fsf@thornhill.no> (bug-gnu-emacs@gnu.org) Subject: Re: bug#60322: 30.0.50; [PATCH]: Search for comment at bol in prog-fill-reindent-defun References: <87r0wn87yz.fsf@thornhill.no> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60322 Cc: 60322@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: -3.3 (---) > Date: Sun, 25 Dec 2022 22:54:44 +0100 > From: Theodor Thornhill via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Attached is a small adjustment to the regex used in > prog-fill-reindent-defun. The point is that we shouldn't consider lines > where comments come after actual code as inside a comment. Dmitry, Yuan, any comments? From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 29 05:48:14 2022 Received: (at 60322) by debbugs.gnu.org; 29 Dec 2022 10:48:14 +0000 Received: from localhost ([127.0.0.1]:59370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAqSM-0007aB-GW for submit@debbugs.gnu.org; Thu, 29 Dec 2022 05:48:14 -0500 Received: from out-50.mta0.migadu.com ([91.218.175.50]:39798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAqSK-0007Zr-8b for 60322@debbugs.gnu.org; Thu, 29 Dec 2022 05:48:12 -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=1672310891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FM7JOBiLD+yGfqbH9RtWbbMxNto4XFHzgVqgxIi6ULQ=; b=1e0brt+4eciFPi7yFxmH8JZmsrUiOFtieC8ULGIT2Jw2C6t7+ADK3zxPWPb7Posp6H7Su8 Cj9e6n3PitZo9AZ5vrAjbIiD1vrxsD/+Pjl8a/XU3fjtgrHoti6HM+wyjg4v3UzlRPBmxH 2BV/Sd2TaEkgV2+96X0ZCVR7eb2RX7CJ5hqMucFGis/TVyhUcAeV4TOS7Gr/OdGSliCwwe TtxxOJp6G0z89Yn1WcTyhpDIp3gvZffyQWNWemU0VatGYJcLtF5BcqoH7ll1CDIn8hlRbg hLSLwXXwKwYffM4ZYPjmn705qN3aA6srwMFRjdoOvYDvM7Z3x4O55qqKW2sTeQ== From: Theodor Thornhill To: Eli Zaretskii , Dmitry Gutov , Yuan Fu Subject: Re: bug#60322: 30.0.50; [PATCH]: Search for comment at bol in prog-fill-reindent-defun In-Reply-To: <83k02a8tw4.fsf@gnu.org> References: <87r0wn87yz.fsf@thornhill.no> <83k02a8tw4.fsf@gnu.org> Date: Thu, 29 Dec 2022 11:48:10 +0100 Message-ID: <87mt76wknp.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60322 Cc: 60322@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.0 (-) Eli Zaretskii writes: >> Date: Sun, 25 Dec 2022 22:54:44 +0100 >> From: Theodor Thornhill via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> Attached is a small adjustment to the regex used in >> prog-fill-reindent-defun. The point is that we shouldn't consider lines >> where comments come after actual code as inside a comment. > > Dmitry, Yuan, any comments? This is adressed in f9a22cf78d1a7f6472b09c3046c6a7f6984bc2d2, so This can be closed :-) Theo From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 29 06:12:23 2022 Received: (at 60322-done) by debbugs.gnu.org; 29 Dec 2022 11:12:23 +0000 Received: from localhost ([127.0.0.1]:59382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAqpj-00088Z-7v for submit@debbugs.gnu.org; Thu, 29 Dec 2022 06:12:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAqph-00088K-ND for 60322-done@debbugs.gnu.org; Thu, 29 Dec 2022 06:12:22 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAqpb-0002ET-F5; Thu, 29 Dec 2022 06:12:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=lM8aDNxNQGP0zKHdTauIO+AMle4Hf6lPZV62gtG43vo=; b=S0Zo054BSGfY 0fA2VwYBlbXDC0xzufZNI58SuwyaxScQvio7tqwG5yeb3NnzaFwo7kQ8slr2vSIm1BrwVerwWibt9 8a1sQ5or9uZ8Rwu1dZ0ieI+yddMZ+fK2Fvu53hCNwGfzytTy8LVREixIrXvtPDAyPpcBEgSCxBPwj 5Y/ONFVvHQsmOxT9rxc8TN/Q83efE3QGXdEWNsfbVTgAdlRJxVr2wGx0xA0oG2qs3wuvXfrQNp6xh 5K9+cNNzuwzAJSwVNYSk6CiGcjXkGc3lcoDkyOi+WOjApF0cKnqOslBb7Vi/B0hAF8HQ7DwfaX/PW 4jghoot1n/28J5bnIwmQtg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAqpb-0003zl-3y; Thu, 29 Dec 2022 06:12:15 -0500 Date: Thu, 29 Dec 2022 13:12:26 +0200 Message-Id: <83cz828nvp.fsf@gnu.org> From: Eli Zaretskii To: Theodor Thornhill In-Reply-To: <87mt76wknp.fsf@thornhill.no> (message from Theodor Thornhill on Thu, 29 Dec 2022 11:48:10 +0100) Subject: Re: bug#60322: 30.0.50; [PATCH]: Search for comment at bol in prog-fill-reindent-defun References: <87r0wn87yz.fsf@thornhill.no> <83k02a8tw4.fsf@gnu.org> <87mt76wknp.fsf@thornhill.no> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60322-done Cc: casouri@gmail.com, 60322-done@debbugs.gnu.org, dgutov@yandex.ru 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: -3.3 (---) > From: Theodor Thornhill > Cc: 60322@debbugs.gnu.org > Date: Thu, 29 Dec 2022 11:48:10 +0100 > > Eli Zaretskii writes: > > >> Date: Sun, 25 Dec 2022 22:54:44 +0100 > >> From: Theodor Thornhill via "Bug reports for GNU Emacs, > >> the Swiss army knife of text editors" > >> > >> Attached is a small adjustment to the regex used in > >> prog-fill-reindent-defun. The point is that we shouldn't consider lines > >> where comments come after actual code as inside a comment. > > > > Dmitry, Yuan, any comments? > > This is adressed in f9a22cf78d1a7f6472b09c3046c6a7f6984bc2d2, so This > can be closed :-) Thanks, done. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 29 11:04:28 2022 Received: (at 60322) by debbugs.gnu.org; 29 Dec 2022 16:04:28 +0000 Received: from localhost ([127.0.0.1]:60910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAvOO-0001Sk-9c for submit@debbugs.gnu.org; Thu, 29 Dec 2022 11:04:28 -0500 Received: from mail-wm1-f43.google.com ([209.85.128.43]:43897) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAvOM-0001SW-IU for 60322@debbugs.gnu.org; Thu, 29 Dec 2022 11:04:26 -0500 Received: by mail-wm1-f43.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so13478821wms.2 for <60322@debbugs.gnu.org>; Thu, 29 Dec 2022 08:04:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=rleeLxhu5SAx/5DtJKN3b+/GBEOycZT5N8TzOXciPP8=; b=kwjwNGbPdZp37W966lVvPjQkdsU0LNpzWVfkffJc7DXYOHCgLysXgnIeojpKVGYEux IzzdE/0lPmjkUw57cury6tc9BS6d5O6PerGvW0K5Qd0s5w7KnldUsMKQBgyJwA4wIHaX nmbK6gElLLxJVOZnVjs94BZovM9Pve3zePM5euw0lCnhq6klxwWVz2OMtEXyc1nrQmYg N0m9maTg3xhLzv7SyPpGxhU8ecr/kpEmue2W7LsJ6gBsR0SqKD2SHk72RQH6hWG/95Zn hVRq0yS3xJ16NcllNerwO8F9opD2qgbkaXtWhxNumSSpzb2iGf8NNBRzs8yYvfWc+Cmh PgCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rleeLxhu5SAx/5DtJKN3b+/GBEOycZT5N8TzOXciPP8=; b=AyJXEhAhyzUVxNhMfLdmo8toJMXLnj/mM22+1I+r1Ia0kQs7vQbiC2nBECSBMiKi0D A/zF1MzyStH35330wgNRUUF9UuWsJndcSpvCzkYGZugTN5mLNa4ueLCOd6VkwbIRWqZB IlxDIxgDuCayZx/xnHBauIdaakDfbFQBpHQMjCbkO1ZPGyhe0XxuIl367vrpWfLsFD3o K0y54Wb6ybUwh8s1Cd9i3q7NUuioM8Uod5uQ0hixRyDod6pI0r7VD/5y5ROprleFBcAA nsyV71hM/m6vE7NkOy717bJ6osOMRhsnkgk5at6MY4aCQhGTaVIkuWCnYTzldyGy/BoS PgOg== X-Gm-Message-State: AFqh2krlCExl6tJp0ox5JOz+sxzEtv/Ol8RYhJgPuakDETX2+X9XwYjx SW4bBohJmdZqS9bWwEWWUVk= X-Google-Smtp-Source: AMrXdXv0OsFhuLWOYDe7F2mZv77Ag6/i3yt5v5c6rXEDLlfSvNkgNe+h3rdMmpcj22nVQifaB9cXaA== X-Received: by 2002:a05:600c:4fcf:b0:3d1:d396:1ade with SMTP id o15-20020a05600c4fcf00b003d1d3961ademr20473424wmq.9.1672329860518; Thu, 29 Dec 2022 08:04:20 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id u9-20020a05600c19c900b003d9876aa04asm15506148wmq.41.2022.12.29.08.04.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Dec 2022 08:04:20 -0800 (PST) Message-ID: <1a6503f9-31be-7015-64a4-6776e510a855@yandex.ru> Date: Thu, 29 Dec 2022 18:04:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: bug#60322: 30.0.50; [PATCH]: Search for comment at bol in prog-fill-reindent-defun Content-Language: en-US To: Theodor Thornhill , 60322@debbugs.gnu.org References: <87r0wn87yz.fsf@thornhill.no> From: Dmitry Gutov In-Reply-To: <87r0wn87yz.fsf@thornhill.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 60322 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.9 (-) On 25/12/2022 23:54, Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Attached is a small adjustment to the regex used in > prog-fill-reindent-defun. The point is that we shouldn't consider lines > where comments come after actual code as inside a comment. How about we allow indentation? And allow to be called not from BOL too? (re-search-forward "\\s-*\\s<" (line-end-position) t) From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 29 14:23:15 2022 Received: (at 60322) by debbugs.gnu.org; 29 Dec 2022 19:23:15 +0000 Received: from localhost ([127.0.0.1]:32923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAyUk-000324-Pv for submit@debbugs.gnu.org; Thu, 29 Dec 2022 14:23:15 -0500 Received: from out2.migadu.com ([188.165.223.204]:46412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAyUh-00031u-T2 for 60322@debbugs.gnu.org; Thu, 29 Dec 2022 14:23:13 -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=1672341790; 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=SvH71ID7dif3G0IPFXpnhZv1KH6MOmzox4vFRGtMRL4=; b=AqtDlPK8FRGhoAqk7yryLXxLn8av4jCW4+FcGhh3YZEIrPwkWitvmurYh7qnrpf1xvn0VM rW0rZF9VYRG4W9IPmi6qGE5whI84sTzEy/ANde/vCYnJIpL2+ebDkG+7LnpdtvCMaZFCMq UtKI4XylHoFhOT3N9WmJctpq1mVJUWmvqzP53omEj8bwJD1SEiJOV3r2IvIDXjXAkzzGZM VmWnt84+oY1SVR31rQ9hO6dlNi1hmzZ/zdAf3Xknw+B17dJUP0ClQXdQGqqCpOJUtr840B ZitBoV2emU8tMQPJsr6XCPSeYYmoUBmfyuDqFXLHmqA8iByFYCJ+1reLlJ8CEA== From: Theodor Thornhill To: Dmitry Gutov , 60322@debbugs.gnu.org Subject: Re: bug#60322: 30.0.50; [PATCH]: Search for comment at bol in prog-fill-reindent-defun In-Reply-To: <1a6503f9-31be-7015-64a4-6776e510a855@yandex.ru> References: <87r0wn87yz.fsf@thornhill.no> <1a6503f9-31be-7015-64a4-6776e510a855@yandex.ru> Date: Thu, 29 Dec 2022 20:23:08 +0100 Message-ID: <87tu1eovz7.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: 60322 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 Dmitry Gutov writes: > On 25/12/2022 23:54, Theodor Thornhill via Bug reports for GNU Emacs, > the Swiss army knife of text editors wrote: >> Attached is a small adjustment to the regex used in >> prog-fill-reindent-defun. The point is that we shouldn't consider lines >> where comments come after actual code as inside a comment. > > How about we allow indentation? > > And allow to be called not from BOL too? > > (re-search-forward "\\s-*\\s<" (line-end-position) t) Sure! Will you install it for me? Theo --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Allow-for-indentation-in-prog-fill-reindent-defun.patch >From b92043c5f1c3f835d19aa9d632920804283eccfd Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Thu, 29 Dec 2022 20:19:46 +0100 Subject: [PATCH] Allow for indentation in prog-fill-reindent-defun (bug#60322) * lisp/progmodes/prog-mode.el (prog-fill-reindent-defun): Adjust regexp. --- lisp/progmodes/prog-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index 5e692980b2..2e0cb6cd25 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -164,7 +164,7 @@ prog-fill-reindent-defun (treesit-node-type (treesit-node-at (point))))))) (if (or treesit-text-node (nth 8 (syntax-ppss)) - (re-search-forward "^\\s<" (line-end-position) t)) + (re-search-forward "\\s-*\\s<" (line-end-position) t)) (fill-paragraph argument (region-active-p)) (beginning-of-defun) (let ((start (point))) -- 2.34.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 29 14:26:10 2022 Received: (at 60322) by debbugs.gnu.org; 29 Dec 2022 19:26:10 +0000 Received: from localhost ([127.0.0.1]:32927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAyXa-00036R-DS for submit@debbugs.gnu.org; Thu, 29 Dec 2022 14:26:10 -0500 Received: from mail-ed1-f44.google.com ([209.85.208.44]:35387) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAyXW-00035u-Hq for 60322@debbugs.gnu.org; Thu, 29 Dec 2022 14:26:08 -0500 Received: by mail-ed1-f44.google.com with SMTP id i15so27901141edf.2 for <60322@debbugs.gnu.org>; Thu, 29 Dec 2022 11:26:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=lcH9M+nbYrZoJdaxijA8iBGD9c97ZhXEluQpAF3qTJU=; b=SVAH99sTy3jeF+6OdGEA9awV6pRO5vwYsdxusTtovxJG24g5AnPizDf1VsxVN27I5n ykswZ18NRh8FZFTVLhyu5KifX1x8zx9XHSDcrGdI+CUoIVEKbas/dAyRoWAN9giIQN6U 4FjzsLx/O0Nzzv3jDsftPV+YYT9+VMg2j2tRx9U0x/NPzy0au3dsRZeWBQEWqOHBZu+D Rr2GgfIigQ6RHDVzkN0lZmm/nWwgwthGkWMiFDPqEVSiulLaI9w9LrpW7yZH7ATyKtz4 knw7c4wZ6UY0jxb3o5Kgm9g/UXd72uUW+c715yhfMAvfFoyo9kyUL0N/pfvf33IYS0Dr c03g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lcH9M+nbYrZoJdaxijA8iBGD9c97ZhXEluQpAF3qTJU=; b=HjeRo2VHO/YnqGJiDegQGFdLcLpH9y1O82j3UE+/TlCclmKysZ4yWdIVQT7PBJdgQP VPoU8bgZSipTy5HPKKadIMJ1NDGHy6/v/eOrwl6/z8zKMtiyjaWhVfwdcFa/2DoZJmHR BGmXc2LHW6MNZiAxFgUJu00OmaB9vYcc4uV6SKmKHDhq8bZJePK4MCaGjCICfvabCySe ePT32sqwwuYer6UQtI0tRKyD9RRdh3nalKcyogdDzBi2kk12M3M/SGOVq10IYJqRZPGC 04ruRnySgEy/EAkuh0d0L070GBSIXrryXEUv1M/RWpvUUfHk7VuDXGQO1ZnuGZ7lOvxo VLYg== X-Gm-Message-State: AFqh2koV9B/OAZf3215V1eHc4kGuNBq7YnGZzZR1EQuerQLW1TofrS6/ dUspfP1QFx8vnWgr1BDlc48= X-Google-Smtp-Source: AMrXdXslZs1/vFDWUDZapQRcsgAoMK8VtzpY0NQba7SCAZyPQ4ZpynaeP5lDEsS4u7YK55xwp+Zz5A== X-Received: by 2002:a05:6402:33a:b0:468:3d69:ac81 with SMTP id q26-20020a056402033a00b004683d69ac81mr25340213edw.29.1672341960508; Thu, 29 Dec 2022 11:26:00 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id t18-20020a056402021200b0048447efe3fcsm5882283edv.84.2022.12.29.11.25.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Dec 2022 11:25:59 -0800 (PST) Message-ID: <664b3a60-2941-feba-b6f0-acb83d2fe64a@yandex.ru> Date: Thu, 29 Dec 2022 21:25:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: bug#60322: 30.0.50; [PATCH]: Search for comment at bol in prog-fill-reindent-defun Content-Language: en-US To: Theodor Thornhill , 60322@debbugs.gnu.org References: <87r0wn87yz.fsf@thornhill.no> <1a6503f9-31be-7015-64a4-6776e510a855@yandex.ru> <87tu1eovz7.fsf@thornhill.no> From: Dmitry Gutov In-Reply-To: <87tu1eovz7.fsf@thornhill.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 60322 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.9 (-) On 29/12/2022 21:23, Theodor Thornhill wrote: > Dmitry Gutov writes: > >> On 25/12/2022 23:54, Theodor Thornhill via Bug reports for GNU Emacs, >> the Swiss army knife of text editors wrote: >>> Attached is a small adjustment to the regex used in >>> prog-fill-reindent-defun. The point is that we shouldn't consider lines >>> where comments come after actual code as inside a comment. >> >> How about we allow indentation? >> >> And allow to be called not from BOL too? >> >> (re-search-forward "\\s-*\\s<" (line-end-position) t) > > Sure! > > Will you install it for me? Sure, done. I've also refilled the commit message a little. From unknown Sun Aug 17 01:44:58 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