emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* bug#51167: 29.0.50; org-indent-line broken
       [not found] <541af1a2-d532-13f7-8cf6-6edbfe64fdc1@easy-emacs.de>
@ 2021-10-12 18:35 ` Kévin Le Gouguec
  2021-10-13  6:47   ` Andreas Röhler
  2021-10-13 12:59   ` Max Nikulin
  0 siblings, 2 replies; 8+ messages in thread
From: Kévin Le Gouguec @ 2021-10-12 18:35 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: 51167

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

> With following stuff in org-mode buffer:
>
> * bla
> asd
>
> M-x org-indent-line RET on second line has no effect.

Org 9.5 changed the default value of org-adapt-indentation from t to
nil, as that seemed to be what a lot of users expect[1], so
org-indent-line should not indent the second line in Emacs 28 onward
unless configured otherwise:

- setting org-adapt-indentation back to t will make Org indent by
  inserting whitespace;

- alternatively, enabling org-indent-mode will make Org "soft-indent"
  with text properties.


[1] Org 9.4 made RET and C-j obey electric-indent-mode like they do in
    most other major modes.  Since org-adapt-indentation was t by
    default, this led to many dismayed reports on emacs-orgmode that
    "RET now messes up indentation", indicating that these users did not
    expect their prose to be indented.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51167: 29.0.50; org-indent-line broken
  2021-10-12 18:35 ` bug#51167: 29.0.50; org-indent-line broken Kévin Le Gouguec
@ 2021-10-13  6:47   ` Andreas Röhler
  2021-10-13  7:34     ` Kévin Le Gouguec
  2021-10-13 12:59   ` Max Nikulin
  1 sibling, 1 reply; 8+ messages in thread
From: Andreas Röhler @ 2021-10-13  6:47 UTC (permalink / raw)
  To: Kévin Le Gouguec; +Cc: 51167


On 12.10.21 20:35, Kévin Le Gouguec wrote:
> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>
>> With following stuff in org-mode buffer:
>>
>> * bla
>> asd
>>
>> M-x org-indent-line RET on second line has no effect.
> Org 9.5 changed the default value of org-adapt-indentation from t to
> nil, as that seemed to be what a lot of users expect[1], so
> org-indent-line should not indent the second line in Emacs 28 onward
> unless configured otherwise:
>
> - setting org-adapt-indentation back to t will make Org indent by
>    inserting whitespace;
>
> - alternatively, enabling org-indent-mode will make Org "soft-indent"
>    with text properties.
>
>
> [1] Org 9.4 made RET and C-j obey electric-indent-mode like they do in
>      most other major modes.  Since org-adapt-indentation was t by
>      default, this led to many dismayed reports on emacs-orgmode that
>      "RET now messes up indentation", indicating that these users did not
>      expect their prose to be indented.


Sounds like a chain of confusion.

A command called "indent-line" definitely should indent.

Seems the original coulprit is that unhappy switch of RET and C-j, in 
order to make Emacs "modern".

Maybe make RET RET again?







^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51167: 29.0.50; org-indent-line broken
  2021-10-13  6:47   ` Andreas Röhler
@ 2021-10-13  7:34     ` Kévin Le Gouguec
  2021-10-13  7:48       ` Andreas Röhler
  0 siblings, 1 reply; 8+ messages in thread
From: Kévin Le Gouguec @ 2021-10-13  7:34 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: 51167

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

> Sounds like a chain of confusion.
>
> A command called "indent-line" definitely should indent.

org-indent-line indents just like every indentation function in every
other major mode: if the syntactic convention calls for it, it indents
or de-indents the current line; otherwise it leaves the line untouched.

Or are you saying you would like org-indent-line to also indent "* bla",
because « a command called "indent-line definitely should indent »?

> Seems the original coulprit is that unhappy switch of RET and C-j, in
> order to make Emacs "modern".

"Modern" did not factor in; the goal was to have RET and C-j behave
consistently in all major modes.

> Maybe make RET RET again?

After much discussion on emacs-orgmode, it has been found that a lot of
users expect neither (1) their prose to be indented, nor (2) RET to
indent.

Since electric-indent-mode is enabled globally in Emacs, RET indents
according to the major mode's indentation rules.  Thus it was decided to
change the default value of org-adapt-indentation, to reflect the
expectations of the Org users who took the time to chime in on the
mailing list to describe their workflow and expectations.

