emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Clarification on org-startup-fold behavior vs. docs
@ 2021-10-19 16:58 John Hendy
  2021-10-19 17:29 ` Ihor Radchenko
  0 siblings, 1 reply; 3+ messages in thread
From: John Hendy @ 2021-10-19 16:58 UTC (permalink / raw)
  To: emacs-orgmode


I was surprised to open a file and find it in a fully expanded state.
I took a moment to try and figure out what one should do on a global
level. I searched "orgmode startup folded" and got here:

This points me to org-startup-folded, which has documentation here:


The first set of options deals with the initial visibility of the
outline tree. The corresponding variable for global default settings
is org-startup-folded with a default value of showeverything.

‘overview’ Top-level headlines only.
‘content’ All headlines.
‘showall’ No folding on any entry.
‘show2levels’ Headline levels 1-2.
‘show3levels’ Headline levels 1-3.
‘show4levels’ Headline levels 1-4.
‘show5levels’ Headline levels 1-5.
‘showeverything’ Show even drawer contents.

In addition, M-x customize-variable for org-startup-folded says:

org-startup-folded: "overview"
    State : CHANGED outside Customize. (mismatch)
   Non-nil means entering Org mode will switch to OVERVIEW. Hide

   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

Using the following min-config, I am unable to get a file to open in
folded state:

(add-to-list 'load-path "~/.elisp/org/lisp/")
(add-to-list 'load-path "~/.elisp/org/contrib/lisp/")
(setq org-startup-folded "overview")

* head1

* head2

With emacs -Q and M-x load-file path/to/min-config, it opens expanded
with either of these:
(setq org-startup-folded "fold")
(setq org-startup-folded "overview")

This does work:
(setq org-startup-folded t)

Is this the fact that I still don't really understand emacs inner
workings/elisp... or am I sane in feeling that the documentation and
behavior is not intuitive?

Interestingly this reddit thread poses the exact same question, yet
one user thinks this is completely expected? That said, he/she both
says "non-nil" and therefore `t` works... but not why "overview" or
"fold" are also not equivalent to "non-nil"?

Thanks for taking a look,

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-19 18:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19 16:58 Clarification on org-startup-fold behavior vs. docs John Hendy
2021-10-19 17:29 ` Ihor Radchenko
2021-10-19 18:23   ` John Hendy

Code repositories for project(s) associated with this public inbox


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