From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#24081: 25.0.95; fill-paragraph in message mode no longer honours line prefixes Date: Tue, 17 Dec 2024 12:05:32 -0500 Message-ID: References: <83oa5jssyx.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8072"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 24081@debbugs.gnu.org, Eli Zaretskii To: James Cloos Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 17 18:06:36 2024 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 1tNb1n-0001uf-C0 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Dec 2024 18:06:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNb1J-0004qz-OD; Tue, 17 Dec 2024 12:06:05 -0500 Original-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 1tNb1G-0004qZ-RO for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2024 12:06:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNb1G-0001bn-J4 for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2024 12:06:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=eiDDQzCc7cuhQg3lccKmxJyznn8vYf9SOddrNzFaJBw=; b=KPl7Y6+y7hGPW8osV0SnAEiOB/tse8Dm6SHqwSJr55iqNIOcEazmYDhAAdDWM7kqIB01TWFeeoHaQH1Rmd7otP8zweRUe4eqE5uP4GxBuxNec5zav7KvRAXP7GlsOpiXvRVJk1uPDoTlaWHVnnNUZMN3IuAAciJeWrS1CVOXDqAuOAsCFuxhw1jVP53ysnLKn2hdk9cjmszU6HY3935vyu+BRltYTOam6GwFDriWHUi2ADp9mTpR7j3iq3v7X7C72eJlFcjttteCjuIk8UA78XpetcdcPtXhHluueE8EWDgXbx8lvRtNs3wWibGwOuLQgazBBVuLfC2nB+Ico4KPgA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tNb1F-0002iB-U1 for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2024 12:06:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Dec 2024 17:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24081 X-GNU-PR-Package: emacs Original-Received: via spool by 24081-submit@debbugs.gnu.org id=B24081.173445515210408 (code B ref 24081); Tue, 17 Dec 2024 17:06:01 +0000 Original-Received: (at 24081) by debbugs.gnu.org; 17 Dec 2024 17:05:52 +0000 Original-Received: from localhost ([127.0.0.1]:60110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNb15-0002hn-5T for submit@debbugs.gnu.org; Tue, 17 Dec 2024 12:05:51 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:41760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNb12-0002ha-O9 for 24081@debbugs.gnu.org; Tue, 17 Dec 2024 12:05:49 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id BD002807FD; Tue, 17 Dec 2024 12:05:42 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1734455141; bh=ryZmkVnBgYAdMMqww/eqwIZjUM+8QBBBN/fyS795dXs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=NC1cP1ApoqQyyzMycRnhe8JvSb18wGMP/k7whKHoNsYQwgKjqSDKfxKZlJc/9CRBF raDOjEjTDrKgIAlUs5Qth3xy7x9jF+oIVkGvpsGXoJDO5uCcLjzN7f/3BHsX9co8ah Cthapz242Thl+Pqa/6y1CWpBk/KuesH3aujnA2OZoByV9rxrZDnU7zp7Whb8eqd62h dSYM6ZUV053c+EVhkhk93Pk1+aldUrH8PiY5vRpQjlQbC5bR/u/rOrQfn9mxhWxyVN O2YVXCPfUwAORP0iF6pJkTC7kGT06HLWgCYf1g2gnM86/ntvXM0l3X3yIRf27k6mOv g7qVT3cduBn+g== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D180D806D1; Tue, 17 Dec 2024 12:05:41 -0500 (EST) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BF23E12047F; Tue, 17 Dec 2024 12:05:41 -0500 (EST) In-Reply-To: (James Cloos's message of "Wed, 27 Jul 2016 00:17:51 -0400") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297308 Archived-At: [ Yes, this is a very old bug. =F0=9F=99=81 ] > JC>> Since I switched from using gnus git to master's internal gnus, I've > JC>> noticed that fill-paragraph in message mode no longer treats the line > JC>> prefixes as a fill-prefix. > > JC>> Due to the other bug I had to downgrade from master to 25.0.95. It, > JC>> too, has this bug. > EZ> Please show a recipe to reproduce this. > Hmm. Interesting. > It does honour prefixes which match the re /^>+ +$/ Yet it uses `mail-citation-prefix-regexp` which is set by default to: "\\([ \t]*\\(\\w\\|[_.]\\)+>+\\|[ \t]*[>|]\\)+" and that "should" match prefixes like the `> JC>>` above (it's even mentioned in the docstring). And indeed refilling >FOO> sdkfjha lkhakd hasdjfh kaf akhf kajdf aksdjfhajk df asdjkfh akdfh >FOO> kadfh akdjfh adkfh akdf hakdfh adjkfh k adfh akdjfh kafh kajfh ka= jfh kadjfh kadjfh kadjfh akjfh akjfh kadfh kajfh kajfh >FOO> kajdfh kadjfh=20 >FOO> akdjfh kadjfh works fine for me. OTOH refilling FOO> sdkfjha lkhakd hasdjfh kaf akhf kajdf aksdjfhajk df asdjkfh akdfh FOO> kadfh akdjfh adkfh akdf hakdfh adjkfh k adfh akdjfh kafh kajfh kaj= fh kadjfh kadjfh kadjfh akjfh akjfh kadfh kajfh kajfh FOO> kajdfh kadjfh=20 FOO> akdjfh kadjfh doesn't (the `FOO>`s are treated as part of the text to be filled rather than as a prefix, so some of them end up in the middle of the text). My impression is that the problem is that the first char on each line is given a syntax-table property of "start comment" which prevents the `\w` in the regexp from matching the `F`. The patch below fixes it for me. Can you check if it also fixes your use cases? Note: There have been some recentish changes/fixes to the regexp handling of `[:word:]` w.r.t syntax-table text properties, so it's possible that the patch doesn't work in Emacs-29, but it should work in Emacs=E2=89=A530 )I t= ested it in Emacs-31). =20 Stefan diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index a720df51d14..acb6a38436e 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -258,7 +258,9 @@ mail-citation-header =20 ;;;###autoload (defcustom mail-citation-prefix-regexp - (purecopy "\\([ \t]*\\(\\w\\|[_.]\\)+>+\\|[ \t]*[>|]\\)+") + ;; Use [[:word:]] rather than \w so we don't get tripped up if one + ;; of those chars has a weird `syntax-table' text property. + (purecopy "\\([ \t]*\\([[:word:]]\\|[_.]\\)+>+\\|[ \t]*[>|]\\)+") "Regular expression to match a citation prefix plus whitespace. It should match whatever sort of citation prefixes you want to handle, with whitespace before and after; it should also match just whitespace.