If you think the default value should be reverted back to t, I suggest
you make your case on emacs-orgmode.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51167: 29.0.50; org-indent-line broken
  2021-10-13  7:34     ` Kévin Le Gouguec
@ 2021-10-13  7:48       ` Andreas Röhler
  2021-10-13  9:01         ` Kévin Le Gouguec
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Röhler @ 2021-10-13  7:48 UTC (permalink / raw)
  To: Kévin Le Gouguec; +Cc: 51167


On 13.10.21 09:34, Kévin Le Gouguec wrote:
> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>
>> Sounds like a chain of confusion.
>>
>> A command called "indent-line" definitely should indent.
> org-indent-line indents just like every indentation function in every
> other major mode: if the syntactic convention calls for it, it indents
> or de-indents the current line; otherwise it leaves the line untouched.
>
> Or are you saying you would like org-indent-line to also indent "* bla",
> because « a command called "indent-line definitely should indent »?
>
>> Seems the original coulprit is that unhappy switch of RET and C-j, in
>> order to make Emacs "modern".
> "Modern" did not factor in; the goal was to have RET and C-j behave
> consistently in all major modes.

That does not deliver an argument to change the meaning of RET.

BTW the costs of such changes are terribly underestimated in Emacs.

>> Maybe make RET RET again?
> After much discussion on emacs-orgmode, it has been found that a lot of
> users expect neither (1) their prose to be indented, nor (2) RET to
> indent.
>
> Since electric-indent-mode is enabled globally in Emacs,

Which IMO was another mistake.

Preferring a clean editor, which does fancy things only if enabled.

> RET indents
> according to the major mode's indentation rules.  Thus it was decided to
> change the default value of org-adapt-indentation, to reflect the
> expectations of the Org users who took the time to chime in on the
> mailing list to describe their workflow and expectations.
>
> If you think the default value should be reverted back to t, I suggest
> you make your case on emacs-orgmode.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51167: 29.0.50; org-indent-line broken
  2021-10-13  7:48       ` Andreas Röhler
@ 2021-10-13  9:01         ` Kévin Le Gouguec
  0 siblings, 0 replies; 8+ messages in thread
From: Kévin Le Gouguec @ 2021-10-13  9:01 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: 51167

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

> On 13.10.21 09:34, Kévin Le Gouguec wrote:
>>
>> "Modern" did not factor in; the goal was to have RET and C-j behave
>> consistently in all major modes.
>
> That does not deliver an argument to change the meaning of RET.

If there is a compelling argument that justifies RET and C-j behaving
differently in Org wrt other major modes, I haven't heard it yet.

> BTW the costs of such changes are terribly underestimated in Emacs.

AFAICT, the costs of user-facing changes are regularly discussed on the
Emacs development lists, and different developers have different
opinions on how underestimated they are.

In the specific case of RET and C-j, I'd argue (and Org maintainers seem
to have agreed) that the long-term benefits of Org falling in line with
other modes outweigh the short-term costs of annoying long-time users,
especially since they are offered ways to bring back the previous
behaviour (outlined in ORG-NEWS).

And in the specific case of org-adapt-indentation, again, changing the
default to nil was the result of extensive discussion on emacs-orgmode,
where several users explicitly stated that they did not want text to be
indented (neither with RET, C-j, TAB, nor org-indent-line) and never
realized that org-adapt-indentation was t because Org ignored
electric-indent-mode before 9.4.

>> Since electric-indent-mode is enabled globally in Emacs,
>
> Which IMO was another mistake.
>
> Preferring a clean editor, which does fancy things only if enabled.

There are plenty of things Emacs does by default that I personally find
unhelpful; fortunately I can just disable them.  And as long as release
notes point out changes in default behaviour (and how to revert them),
I'm happy with new releases enabling new features.

YMMV 🤷




^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51167: 29.0.50; org-indent-line broken
  2021-10-12 18:35 ` bug#51167: 29.0.50; org-indent-line broken Kévin Le Gouguec
  2021-10-13  6:47   ` Andreas Röhler
@ 2021-10-13 12:59   ` Max Nikulin
  2021-10-16 20:02     ` Andreas Röhler
  1 sibling, 1 reply; 8+ messages in thread
From: Max Nikulin @ 2021-10-13 12:59 UTC (permalink / raw)
  To: 51167

On 13/10/2021 01:35, Kévin Le Gouguec wrote:
> Andreas Röhler writes:
> 
>> With following stuff in org-mode buffer:
>>
>> * bla
>> asd
>>
>> M-x org-indent-line RET on second line has no effect.

Andreas, do the following settings make behavior consistent with you 
expectations?

(add-hook 'org-mode-hook (lambda () (electric-indent-local-mode -1)))
(setq org-adapt-indentation t)

Have in mind that TAB is a rather busy key in Org. Besides indentation 
it is used for fold-reveal cycle for headings, list items, drawers, 
source code blocks and examples.

On 13/10/2021 14:34, Kévin Le Gouguec wrote:
> Or are you saying you would like org-indent-line to also indent "* bla",
> because « a command called "indent-line definitely should indent »?

* Is a heading

   * List item.
     Another line of list item
*
#^---

TAB indents here. However there is no zero indent in the cycle and it 
might be considered as a bug.

On 13/10/2021 13:47, Andreas Röhler wrote:
> Maybe make RET RET again?

Now I am confused if TAB or RET makes you unhappy. `org-indent-line' has 
closer relations with TAB than with RET.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bug#51167: 29.0.50; org-indent-line broken
  2021-10-13 12:59   ` Max Nikulin
@ 2021-10-16 20:02     ` Andreas Röhler
  2021-10-17 15:19       ` Max Nikulin
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Röhler @ 2021-10-16 20:02 UTC (permalink / raw)
  To: emacs-orgmode


On 13.10.21 14:59, Max Nikulin wrote:
> On 13/10/2021 01:35, Kévin Le Gouguec wrote:
>> Andreas Röhler writes:
>>
>>> With following stuff in org-mode buffer:
>>>
>>> * bla
>>> asd
>>>
>>> M-x org-indent-line RET on second line has no effect.
>
> Andreas, do the following settings make behavior consistent with you 
> expectations?
>
> (add-hook 'org-mode-hook (lambda () (electric-indent-local-mode -1)))
> (setq org-adapt-indentation t)


Thanks. That works for me.

Still thinking a command "indent" should indent.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51167: 29.0.50; org-indent-line broken
  2021-10-16 20:02     ` Andreas Röhler
