1
votes

In emacs, org-mode has been enabled and have opened some *.org files. Now in the init.el file i am trying to enable the outline-minor-mode in order to fold the lines starting with ";" . When i try to evaluate the (outline-minor-mode) command i get the message "Symbol's function definition is void: th-outline-minor-mode-init"

Seems like the org-mode sets up the outline-minor-mode-hook

outline-minor-mode-hook's value is (th-outline-minor-mode-init)

  This variable may be risky if used as a file-local variable.

How to setup the outline-minor-mode for init.el file so that the ";" is treated as heading.

Note:- When emacs is launched with --no-init-file option, outline-minor-mode works for init.el file

1

1 Answers

3
votes

Doesn't org-mode use an org- prefix pretty consistently?

On that assumption, th-outline-minor-mode-init doesn't look like an org-mode function to me, so something else is probably at fault, and you'll need to find out what.

Obviously you can't find-function if it's void, so I'd just M-x rgrep your config for th-outline-minor-mode-init (or most likely searching for (add-hook 'outline-minor-mode-hook 'th-outline-minor-mode-init will find the culprit directly).


That issue aside, I happen to use outline-minor-mode in my init file (with headers being lines beginning with ;;;;, and auto-folding the ones beginning with ;;;; *), using the following Local Variables block at the end of the file:

;;; Local Variables:
;;; outline-regexp: ";;;; "
;;; eval:(progn (outline-minor-mode 1) (while (re-search-forward "^;;;; \\* " nil t) (outline-toggle-children)))
;;; End:

I keep a lot of documentation in the file, and with <backtab> bound to outline-toggle-children I find this a pretty convenient way to access it.