After I upgraded to Org Mode 9.4.5, I learned about the startup option hideblocks
, but it won't work as advertised for me.
OK, when I start emacs with the flag -Q
, it did, so I went hunting for culprits in my .emacs
. All suspicious-looking settings and packages have been removed, but hideblocks
still doesn't work.
Oddly enough, when I visit a test file with #+STARTUP: hideblocks
, the variable org-hide-block-startup
do indeed change from nil
, which is default, to t
. Despite this, the block remains unfolded!
I can make all blocks fold on start-up, if I set org-hide-block-startup
with a local variables section at the end of the file, but I consider that to be an ugly, last resort solution.
Is there a smart way of tracking down when and where the hideblock setting is reversed, intercepted, toggled, or whatever happens?
Addendum April 4:
Since writing the above, I stumbled upon one additional interesting symptom. When I was led astray with the theory that my Org Mode installation was somehow faulty, I took a look at the installation instructions in the info documentation. Among other things, it says the following about an org mode installation with elpa:
Important: You need to do this in a session where no ‘.org’ file has been visited, i.e., where no Org built-in function have been loaded. Otherwise autoload Org functions will mess up the installation.
So I did M-x list-packages
, threw out org mode, restarted Emacs, installed org mode anew, and visited my test file.
Lo and behold, my block was folded at start-up.
However, the effect was short-lasting, and trying to open the same file later did not work as expected.
emacs -Q
the bisect your init file till you've narrowed it down to just what's causing the problem. You can usecomment-region
to bisect it.org-hide-block-startup
in the first place? Did youcustomize
the variable?#+STARTUP hideblocks
. (As I wrote above, settingorg-hide-block-startup
in a local variables section at the end of the file, the blocks start folded. I do not like this workaround, however.)comment-region
to comment out 1/2, then 3/4, 7/8, 15/16, 31/32,... till you find exactly what, in your init file, is the culprit. PlainC-u
withcomment-region
uncomments.