@ 2021-10-17 15:19       ` Max Nikulin
  0 siblings, 0 replies; 8+ messages in thread
From: Max Nikulin @ 2021-10-17 15:19 UTC (permalink / raw)
  To: 51167

close 51167
quit

On 17/10/2021 03:02, Andreas Röhler wrote:
> On 13.10.21 14:59, Max Nikulin wrote:
>> On 13/10/2021 01:35, Kévin Le Gouguec wrote:
>>> Andreas Röhler writes:
>>>
>>>> With following stuff in org-mode buffer:
>>>>
>>>> * bla
>>>> asd
>>>>
>>>> M-x org-indent-line RET on second line has no effect.
>>
>> Andreas, do the following settings make behavior consistent with you 
>> expectations?
>>
>> (add-hook 'org-mode-hook (lambda () (electric-indent-local-mode -1)))
>> (setq org-adapt-indentation t)
> 
> Thanks. That works for me.

So it is not a bug.

> Still thinking a command "indent" should indent.

Such settings are not the best choice for defaults. They are not friendly to
- New users who do not press TAB after each RET, so they later get 
inconsistent indentation after promoting/demoting/refiling headings.
- Users who write long documents where convenience of indented 
paragraphs is disputed. Likely org-indent is better to get visual indent 
without adding spaces in front of every line
- VCS because of promoting or demoting headings results in overblown 
patches.

I do not think that behavior of TAB in Org is deviates from major modes. 
(Side note: sometimes I do not mind to have indent accordingly to my 
taste even if it is not conventional one for particular structure.)





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-10-17 15:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <541af1a2-d532-13f7-8cf6-6edbfe64fdc1@easy-emacs.de>
2021-10-12 18:35 ` bug#51167: 29.0.50; org-indent-line broken Kévin Le Gouguec
2021-10-13  6:47   ` Andreas Röhler
2021-10-13  7:34     ` Kévin Le Gouguec
2021-10-13  7:48       ` Andreas Röhler
2021-10-13  9:01         ` Kévin Le Gouguec
2021-10-13 12:59   ` Max Nikulin
2021-10-16 20:02     ` Andreas Röhler
2021-10-17 15:19       ` Max Nikulin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).