Should we make org-fill-element respect the selected region and not expand the selection to the element boundaties? (was: Bug: org-fill-paragraph [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)])

2022-10-06 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Edrie Ddrie  writes:
>
>> When using `org-fill-paragraph' on a part of a paragraph, e.g. with halve
>> the lines as active region, it still uses the unselected text around when
>> filling.
>> This works different than `fill-paragraph', `fill-region' and
>> `fill-region-as-paragraph' that fill only the selected part of a paragraph
>> WITHOUT effecting the text around.
>> I don't know if this is a real bug but it is confusing, and annoying
>> because org-mode overrides the default `C-q' key binding for
>> `fill-paragraph' so I have to invoke that command via M-x.
>
> Confirmed

While I understand that the current behaviour is unexpected, it is
internally consistent within Org for different kind of Org elements:
paragraphs, source blocks, comments, tables etc. For all the elements,
Org effectively expands the region boundaries to the beginning/end of
the first/last element in the selected region.

If we do decide to change expanding the selection to the element
boundaries, it should be done across all filled element types.

It will also be a breaking change.

Should we go for it?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Bug: org-fill-paragraph [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)]

2021-11-19 Thread Ihor Radchenko
Edrie Ddrie  writes:

> When using `org-fill-paragraph' on a part of a paragraph, e.g. with halve
> the lines as active region, it still uses the unselected text around when
> filling.
> This works different than `fill-paragraph', `fill-region' and
> `fill-region-as-paragraph' that fill only the selected part of a paragraph
> WITHOUT effecting the text around.
> I don't know if this is a real bug but it is confusing, and annoying
> because org-mode overrides the default `C-q' key binding for
> `fill-paragraph' so I have to invoke that command via M-x.

Confirmed

Best,
Ihor



Bug: org-fill-paragraph [9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)]

2021-11-18 Thread Edrie Ddrie
When using `org-fill-paragraph' on a part of a paragraph, e.g. with halve
the lines as active region, it still uses the unselected text around when
filling.
This works different than `fill-paragraph', `fill-region' and
`fill-region-as-paragraph' that fill only the selected part of a paragraph
WITHOUT effecting the text around.
I don't know if this is a real bug but it is confusing, and annoying
because org-mode overrides the default `C-q' key binding for
`fill-paragraph' so I have to invoke that command via M-x.

Emacs  : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5,
cairo version 1.16.0)
 of 2021-02-09, modified by Debian
Package: Org mode version 9.3 (release_9.3 @
/usr/share/emacs/27.1/lisp/org/)