bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#68418: refill-mode interferes with org-mode headlines


From: Ihor Radchenko
Subject: bug#68418: refill-mode interferes with org-mode headlines
Date: Sat, 13 Jan 2024 19:13:56 +0000

Eli Zaretskii <eliz@gnu.org> writes:

>> > Is it possible to fix that by some improvements to
>> > fill-forward-paragraph-function used by Org?
>> 
>> I doubt so. The only idea that is coming to my mind is to make Org
>> mode's `fill-forward-paragraph-function' not move anywhere when not on
>> paragraph - this will prevent refill-mode from filling anything but Org
>> paragraphs.
>
> Is the problem in your example what fill-forward-paragraph-function
> does, or is the problem elsewhere in refill-fill-paragraph-at and/or
> refill-post-command-function?  IOW, can you tell which part(s) of
> refill.el fail to DTRT in an Org buffer?  I don't know enough about
> all the peculiarities of the Org format to tell what should be fixed
> in that case, let alone how.

AFAIU, the problem is in

(if use-hard-newlines
                    (fill-region oend end arg)
                  (fill-region-as-paragraph oend end arg))

Both `fill-region' and `fill-region-as-paragraph' do not respect
`fill-paragraph-function' and always act the same once the region
boundaries are identified regardless of the major mode.

`fill-region-as-paragraph' does not respect it as per docstring and
refill mode should probably not call `fill-region-as-paragraph'. The
branching for `use-hard-newlines' should belong to text-mode, IMHO.

`fill-region' does not respect `fill-paragraph-function' for the reasons
I do not understand.

-- 
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>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]