Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default for org-adapt-indentation has changed in Org 9.5 #884

Open
schoettl opened this issue Jul 13, 2022 · 5 comments
Open

Default for org-adapt-indentation has changed in Org 9.5 #884

schoettl opened this issue Jul 13, 2022 · 5 comments

Comments

@schoettl
Copy link
Collaborator

schoettl commented Jul 13, 2022

This is intended behavior, since this is the default Emacs Org mode indentation style.

Since Org 9.5, the default value of org-adapt-indentation has changed to nil. So now, the Org mode default is to not indent anything (including drawers). In Org 9.4 the default was t (indent everything, including text).

I just wanted to bring this to attention. For now, I have not enough time to learn JavaScript to work on it.

Originally posted by @whxvd in #121 (comment)

Thanks for bringing this up. I hated the auto-indent and I'm glad the default is now nil! It was really bad for version control.

Reference: https://orgmode.org/Changes.html

@munen I'd quickly fix the default but I can't find it. The closest thing is here:

./src/util/settings_persister.js:160:    name: 'shouldNotIndentOnExport',

but this specific option has no default key like some of the others.

@schoettl schoettl changed the title Default for indentation has changed in Org 9.5 Default for org-adapt-indentation has changed in Org 9.5 Jul 13, 2022
@schoettl
Copy link
Collaborator Author

I guess because shouldNotIndentOnExport has no default defined, it defaults to false => indentation.

I just got the case again where a new colleague messed up whitespaces in our shared org files with organice.

@munen Is it alright when we catch up with org-mode now, and set the default to true? I can provide a PR.

@munen
Copy link
Collaborator

munen commented Oct 21, 2022

Hi @schoettl,

I'm in favor of configuring defaults in the organice settings the same as for Emacs Org mode. It is my understanding from https://orgmode.org/Changes.html that the default is nil for org-adapt-indentation since Org mode 9.5. I double checked with a clean install of Emacs and Org mode 9.5.2 which confirms it:

image

Still, I understand your use-case. You want all team members to conform to the same defaults. Maybe we could add a new feature 'team profile'. I'm just thinking aloud here. It could be a link to a remote .organice-config.json file. It could either provide other defaults or completely override the users file (super corporate style).

What do you think?

Kind regards,
Alain

@schoettl
Copy link
Collaborator Author

schoettl commented Oct 21, 2022

I think this is a misunderstanding:

  • if org-adapt-indentation is t, the indentation level is adapted. But it's now nil by default.
  • if shouldNotIndentOnExport is true, it does not adapt the indentation level.

So my understanding is that these options are inverted in Org and organice.

Regarding the .organice-config.json, I have some problems with it (#895).

@munen
Copy link
Collaborator

munen commented Oct 21, 2022 via email

@schoettl
Copy link
Collaborator Author

Hm, I don't quite understand. Yes, there is the difference between Org and organice that you described (apart from the inversion).

Fixing organice to adapt indentation only for new text would be more work. I can't do that and I'd rather keep organice's behaviour but align with Org's default.

Changing the default and renaming the option to align with Org would need a migration strategy, I think, because user that currently have indentation enabled probably want to keep this.

Is there a problem when we only change the default? Current users have organice config files so they wouldn't be affected as long as they don't delete the config or start a new Dropbox. I think that would be acceptable.

New users would get "a sane default".

Note that in organice, shouldNotIndentOnExport (and dontIndent) always adjust indentation, it does not keep original indentation. Example:

    contents += `${indentation}:PROPERTIES:\n`;
    contents += `${propertyListItemsContent}\n`;
    contents += `${indentation}:END:\n`;

We could change the UI to invert the option. But I'm not sure if it's worth to rename the option internally and write a migration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants