2

I tried C-c C-x p to set property as VISIBILITY and value as folded. The output looks like this:

* Org Headline Description
:PROPERTIES:
:VISIBILITY: folded
:END:

But when I close and reopen the file, this headline still shows up in its full unfolded state. What more do I have to do to open this header in folded state?

p.s.: My emacs version is GNU Emacs 27.1.

Drew
  • 75,699
  • 9
  • 109
  • 225
Inspired_Blue
  • 278
  • 2
  • 12

1 Answers1

2

What is the value of org-startup-folded? I'm guessing it's the default value of showeverything. That's the default in order not to surprise new users ("I added all this stuff to my file and now I can't see it: where did it go?"), but you might want to tweak that.

If you want to keep the global value unchanged, then try adding

#+STARTUP: showall

at the top of the file. See the Initial visibility section of the Org mode manual for other possible values.

Otherwise, do C-h v org-startup-folded, click the Customize button and experiment with the different values.

NickD
  • 27,023
  • 3
  • 23
  • 42
  • Thanks! That worked for me. But how do I set a global value? – Inspired_Blue Sep 10 '22 at 15:01
  • 1
    Read the last sentence in the answer and do what it says. – NickD Sep 10 '22 at 16:55
  • 1
    Done. Thanks. :) – Inspired_Blue Sep 11 '22 at 02:49
  • Alternatively, can also `(setq org-startup-folded 'content)` or `(setq org-startup-folded 'overview)` etc. p.s.: Don't like all the extra comments `custom` adds to the init file. – Inspired_Blue Sep 24 '22 at 13:45
  • 1
    In general, it's safer to use `customize` (and in some cases, it is necessary). I use a separate customization file, as specified by the variable `custom-file`. I then do `(load custom-file)` at the very end of my init file - and I almost never look at the custom file. – NickD Sep 24 '22 at 14:06
  • Ah - that is a neat trick (to set `custom-file` and load it). Indeed, it is safer to use `customize`. For example, I got `overview` spelled wrong once and the whole init file crashed. – Inspired_Blue Sep 24 '22 at 14:52