reddit / emacs
(setq org-startup-folded) Does absolutely nothing?
nicestdarkest · 2022-04-20 17:20
Is this option useless?
Any option i set, like, for example: `(setq org-startup-folded "overview")` does absolutely nothing.
I can't change the way Org modes are opened?
Oerm · 2022-04-20 17:41
I am on mobile so I cannot verify this but I *think* that this variable should not be set to a string value; instead, you should quote the value like so:
`(setq org-startup-folded 'overview)`
It also think that you should not use `(setq …)` to set the values of custom variables as this is generally not recommended. In case you use use-package to configure your packages I suggest you add `(org-startup-folded 'overview)` in the `:custom` block of your org config.
publicvoit · 2022-04-20 17:55
I do have `(setq org-startup-folded 'fold)` in my config (since a couple of minutes) and I do have `#+STARTUP: fold` at the top of an Org-mode file. When I close the file and re-open it, everything is shown although "fold" should be a synonym to "overview" according to the documentation.
Interesting to notice, what `C-h v org-startup-folded` shows me:
org-startup-folded is a variable defined in ‘org.el’.
Its value is ‘showeverything’
Local in buffer contacts.org; global value is fold
I found a comment in line 64932 of the 99478 lines where I pasted a comment that mentioned `#+STARTUP: showeverything` in the middle of a list.
After adding a colon in front of that line, the behavior is as desired: after opening, all headings are folded.
So maybe you do have a similar situation?
Visual_Bumblebee_555 · 2022-04-20 18:13
The footnote in [https://orgmode.org/manual/Initial-visibility.html](https://orgmode.org/manual/Initial-visibility.html) might be a hint as to why you are not seeing this value take effect.
nicestdarkest · 2022-04-20 18:48
If i set that value to nil it still doesnt have any effect
Alan_Shutko · 2022-04-20 21:23
Tangential question: why add it in a custom-section of use-package instead of M-x customize-option org-startup-folded and letting custom handle it?
Oerm · 2022-04-20 21:39
That would of course work just as well, thank you for pointing that out. I only mentioned the use-package way because this is how I handle it. As I like to keep my customization in sync with the packages I use I have actually never used `M-x customize-option`. [This post](https://www.reddit.com/r/emacs/comments/js9r52/migrating_to_a_customfileless_setup/) from last year helped me a lot.
Alan_Shutko · 2022-04-20 21:46
Thanks, that makes sense. I haven't switched to use-package, so it seemed like additional typing to me but grouping it with the ones you use makes sense.
yantar92 · 2022-04-20 23:24
> everything is shown although "fold" should be a synonym to "overview" according to the documentation.
Could you point where it is written in the documentation? `'fold` is not a valid value for `org-startup-folded`
publicvoit · 2022-04-21 07:06
Org mode version 9.1.9 (release_9.1.9-65-g5e4542)
```
org-startup-folded is a variable defined in ‘org.el’.
Its value is t
Original value was showeverything
Local in buffer notes.org; global value is fold
Documentation:
Non-nil means entering Org mode will switch to OVERVIEW.
This can also be configured on a per-file basis by adding one of
the following lines anywhere in the buffer:
#+STARTUP: fold (or ‘overview’, this is equivalent)
#+STARTUP: nofold (or ‘showall’, this is equivalent)
#+STARTUP: content
#+STARTUP: showeverything
Set ‘org-agenda-inhibit-startup’ to a non-nil value if you want
to ignore this option when Org opens agenda files for the first
time.
```
Did I misunderstand the text?
yantar92 · 2022-04-21 07:42
Well.. The documentation is indeed confusing. The allowed values of `org-startup-folded` variable are not the same with what you can put into `#+STARTUP:`. You need to go to the source and look at the allowed values.
The documentation can certainly be improved. Feel free to prepare a patch and send it to Org ML ;)
(defcustom org-startup-folded 'showeverything
"Non-nil means entering Org mode will switch to OVERVIEW.
This can also be configured on a per-file basis by adding one of
the following lines anywhere in the buffer:
#+STARTUP: fold (or `overview', this is equivalent)
#+STARTUP: nofold (or `showall', this is equivalent)
#+STARTUP: content
#+STARTUP: show<n>levels (<n> = 2..5)
#+STARTUP: showeverything
Set `org-agenda-inhibit-startup' to a non-nil value if you want
to ignore this option when Org opens agenda files for the first
time."
:group 'org-startup
:package-version '(Org . "9.4")
:type '(choice
(const :tag "nofold: show all" nil)
(const :tag "fold: overview" t)
(const :tag "fold: show two levels" show2levels)
(const :tag "fold: show three levels" show3levels)
(const :tag "fold: show four levels" show4evels)
(const :tag "fold: show five levels" show5levels)
(const :tag "content: all headlines" content)
(const :tag "show everything, even drawers" showeverything)))
TeMPOraL_PL · 2022-04-23 17:00
I'm hoping one of these days, I'll be able to do *the reverse*: use *only* the customization interface, and not write any .emacs / .init.el myself.
This would require some improvements to Customize UX, including in particular the ability to hook up package manager to it. But why not?
Customize has one thing going for it: it provides discoverability. Even though I install and configure things through straight + use-package, I also check `M-x customize-group` for any given new package, because often I discover interesting options there that are not otherwise documented in the package README.