GNU bug report logs - #51167
29.0.50; org-indent-line broken

Previous Next

Package: org-mode;

Reported by: Andreas Röhler <andreas.roehler <at> easy-emacs.de>

Date: Tue, 12 Oct 2021 16:50:02 UTC

Severity: normal

Done: Max Nikulin <manikulin <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51167 in the body.
You can then email your comments to 51167 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#51167; Package emacs. (Tue, 12 Oct 2021 16:50:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Röhler <andreas.roehler <at> easy-emacs.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 12 Oct 2021 16:50:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; org-indent-line broken
Date: Tue, 12 Oct 2021 18:49:36 +0200
With following stuff in org-mode buffer:

* bla
asd

M-x org-indent-line RET on second line has no effect.

In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 
3.24.25, cairo version 1.16.0)
 of 2021-10-12
Repository revision: 7e185bc9bae85ac3b50f9b7bd4b3c33bb8a016a8
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101001
System Description: Ubuntu 21.04

Configured using:
 'configure --with-json -with-modules --with-mailutils'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBOTF LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3
ZLIB

Important settings:
  value of $LC_MONETARY: de_DE.UTF-8
  value of $LC_NUMERIC: de_DE.UTF-8
  value of $LC_TIME: de_DE.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Org

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail shortdoc help-fns radix-tree
org-element avl-tree generator ol-eww eww xdg url-queue thingatpt mm-url
ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-search eieio-opt
cl-extra help-mode speedbar ezimage dframe gnus-art mm-uu mml2015
mm-view mml-smime smime dig gnus-sum shr kinsoku svg dom browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util url-parse url-vars mailcap gnus-group gnus-undo
gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7
netrc nnoo parse-time gnus-spec gnus-int gnus-range message rmc puny
rfc822 mml mml-sec epa derived epg rfc6068 epg-config mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
gnus-win gnus nnheader gnus-util rmail rmail-loaddefs auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json map rfc2047
rfc2045 ietf-drums text-property-search mail-utils mm-util mail-prsvr
wid-edit ol-docview doc-view jka-compr image-mode exif dired
dired-loaddefs ol-bibtex bibtex iso8601 ol-bbdb ol-w3m ol-doi
org-link-doi org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-footnote org-src ob-comint org-pcomplete pcomplete comint ansi-color
ring org-list org-faces org-entities time-date noutline outline
easy-mmode org-version ob-emacs-lisp ob-core ob-eval org-table ol rx
org-keys oc seq gv subr-x byte-opt bytecomp byte-compile cconv
org-compat advice org-macs org-loaddefs format-spec find-func cal-menu
calendar cal-loaddefs cl-loaddefs cl-lib iso-transl tooltip eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
button loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 275083 20007)
 (symbols 48 43076 1)
 (strings 32 115362 3554)
 (string-bytes 1 2702402)
 (vectors 16 37614)
 (vector-slots 8 413285 24472)
 (floats 8 294 121)
 (intervals 56 377 0)
 (buffers 992 13))





bug reassigned from package 'emacs' to 'org-mode'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 12 Oct 2021 17:02:02 GMT) Full text and rfc822 format available.

bug No longer marked as found in versions 29.0.50. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 12 Oct 2021 17:02:02 GMT) Full text and rfc822 format available.

Information forwarded to emacs-orgmode <at> gnu.org:
bug#51167; Package org-mode. (Tue, 12 Oct 2021 18:36:02 GMT) Full text and rfc822 format available.

Message #12 received at 51167 <at> debbugs.gnu.org (full text, mbox):

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
Cc: 51167 <at> debbugs.gnu.org
Subject: Re: bug#51167: 29.0.50; org-indent-line broken
Date: Tue, 12 Oct 2021 20:35:42 +0200
Andreas Röhler <andreas.roehler <at> 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.




Information forwarded to emacs-orgmode <at> gnu.org:
bug#51167; Package org-mode. (Wed, 13 Oct 2021 06:48:02 GMT) Full text and rfc822 format available.

Message #15 received at 51167 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
Cc: 51167 <at> debbugs.gnu.org
Subject: Re: bug#51167: 29.0.50; org-indent-line broken
Date: Wed, 13 Oct 2021 08:47:16 +0200
On 12.10.21 20:35, Kévin Le Gouguec wrote:
> Andreas Röhler <andreas.roehler <at> 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?







Information forwarded to emacs-orgmode <at> gnu.org:
bug#51167; Package org-mode. (Wed, 13 Oct 2021 07:35:02 GMT) Full text and rfc822 format available.

Message #18 received at 51167 <at> debbugs.gnu.org (full text, mbox):

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
Cc: 51167 <at> debbugs.gnu.org
Subject: Re: bug#51167: 29.0.50; org-indent-line broken
Date: Wed, 13 Oct 2021 09:34:27 +0200
Andreas Röhler <andreas.roehler <at> 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.




Information forwarded to emacs-orgmode <at> gnu.org:
bug#51167; Package org-mode. (Wed, 13 Oct 2021 07:50:01 GMT) Full text and rfc822 format available.

Message #21 received at 51167 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
Cc: 51167 <at> debbugs.gnu.org
Subject: Re: bug#51167: 29.0.50; org-indent-line broken
Date: Wed, 13 Oct 2021 09:48:55 +0200
On 13.10.21 09:34, Kévin Le Gouguec wrote:
> Andreas Röhler <andreas.roehler <at> 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.




Information forwarded to emacs-orgmode <at> gnu.org:
bug#51167; Package org-mode. (Wed, 13 Oct 2021 09:02:02 GMT) Full text and rfc822 format available.

Message #24 received at 51167 <at> debbugs.gnu.org (full text, mbox):

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
Cc: 51167 <at> debbugs.gnu.org
Subject: Re: bug#51167: 29.0.50; org-indent-line broken
Date: Wed, 13 Oct 2021 11:01:01 +0200
Andreas Röhler <andreas.roehler <at> 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 🤷




Information forwarded to emacs-orgmode <at> gnu.org:
bug#51167; Package org-mode. (Wed, 13 Oct 2021 13:00:03 GMT) Full text and rfc822 format available.

Message #27 received at 51167 <at> debbugs.gnu.org (full text, mbox):

From: Max Nikulin <manikulin <at> gmail.com>
To: 51167 <at> debbugs.gnu.org
Subject: Re: bug#51167: 29.0.50; org-indent-line broken
Date: Wed, 13 Oct 2021 19:59:42 +0700
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.




Information forwarded to emacs-orgmode <at> gnu.org:
bug#51167; Package org-mode. (Sun, 17 Oct 2021 15:21:02 GMT) Full text and rfc822 format available.

Message #30 received at 51167 <at> debbugs.gnu.org (full text, mbox):

From: Max Nikulin <manikulin <at> gmail.com>
To: 51167 <at> debbugs.gnu.org
Subject: Re: bug#51167: 29.0.50; org-indent-line broken
Date: Sun, 17 Oct 2021 22:19:59 +0700
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.)





bug closed, send any further explanations to 51167 <at> debbugs.gnu.org and Andreas Röhler <andreas.roehler <at> easy-emacs.de> Request was from Max Nikulin <manikulin <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 17 Oct 2021 15:55:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 15 Nov 2021 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 163 days ago.

Previous Next


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