Re: [BUG in org master?]

2021-10-22 Thread Uwe Brauer

> Uwe Brauer  writes:

> Just to make sure I'm not misundertanding: did you try to re-indent the
> whole file?  You say "when I opened my org file in question I still
> saw…", so I'm not sure if you tried to re-indent, or if you merely set
> org-adapt-indentation and expected the file to be automatically
> re-indented after opening it again.

> If the :PROPERTIES: drawer is not indented after doing the following:

> M-: (setq org-adapt-indentation 'headline-data)
> C-x h
> M-: (indent-for-tab-command)

> … then yes, there is a bug.

I did all this and it *did not* indent!

So I shall write a BUG report

> Sure, the reason why it is (now) nil by default is because a fair number
> of users on this list have told Org maintainers that they dislike
> indented text.

> Note that there is a difference between org-adapt-indentation set to t,
> and org-indent-mode:

> - org-adapt-indentation uses *hard* indentation (Emacs inserts
>   whitespace which is written to the file),

> - org-indent-mode uses *soft* or "visual" indentation (Emacs adds text
>   properties to shift the text, but no whitespace is written to the
>   file).


Thanks for clarifying 


smime.p7s
Description: S/MIME cryptographic signature


Re: [BUG in org master?]

2021-10-22 Thread Tim Cross


Uwe Brauer  writes:

> [[S/MIME Signed Part:Undecided]]
>
>> Uwe Brauer  writes:
>
>
>> What is the setting for electric-indent-mode in the org buffer?
>
> ,
> | electric-indent-mode is a variable defined in ‘electric.el’.
> | 
> | Its value is nil
> | Original value was t
> `
>
> Not sure why its original value was t, I don't remember to have used
> that, but I might be mistaken.
>
>
Electric indent mode was set to t in emacs 26 or 25. At the time, org
did not honour the setting of electric indent mode. A lot of the
confusion around changes to indentation and org-adapt-indentation has
arisen due to changes in org mode to make it compatible with other emacs
modes i.e. make it honour the setting of electric-indent-mode. While
I think this was the right move for the long-term as it makes org mode
behave like other modes, I don't think the impact from this change was
fully understood at the time. This has led to considerable confusion and
changes in default settings for org-adapt-indentation to reduce the
friction for users. While the outcome has likely made org mode more
consistent for new users, it has caused some issues for existing users
and it may take some time for the shock waves to dissipate.  
>
>> Also, does org-lint give any warnings about your org file?
>
> No, I just checked.
>
>> The effect of org-adapt-indentation is somewhat confusing to say the
>> least. The effect of that setting is also dependent on the setting for
>> electric-indent-mode. Getting the desired result often depends on having
>> the right setting for both that variable and electric-indent-mode. I've
>> also found that in some cases, if there are errors in your org file (as
>> found by org-lint) then everything can go a bit weird as well.
>
> Very odd, maybe I will turn org-indent-mode on just in this buffer.
>
>

There has been a number of threads about this and org-adapt-indentation
over the last 12 months or so. You might find some help looking through
some of those threads. 



Re: [BUG in org master?]

2021-10-22 Thread Uwe Brauer

> Uwe Brauer  writes:


> What is the setting for electric-indent-mode in the org buffer?

,
| electric-indent-mode is a variable defined in ‘electric.el’.
| 
| Its value is nil
| Original value was t
`

Not sure why its original value was t, I don't remember to have used
that, but I might be mistaken.



> Also, does org-lint give any warnings about your org file?

No, I just checked.

> The effect of org-adapt-indentation is somewhat confusing to say the
> least. The effect of that setting is also dependent on the setting for
> electric-indent-mode. Getting the desired result often depends on having
> the right setting for both that variable and electric-indent-mode. I've
> also found that in some cases, if there are errors in your org file (as
> found by org-lint) then everything can go a bit weird as well.

Very odd, maybe I will turn org-indent-mode on just in this buffer.




smime.p7s
Description: S/MIME cryptographic signature


Re: [BUG in org master?]

2021-10-22 Thread Kévin Le Gouguec
Tim Cross  writes:

> The effect of org-adapt-indentation is somewhat confusing to say the
> least. The effect of that setting is also dependent on the setting for
> electric-indent-mode. Getting the desired result often depends on having
> the right setting for both that variable and electric-indent-mode.

In case that can clear things up:

- org-adapt-indentation dictates what the "canonical" indentation should
  be, i.e. what happens when you select the whole text and M-:
  (indent-for-tab-command):

- nil (default as of 9.5): nothing is indented;
- t (default before 9.5): drawers and text are indented;
- 'headline-data: drawers are indented.

- electric-indent-mode dictates *what key* causes automatic indentation:
- nil: C-j indents, RET does not,
- t: C-j does not indent, RET does.



Re: [BUG in org master?]

2021-10-22 Thread Kévin Le Gouguec
Uwe Brauer  writes:

>> In Org 9.5, setting org-adapt-indentation to 'headline-data makes
>> :DRAWERS: indented (setting it to t makes everything but headlines
>> indented).
>
> Thanks, but it did not work. I set the variable 
> org-adapt-indentation to 'headline-data makes
>
>
> But when I opened my org file in question I still saw
>
> * TODO G1 <2021-10-21 jue 17:10> :H1:G1: Uwe Brauer
> :PROPERTIES:
> :ID:   
> :EMAIL: o...@mat.ucm.es
> :Grp1: G1
> :Usuario1: Uwe Brauer
> :email1: o...@mat.ucm.es
> :Speaker: Uwe
> :End:
>
> Even restarting emacs did not help.
>
> I am running emacs 28 (master)
> 83a915d3dfafd5f3d737afe1e13b75e4dd3aef96
>
> And org master compiled  two days ago.

Just to make sure I'm not misundertanding: did you try to re-indent the
whole file?  You say "when I opened my org file in question I still
saw…", so I'm not sure if you tried to re-indent, or if you merely set
org-adapt-indentation and expected the file to be automatically
re-indented after opening it again.

If the :PROPERTIES: drawer is not indented after doing the following:

M-: (setq org-adapt-indentation 'headline-data)
C-x h
M-: (indent-for-tab-command)

… then yes, there is a bug.

> Setting the variable to t seems to be the same case using
> org-indent-mode, which is usually try to avoid.

Sure, the reason why it is (now) nil by default is because a fair number
of users on this list have told Org maintainers that they dislike
indented text.

Note that there is a difference between org-adapt-indentation set to t,
and org-indent-mode:

- org-adapt-indentation uses *hard* indentation (Emacs inserts
  whitespace which is written to the file),

- org-indent-mode uses *soft* or "visual" indentation (Emacs adds text
  properties to shift the text, but no whitespace is written to the
  file).



Re: [BUG in org master?] (was: how to indent (or refill) properties)

2021-10-22 Thread Tim Cross


Uwe Brauer  writes:

> [[S/MIME Signed Part:Undecided]]
 "KLG" == Kévin Le Gouguec  writes:
>
> Thanks 
>
>> Uwe Brauer  writes:
>>> But I would like them to be indented like this
>>> 
>>> ** DONE G1
>>> :H1:G1:
>>> :PROPERTIES:
>
>> In Org 9.5, setting org-adapt-indentation to 'headline-data makes
>> :DRAWERS: indented (setting it to t makes everything but headlines
>> indented).
>
> Thanks, but it did not work. I set the variable 
> org-adapt-indentation to 'headline-data makes
>
>
> But when I opened my org file in question I still saw
>
> * TODO G1 <2021-10-21 jue 17:10> :H1:G1: Uwe Brauer
> :PROPERTIES:
> :ID:   
> :EMAIL: o...@mat.ucm.es
> :Grp1: G1
> :Usuario1: Uwe Brauer
> :email1: o...@mat.ucm.es
> :Speaker: Uwe
> :End:
>
> Even restarting emacs did not help.
>
> I am running emacs 28 (master)
> 83a915d3dfafd5f3d737afe1e13b75e4dd3aef96
>
> And org master compiled  two days ago.
>
> So is this a BUG?
>
>
>
> Setting the variable to t seems to be the same case using
> org-indent-mode, which is usually try to avoid.
>

What is the setting for electric-indent-mode in the org buffer?

Also, does org-lint give any warnings about your org file?

The effect of org-adapt-indentation is somewhat confusing to say the
least. The effect of that setting is also dependent on the setting for
electric-indent-mode. Getting the desired result often depends on having
the right setting for both that variable and electric-indent-mode. I've
also found that in some cases, if there are errors in your org file (as
found by org-lint) then everything can go a bit weird as well.