bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#51459: 29.0.50; org-return and org-return-and-maybe-indent


From: Kévin Le Gouguec
Subject: bug#51459: 29.0.50; org-return and org-return-and-maybe-indent
Date: Thu, 28 Oct 2021 15:40:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

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

> When in init-file
>
> (add-hook 'org-mode-hook (lambda () (electric-indent-mode -1)))
> (setq org-adapt-indentation t)
>
> C-j would indent.
>
> However, IMO doesn't make sense to require these extra config in order
> to get a reasonable behavior.

And everything hinges on what one finds "reasonable".

As discussed in bug#51167, in the wake of electric-indent-mode being
honored in Org 9.4, plenty of people have come to emacs-orgmode to
express that they did not expect RET to indent.  Thus Org maintainers
chose to change the default value of org-adapt-indentation for Org 9.5.

Note that by default (electric-indent-mode t, org-adapt-indentation nil)
RET *does* indent in some specific scenarios, e.g. "- list item RET"
will indent (resp. with electric-indent-mode nil, "- list item C-j"),
because Org assumes that you want to add a paragraph to your list item.

To recap:

- electric-indent-mode is enabled by default in Org, as it is globally
  in Emacs: hence RET indents, C-j does not.

- org-adapt-indentation tells Org whether you want your documents to be
  hard-indented or not: starting with 9.5, they won't be by default.

> When calling C-u RET, get "org--newline: Wrong type argument:
> number-or-marker-p, (4)"

That does look like a bug, however.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]