From unknown Tue Jun 17 20:15:29 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#3900 <3900@debbugs.gnu.org> To: bug#3900 <3900@debbugs.gnu.org> Subject: Status: fill-comment-paragraph fails (e.g.) in perl-mode POD Reply-To: bug#3900 <3900@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:15:29 +0000 retitle 3900 fill-comment-paragraph fails (e.g.) in perl-mode POD reassign 3900 emacs submitter 3900 Bob Rogers severity 3900 normal thanks From rogers-emacs@rgrjr.dyndns.org Tue Jul 21 20:50:05 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 22 Jul 2009 03:50:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.2 required=4.0 tests=AWL,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6M3nw0Y014707 for ; Tue, 21 Jul 2009 20:49:59 -0700 Received: from mx10.gnu.org ([199.232.76.166]:40225) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MTSq5-00064o-8u for emacs-pretest-bug@gnu.org; Tue, 21 Jul 2009 23:49:57 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MTSq2-0000Re-Id for emacs-pretest-bug@gnu.org; Tue, 21 Jul 2009 23:49:56 -0400 Received: from rgrjr.com ([216.146.47.5]:37812) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MTSq2-0000R0-3V for emacs-pretest-bug@gnu.org; Tue, 21 Jul 2009 23:49:54 -0400 Received: from rgrjr.dyndns.org (c-66-30-196-77.hsd1.ma.comcast.net [66.30.196.77]) by rgrjr.com (Postfix on CentOS) with ESMTP id D34651600DC for ; Wed, 22 Jul 2009 03:49:52 +0000 (UTC) Received: (qmail 8652 invoked by uid 89); 22 Jul 2009 03:49:52 -0000 Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1) by home with SMTP; 22 Jul 2009 03:49:52 -0000 Received: by rgr.rgrjr.com (Postfix, from userid 500) id EBBBB484D3; Tue, 21 Jul 2009 23:49:51 -0400 (EDT) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="lC/rwZnrH2" Content-Transfer-Encoding: 7bit Message-ID: <19046.35935.750920.221950@rgr.rgrjr.com> Date: Tue, 21 Jul 2009 23:49:51 -0400 From: Bob Rogers To: emacs-pretest-bug@gnu.org Subject: fill-comment-paragraph fails (e.g.) in perl-mode POD X-Mailer: VM viewmail-600 under 23.1.50.1 (i686-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) --lC/rwZnrH2 Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit To reproduce (in trunk or 23.0.96): 1. Stuff the following six lines of "code" (two of them blank) into the "foo.pl" file: =head1 Testing This is a test case line with lots of stupid text. This is a test case line with a C<#> and lots of stupid text. =cut 2. "emacs -Q foo.pl" 3. Move the cursor to any point in the fourth line (the one with "C<#>") and type "M-q". This will produce the following user-unfriendly error: Search failed: "\\(^\\|\\s-\\);?#+ *" This directed my attention to the following code near the end of fill-comment-paragraph: (save-excursion (goto-char beg) (if (looking-at fill-prefix) nil (re-search-forward comment-start-skip))) which seems to make two bad assumptions: That comment-start-skip is never nil (though its documentation asserts otherwise), and that it matches before the end of the buffer (which is trivially false at EOB). The attached patch removes these assumptions, and makes the "Search failed" error go away. Unfortunately, this isn't enought to fix perl-mode: Instead of signalling an error, it does nothing, which is not right, either. The deeper problem there is that M-q in perl-mode doesn't distinguish between POD syntax and Perl code proper, and tries to treat the "#" as the start of a single-line comment, even though that is not possible in POD. But fixing that would require a more intrusive patch, and the fill-comment-paragraph code is wrong in any case, so I submit this fix separately on the chance that it might be considered suitable for 23.1. -- Bob Rogers http://www.rgrjr.com/ --lC/rwZnrH2 Content-Type: text/plain; name="fill-comment-para-fix.patch" Content-Disposition: inline; filename="fill-comment-para-fix.patch" Content-Transfer-Encoding: 7bit Index: lisp/textmodes/fill.el =================================================================== RCS file: /sources/emacs/emacs/lisp/textmodes/fill.el,v retrieving revision 1.223 diff -c -r1.223 fill.el *** lisp/textmodes/fill.el 8 Apr 2009 04:02:35 -0000 1.223 --- lisp/textmodes/fill.el 22 Jul 2009 03:44:20 -0000 *************** *** 976,986 **** (max comstart beg) end justify nil ;; Don't canonicalize spaces within the code just before ;; the comment. ! (save-excursion ! (goto-char beg) ! (if (looking-at fill-prefix) ! nil ! (re-search-forward comment-start-skip)))) ;; Make sure we don't return nil. t)))))) --- 976,987 ---- (max comstart beg) end justify nil ;; Don't canonicalize spaces within the code just before ;; the comment. ! (and comment-start-skip ! (save-excursion ! (goto-char beg) ! (if (looking-at fill-prefix) ! nil ! (re-search-forward comment-start-skip nil t))))) ;; Make sure we don't return nil. t)))))) --lC/rwZnrH2-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 14 15:23:57 2016 Received: (at 3900) by debbugs.gnu.org; 14 Jan 2016 20:23:57 +0000 Received: from localhost ([127.0.0.1]:49424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJoR3-0005EG-4A for submit@debbugs.gnu.org; Thu, 14 Jan 2016 15:23:57 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:35934) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJoR1-0005E2-Du for 3900@debbugs.gnu.org; Thu, 14 Jan 2016 15:23:56 -0500 Received: by mail-wm0-f42.google.com with SMTP id l65so360157215wmf.1 for <3900@debbugs.gnu.org>; Thu, 14 Jan 2016 12:23:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=sender:from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=4TDXPRd1zwbOS5suR6lEkuQZdcZW6m/58WKkbBMR0PE=; b=VWF3wnea4g6hj/PGLk3PHNYrQ7skzSJn6ub6GG2h1kYTt2C/UPmEFPgQcuLFfqQbaY B9l905kB89yJqTWhy2gBnM54aktG2WO5mtBbywX8FvD7rHFc8E4GQncr1sktMh51WnKq uztLaKl71C/zLRGLw7pweMT3kNih7eAdcVJLat6tjJ0x4QlD/NZ5T83yzmlX6gWZe4Sn hstswWVhKbm2WYA8ke+2TRTFmojmwcyp8WQgYk1917jfTsMK1DMNFtQoiBC5bb5yP5In LSid+GopqMgphzVK4BYGuI53nPC1lAAsW6i3mD3o4BYlihO0fjYBOQOSh5R2TEE2DsRt xajw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-type; bh=4TDXPRd1zwbOS5suR6lEkuQZdcZW6m/58WKkbBMR0PE=; b=F/mfp5hUvygQMWy9k8eno1l/wzQI4M6MsD3UIkBaIT2JKkfrileHiX3MPgvQgE+nuY xrrBxeCYlF8yjEIuRpj7IaX5OW1R1AuZMXPb4mone7lvLNWypIfTKmaG/LZF1lZUFcu6 LO0t70SQ3K/a1/U/cMVc6iAdSr9/hKJp/cdvO5ExNnGinnPU+3RXzZ33c05vMmjhWRv4 PSIzAa8jdFAzRz98KLnYKz8TEEbe2reEJXacUmQ9g98cvd+nPIxXijvqUmG27fjnPPid e8osPGt5GyhceJmIUwg2OyQGI7IhxxffRjRVZMyZgP8+tdAddEczvwRtYoT474hfTJtb HHmw== X-Gm-Message-State: ALoCoQkFn7abf9ihB5LfDuuUOec/nuZxNgWcn1gAUw2Zp6HqlhHHRW7UJJEH5oRcaNVl53zTji6p0xgxVdPhL/IC9uMDEmms9A== X-Received: by 10.194.103.234 with SMTP id fz10mr6018646wjb.31.1452803029837; Thu, 14 Jan 2016 12:23:49 -0800 (PST) Received: from galloway.idiocy.org (c.6.b.f.c.c.b.1.0.4.a.0.d.a.5.e.9.2.1.8.8.f.3.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:3f8:8129:e5ad:a40:1bcc:fb6c]) by smtp.gmail.com with ESMTPSA id p9sm7524277wjy.41.2016.01.14.12.23.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jan 2016 12:23:49 -0800 (PST) From: Alan J Third To: Bob Rogers Subject: Re: bug#3900: fill-comment-paragraph fails (e.g.) in perl-mode POD In-Reply-To: <19046.35935.750920.221950@rgr.rgrjr.com> (Bob Rogers's message of "Tue, 21 Jul 2009 23:49:51 -0400") References: <19046.35935.750920.221950@rgr.rgrjr.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Date: Thu, 14 Jan 2016 20:22:29 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 3900 Cc: 3900@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: -0.5 (/) Bob Rogers writes: > To reproduce (in trunk or 23.0.96): > > 1. Stuff the following six lines of "code" (two of them blank) into > the "foo.pl" file: > > =head1 Testing > > This is a test case line with lots of stupid text. > This is a test case line with a C<#> and lots of stupid text. > > =cut > > 2. "emacs -Q foo.pl" > > 3. Move the cursor to any point in the fourth line (the one with > "C<#>") and type "M-q". This will produce the following user-unfriendly > error: > > Search failed: "\\(^\\|\\s-\\);?#+ *" Hi, Sorry it's taken so long to respond to your bug report. I can't reproduce this in either Emacs 24.5 or Emacs 25. Can you confirm whether you're still seeing this behaviour in a recent version of Emacs? -- Alan Third From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 15 22:26:18 2016 Received: (at 3900) by debbugs.gnu.org; 16 Jan 2016 03:26:18 +0000 Received: from localhost ([127.0.0.1]:50337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aKHVK-0007tc-C2 for submit@debbugs.gnu.org; Fri, 15 Jan 2016 22:26:18 -0500 Received: from rgrjr.com ([23.92.21.122]:35442) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aKHVI-0007tU-0w for 3900@debbugs.gnu.org; Fri, 15 Jan 2016 22:26:16 -0500 Received: from rgr.rgrjr.com (c-50-177-113-28.hsd1.ma.comcast.net [50.177.113.28]) by rgrjr.com (Postfix on Debian) with ESMTP id 88BBCFB14; Fri, 15 Jan 2016 22:26:14 -0500 (EST) Received: from orion.rgrjr.com (orion.rgrjr.com [10.0.0.51]) by rgr.rgrjr.com (Postfix on openSUSE GNU/Linux) with ESMTP id 62A0AA3A; Fri, 15 Jan 2016 22:26:14 -0500 (EST) Received: by orion.rgrjr.com (Postfix on openSUSE GNU/Linux, from userid 500) id F3B4143F95; Fri, 15 Jan 2016 22:26:21 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <22169.47197.943737.865441@gargle.gargle.HOWL> Date: Fri, 15 Jan 2016 22:26:21 -0500 From: Bob Rogers To: Alan J Third Subject: Re: bug#3900: fill-comment-paragraph fails (e.g.) in perl-mode POD In-Reply-To: References: <19046.35935.750920.221950@rgr.rgrjr.com> X-Mailer: VM 7.19 under Emacs 25.1.50.1 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 3900 Cc: 3900@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: -0.0 (/) From: Alan J Third Date: Thu, 14 Jan 2016 20:22:29 +0000 Hi, Sorry it's taken so long to respond to your bug report. No problem. I can't reproduce this in either Emacs 24.5 or Emacs 25. Can you confirm whether you're still seeing this behaviour in a recent version of Emacs? -- Alan Third Nope; works for me, too. -- Bob From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 16 15:48:24 2016 Received: (at control) by debbugs.gnu.org; 16 Jan 2016 20:48:24 +0000 Received: from localhost ([127.0.0.1]:51205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aKXln-0002aa-UH for submit@debbugs.gnu.org; Sat, 16 Jan 2016 15:48:24 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:33260) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aKXlm-0002aN-KM for control@debbugs.gnu.org; Sat, 16 Jan 2016 15:48:23 -0500 Received: by mail-wm0-f52.google.com with SMTP id 123so9833406wmz.0 for ; Sat, 16 Jan 2016 12:48:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=sender:date:message-id:to:from:subject; bh=PX8vaFHJPL7jTcdZQ6LqtqKn/vZce2nw1vtlNRWwZ0g=; b=yY4/hba9f5gVbtJQbvEmECyAAdbwvzgZaxYXa4xmYo164mKWCJD1k02bufllIrfIrZ vtfsyLW2qK9bHEYf1a9Rn1PGtnHgeoKuFnj2IREMt1wslenazYvI3BI3X/kcCIU9Vo1Z BWCkeiIQRcY5kdKMJMtjkOtWTMqLhzxXbyRgIdn2/oizZ1d3BqEYdMx1XvEVWEY+zaRU vF5krgPuMTbvOe2IN5Kn8izy0iVcxKAAWUgqgfIl/eLlc9XPv7UMugd9bajYGd6nEUGt V22PgENA9yZlr+Y0l7PMn6FoAEzARDAECbLklUQdvl0QMhj7QQ0HrY69x4ohfxDiQFlN edng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:message-id:to:from:subject; bh=PX8vaFHJPL7jTcdZQ6LqtqKn/vZce2nw1vtlNRWwZ0g=; b=Tsk38xNX1vCir1xpqY907hFWNR5FF021HWTsazUHXJF7ngqCsMnC1rw6WUhL8/8Mop 1nTxQdwSTrgVhs1YFwO5Y8eeXGh5UTuMrayFVppNxSj3U/BBR3CtEi4Lug3z1P6P3oJN 76JnL2r5eL2dXZev5jCG0tRWZBkhI1m/d64+q8ZA8jP4nfUBAyfjSQ4oCZoFzog1xcWm eFs3YGDRBUOaBdnIxLnr81pmAY0mys84v1DyFb8eExAxAetzvEcjVbnIXZHDxbkreoFX EsSU4RU6fubAAIr1M5JriXf1lrK7FJSLND+Pe8N/QF5OkQ+BZGENjXUxYd8NePucHlsW +vGA== X-Gm-Message-State: ALoCoQnSClj9hxg8zqT0ck/JraEuwXd8dpzLcVNotzX5PZBnNgu5fxtgPSSUi+RzlJQPKElg2tUQaJW28Lo9udBJnUX7B9s1dg== X-Received: by 10.194.171.66 with SMTP id as2mr16459158wjc.73.1452977296779; Sat, 16 Jan 2016 12:48:16 -0800 (PST) Received: from galloway.idiocy.org (0.9.e.d.9.e.c.9.d.6.d.2.1.4.c.4.9.2.1.8.8.f.3.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:3f8:8129:4c41:2d6d:9ce9:de90]) by smtp.gmail.com with ESMTPSA id y8sm8323608wmg.9.2016.01.16.12.48.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Jan 2016 12:48:16 -0800 (PST) Date: Sat, 16 Jan 2016 20:48:14 +0000 Message-Id: To: control@debbugs.gnu.org From: Alan J Third Subject: control message for bug #3900 X-Spam-Score: -0.5 (/) 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: -0.5 (/) close 3900 24.5 From unknown Tue Jun 17 20:15:29 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 14 Feb 2016 12:24:03 +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