GNU bug report logs - #78561
[PATCH] Add semantic linefeed support for paragraph filling

Previous Next

Package: emacs;

Reported by: Roi Martin <jroi.martin <at> gmail.com>

Date: Fri, 23 May 2025 09:59:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #127 received at 78561 <at> debbugs.gnu.org (full text, mbox):

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: eliz <at> gnu.org, Roi Martin <jroi.martin <at> gmail.com>, 78561 <at> debbugs.gnu.org,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#78561: [PATCH] Add semantic linefeed support for paragraph
 filling
Date: Sat, 21 Jun 2025 05:03:22 +0000
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> Yes. More specifically, when region is active, `fill-paragraph'
>> completely ignores `fill-paragraph-function' and directly calls
>> `fill-region' -> `fill-region-as-paragraph'. This behavior cannot be
>> customized by major modes,
>
> Some of the behavior can, via `fill-paragraph-forward-function`.
> And with Roi's `fill-region-as-paragraph-function`, Emacs-31 should
> allow customizing a bit more of the behavior.
>
> It would be nice to make it customizable enough that Org doesn't need to
> override the `M-q` binding.

I think that `fill-region-as-paragraph-function' is a step in the right
direction. What is left is handling `use-hard-newlines'. Currently, Org
mode ignores it as the concept of hard newlines is not compatible with
Org mode syntax and its notion of paragraphs. So, we probably need to
have a way to bypass that branch in `fill-paragraph' or find some way to
handle hard newlines that is compatible with Org mode and then Emacs
introduce a new customization for Org to plug into.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




This bug report was last modified 19 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.