Re: org-adapt-indentation not honored prior to Org 9.4?

2021-03-31 Thread Bastien
Hi,

Kyle Meyer  writes:

> Tim Cross writes:
>
>> 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). 
>
> Thanks for the suggestion.  I'm not sure that it will help, but it's
> easy to do, at least in the Git repo [*], so I've done so in
> d017cdb0a.

Thanks for doing this.

> [*] That of course won't be in effect for the file included with Emacs
> 27.2.  It also won't be at .
> Cc'ing Bastien in case he thinks updating 9.4's Changes.html is
> worth it.

The overall discussion convinced me that `nil' is probably a better
default for `org-adapt-indentation' (instead of `t') so I suggest we
wait for the 9.5 changelog to promote these clarifications.  

(I generally don't like the idea of revising the changelog after the
release even if we had and may well accept exceptions.)

-- 
 Bastien



Re: org-adapt-indentation not honored prior to Org 9.4?

2021-03-30 Thread Kyle Meyer
Tim Cross writes:

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

Thanks for the suggestion.  I'm not sure that it will help, but it's
easy to do, at least in the Git repo [*], so I've done so in d017cdb0a.

[*] That of course won't be in effect for the file included with Emacs
27.2.  It also won't be at .
Cc'ing Bastien in case he thinks updating 9.4's Changes.html is
worth it.



Re: org-adapt-indentation not honored prior to Org 9.4?

2021-03-29 Thread Tim Cross


Kyle Meyer  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



Re: org-adapt-indentation not honored prior to Org 9.4?

2021-03-29 Thread Kyle Meyer
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:

--8<---cut here---start->8---
*** =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=.
--8<---cut here---end--->8---



Re: org-adapt-indentation not honored prior to Org 9.4?

2021-03-24 Thread Maxim Nikulin

On 24/03/2021 21:08, TRS-80 wrote:

On 2021-03-22 15:37, Mike Kupfer wrote:

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.


You are not alone, mate.  We discussed this not too long ago in the
following thread:


There were at least one similar thread before and a discussion prior to 
the change.


The following setting was never mentioned however:
org-indent-mode-turns-off-org-adapt-indentation




Re: org-adapt-indentation not honored prior to Org 9.4?

2021-03-24 Thread TRS-80

On 2021-03-22 15:37, Mike Kupfer wrote:

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.

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?  Could the change in behavior
be documented in the ORG-NEWS file in Emacs?

I already asked about this on emacs-devel; Eli Z. sent me over here.

thanks,
mike


You are not alone, mate.  We discussed this not too long ago in the
following thread:

Turning off all indentation in 9.4.4
https://lists.gnu.org/archive/html/emacs-orgmode/2021-02/msg00045.html

In particular, the answer you seek may be in this post:

https://lists.gnu.org/archive/html/emacs-orgmode/2021-02/msg00285.html

The TL; DR of which is to turn off ~electric-indent-local-mode~ in
org-mode:

#+begin_src emacs-lisp
  (add-hook 'org-mode-hook (lambda () (electric-indent-local-mode -1)))
#+end_src

Of course, you could test live first in an Org buffer by pressing M-:
and eval:

#+begin_src emacs-lisp
  (electric-indent-local-mode -1)
#+end_src

If that does what you expect, then set up the above mode hook in your
init file.

If your expectations are slightly different to mine, hopefully there
is something in that thread that might be helpful for you.

Cheers,
TRS-80



org-adapt-indentation not honored prior to Org 9.4?

2021-03-24 Thread Mike Kupfer
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.

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?  Could the change in behavior be documented in the ORG-NEWS
file in Emacs?

I already asked about this on emacs-devel; Eli Z. sent me over here.

thanks,
mike