From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#68418: refill-mode interferes with org-mode headlines Date: Sat, 13 Jan 2024 15:43:22 +0200 Message-ID: <835xzxgxhh.fsf@gnu.org> References: <87il3yqmkl.fsf@gmail.com> <83le8thchr.fsf@gnu.org> <87mst9uzv3.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10523"; mail-complaints-to="usenet@ciao.gmane.io" Cc: salutis@me.com, 68418@debbugs.gnu.org, rustand.lars@gmail.com To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 13 14:45:39 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 1rOeKQ-0002WV-R6 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Jan 2024 14:45:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOeJu-0000Wb-Oq; Sat, 13 Jan 2024 08:45:06 -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 1rOeJs-0000WM-Ee for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 08:45:04 -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 1rOeJs-0003e7-4J for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 08:45:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rOeJq-0007jj-Ao for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 08:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jan 2024 13:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68418 X-GNU-PR-Package: emacs Original-Received: via spool by 68418-submit@debbugs.gnu.org id=B68418.170515344929651 (code B ref 68418); Sat, 13 Jan 2024 13:45:02 +0000 Original-Received: (at 68418) by debbugs.gnu.org; 13 Jan 2024 13:44:09 +0000 Original-Received: from localhost ([127.0.0.1]:38755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOeIz-0007iB-1K for submit@debbugs.gnu.org; Sat, 13 Jan 2024 08:44:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOeIw-0007ha-J0 for 68418@debbugs.gnu.org; Sat, 13 Jan 2024 08:44:07 -0500 Original-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 1rOeIr-00033s-4F; Sat, 13 Jan 2024 08:44:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=GaqyxvTBSxfMa7lFXROmQFO0+kuXujxU9M6vjcGRm/Y=; b=MxWW+zpPfQiu6TiuzRTI dWdNdyv+i3HmXSZ8wKLwKdqLzoQfiSj/TlIjAM6GcoDkm97jsPVVRdgqAYpE5qCig4AUpRM4g2Xeb QH6ZG0NrOHaz4Yn6fMWklSls5jlETnhIB8D/MejUK7BR84XbZyzUH5Rq80lNZ1OVL9XMslFBA/pnC umcZm+hA2vk89T5ptxqkb98DsKDzvvCLdrtX7za7n/I3DBjYLysf049zichSYAK6do/8HibVxGH0z Pk6wVQLbuzF50TEE4MgD+Oldr75TYMWanpvnMAhtCN8sEwOU4dHr2mZp33+PbnYWTLsoh1rCc2oRb VvW5V0mBFHlpmg==; In-Reply-To: <87mst9uzv3.fsf@localhost> (message from Ihor Radchenko on Sat, 13 Jan 2024 13:28:16 +0000) 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:278125 Archived-At: > From: Ihor Radchenko > Cc: Lars Rustand , Rudolf Adamkovič > , 68418@debbugs.gnu.org > Date: Sat, 13 Jan 2024 13:28:16 +0000 > > This is a bit tangent, but the current design of filling feels chaotic - > we have configurable fill-paragraph-function and > fill-forward-paragraph-function, while `fill-region-as-paragraph' is > hard-coded. And forward-paragraph relies upon regexps... > > It looks like the notion of paragraph when filling is designed to be > different compared to the notion of paragraph in `forward-paragraph'. > Is there any reason for such difference? I don't know. > This looks like an improvement. Also, it appears to fix the original > reproducer. > > However, there will still be a problem, even with the proposed patch, in > the following scenario: > > 1. emacs -Q > 2. Open a new org file > * Heading :tag: > 3. M-x refill-mode > 4. Keep typing > * Heading alksjd alkjasd asldkj asdlkj aslldkj aslkdj asldkj > asldkj :tag: > > See how the heading is split into multiple lines. > > This happens because refill-mode uses `fill-region-as-paragraph', which > is impossible to configure by major modes. > As the above example demonstrates, not everything is safe to fill > without breaking the markup. > > A similar problem appears in `fill-region' - it completely disregards > `fill-paragraph-function' and always calls `fill-region-as-paragraph'. So you think the patch I posted should not be installed, and we should wait for a more thorough solution?