unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
Cc: 51459@debbugs.gnu.org
Subject: bug#51459: 29.0.50; org-return and org-return-and-maybe-indent
Date: Thu, 28 Oct 2021 15:40:33 +0200	[thread overview]
Message-ID: <87cznp5ktq.fsf@gmail.com> (raw)
In-Reply-To: <58f0c59d-d634-849b-05d4-e84eae9ab3a3@easy-emacs.de> ("Andreas Röhler"'s message of "Thu, 28 Oct 2021 12:17:26 +0200")

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	other threads:[~2021-10-28 13:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 10:17 bug#51459: 29.0.50; org-return and org-return-and-maybe-indent Andreas Röhler
2021-10-28 13:40 ` Kévin Le Gouguec [this message]
2021-10-28 14:53   ` bug#51459: C-u RET fails with "Wrong type argument" (was: bug#51459: 29.0.50; org-return and org-return-and-maybe-indent) Kévin Le Gouguec
2021-10-28 21:39     ` bug#51459: C-u RET fails with "Wrong type argument" Lars Ingebrigtsen
2021-10-28 17:54   ` bug#51459: 29.0.50; org-return and org-return-and-maybe-indent Andreas Röhler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cznp5ktq.fsf@gmail.com \
    --to=kevin.legouguec@gmail.com \
    --cc=51459@debbugs.gnu.org \
    --cc=andreas.roehler@easy-emacs.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).