all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#51167: 29.0.50; org-indent-line broken
@ 2021-10-12 16:49 Andreas Röhler
  2021-10-12 18:35 ` Kévin Le Gouguec
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Röhler @ 2021-10-12 16:49 UTC (permalink / raw)
  To: 51167


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






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

* bug#51167: 29.0.50; org-indent-line broken
  2021-10-12 16:49 bug#51167: 29.0.50; org-indent-line broken Andreas Röhler
@ 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; 9+ 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] 9+ messages in thread

* bug#51167: 29.0.50; org-indent-line broken
  2021-10-12 18:35 ` 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ messages in thread

* bug#51167: 29.0.50; org-indent-line broken
  2021-10-12 18:35 ` 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ messages in thread

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

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-12 16:49 bug#51167: 29.0.50; org-indent-line broken Andreas Röhler
2021-10-12 18:35 ` 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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.