Sean Whitton <[email protected]> writes: > Augusto Stoffel [14/May 10:18am +02] wrote: >> Not sure this is a bug in Emacs or Org, but I noticed that in org-mode, >> if at the very end of a paragraph (looking-at-p "\n\n."), then >> unfill-paragraph doesn't do anything. > > It looks like this is because fill-forward-paragraph behaves > unexpectedly in Org mode buffers. unfill-paragraph expects that calling > fill-forward-paragraph when at the very end of a paragraph will move > point to between that paragraph and the next, but in your example, point > goes one paragraph too far forwards. > > I.e. this is a bug in org-forward-paragraph, not unfill-paragraph, I > think.
I think it is both. unfill-paragraph ignores Org mode-specific fill-paragraph-function, directly calling fill-region. I think it is a bug on Emacs side. There is also a bug in org-forward-paragraph when point is at the end of the last non-empty line. Now fixed, on main. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=4a8e19faa -- 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>
