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)

Greetings,

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:
https://orgmode.org/manual/Initial-visibility.html

This points me to org-startup-folded, which has documentation here:
https://orgmode.org/manual/In_002dbuffer-Settings.html

#+begin_quote

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.
#+end_quote

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

#+begin_quote
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
#+end_quote

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

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

#+begin_example
* head1
asdf

* head2
asdf
#+end_example

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"?
https://www.reddit.com/r/emacs/comments/izf6xe


Thanks for taking a look,
John


             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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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 \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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