emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: org-adapt-indentation not honored prior to Org 9.4?
Date: Tue, 30 Mar 2021 15:21:55 +1100	[thread overview]
Message-ID: <87pmzhi7wp.fsf@gmail.com> (raw)
In-Reply-To: <87tuot2tv7.fsf@kyleam.com>


Kyle Meyer <kyle@kyleam.com> writes:

> Mike Kupfer writes:
>
>> Over the weekend I upgraded my Emacs from 27.1 (Org 9.3) to 27.2-rc2
>> (Org 9.4).  I noticed that Org mode behaves differently, even with
>> "emacs -Q".
>>
>> In 27.1, if I visit foo.org and type "* header RET", point is put in the
>> first column.  In 27.2, point is put in column 3.
>>
>> AFAIK, I'm not using electric-indent-mode; at least it's not shown in
>> the minor mode list in the modeline.
>
> electric-indent-mode has been enabled by default since Emacs 24.  If you
> run `C-h v electric-indent-mode` under emacs -Q, you should see that its
> value is t.
>
>> org-adapt-indentation is t in both Emacs 27.1 and Emacs 27.2.  Was there
>> a bug fix that went into Org 9.4 such that org-adapt-indentation is now
>> honored?
>
> Not that I'm aware of.  However, Org was changed to respect the
> electric-indent-mode value: d3e6b5800 (Make RET and C-j obey
> `electric-indent-mode', 2020-05-05)
>
> https://orgmode.org/list/877dxpazbo.fsf_-_@gmail.com/T/#u
>
>> Could the change in behavior be documented in the ORG-NEWS
>> file in Emacs?
>
> Here's what ORG-NEWS says under the 9.4 release:
>
> *** =RET= and =C-j= now obey ~electric-indent-mode~
>
> Since Emacs 24.4, ~electric-indent-mode~ is enabled by default.  In
> most major modes, this causes =RET= to reindent the current line and
> indent the new line, and =C-j= to insert a newline without indenting.
>
> Org mode now obeys this minor mode: when ~electric-indent-mode~ is
> enabled, and point is neither in a table nor on a timestamp or a link:
>
> - =RET= (bound to ~org-return~) reindents the current line and indents
>   the new line;
> - =C-j= (bound to the new command ~org-return-and-maybe-indent~)
>   merely inserts a newline.
>
> To get the previous behaviour back, disable ~electric-indent-mode~
> explicitly:
>
> #+begin_src emacs-lisp
> (add-hook 'org-mode-hook (lambda () (electric-indent-local-mode -1)))
> #+end_src
>
> Alternatively, if you wish to keep =RET= as the "smart-return" key,
> but dislike Org's default indentation of sections, you may prefer to
> customize ~org-adapt-indentation~ to either =nil= or ='headline-data=.

Hi Kyle,

one thing I think might help (maybe too late) would be to put the
entries for both electric-indent-mode and org-adapt-indentation so that
they are together in the release notes as they do interact with each
other and often people stop looking once they see one and not the other
(they are currently a fair 'distance' apart in the file). 

I suspect we will see a few of these as the changes an interaction
between those two things are not terribly intuitive.

-- 
Tim Cross


  reply	other threads:[~2021-03-30  4:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22 19:37 Mike Kupfer
2021-03-24 14:08 ` TRS-80
2021-03-24 14:45   ` Maxim Nikulin
2021-03-30  3:38 ` Kyle Meyer
2021-03-30  4:21   ` Tim Cross [this message]
2021-03-31  4:14     ` Kyle Meyer
2021-03-31  8:53       ` Bastien

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.orgmode.org/

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

  git send-email \
    --in-reply-to=87pmzhi7wp.fsf@gmail.com \
    --to=theophilusx@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: org-adapt-indentation not honored prior to Org 9.4?' \
    /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

Code repositories for project(s) associated with this 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).