GNU bug report logs - #68418
refill-mode interferes with org-mode headlines

Previous Next

Package: emacs;

Reported by: Lars Rustand <rustand.lars <at> gmail.com>

Date: Sat, 13 Jan 2024 07:14:02 UTC

Severity: normal

Merged with 52778

Full log


View this message in rfc822 format

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rustand.lars <at> gmail.com, 68418 <at> debbugs.gnu.org, salutis <at> me.com
Subject: bug#68418: refill-mode interferes with org-mode headlines
Date: Sat, 13 Jan 2024 20:11:28 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> `fill-region-as-paragraph' itself is not a problem.
>> The problem is that calling `fill-region-as-paragraph' directly does not
>> make sense in Org buffers - it will break the markup.
>
> You are basically saying that refill-mode makes no sense in Org
> buffers, right?  If fill-region-as-paragraph cannot be factored and/or
> provide hooks for Org to customize it, then Org users should be told
> not to use refill-mode in Org buffers.

No. refill-mode could make use of `fill-paragraph-function' rather than
calling `fill-region-as-paragraph' directly.

Look at the docstring:

(defun refill-fill-paragraph-at (pos &optional arg)
  "Like `fill-paragraph' at POS, but don't delete whitespace at paragraph end."

If `refill-fill-paragraph-at' is "like fill-paragraph", how come it does
not respect `fill-paragraph-function'?
If the goal is to preserve the whitespace at paragraph end, that
whitespace could be stored and re-applied after calling `fill-paragraph'.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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 1 year and 139 days ago.

Previous Next


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