emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Hendy <jw.hendy@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Clarification on org-startup-fold behavior vs. docs
Date: Tue, 19 Oct 2021 11:58:39 -0500	[thread overview]
Message-ID: <CA+M2ft-FmeL6LMiyBgUgmzf27=w6Ge_h0s+9A2LEb2aq0jYV1Q@mail.gmail.com> (raw)


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,

             reply	other threads:[~2021-10-19 17:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 16:58 John Hendy [this message]
2021-10-19 17:29 ` Clarification on org-startup-fold behavior vs. docs Ihor Radchenko
2021-10-19 18:23   ` John Hendy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+M2ft-FmeL6LMiyBgUgmzf27=w6Ge_h0s+9A2LEb2aq0jYV1Q@mail.gmail.com' \
    --to=jw.hendy@gmail.com \
    --cc=emacs-orgmode@gnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).