0

I use outline-minor-mode to organize my .emacs file. I have this code at the end to activate it in the file:

;;; Local Variables:
;;; eval: (outline-minor-mode 1)
;;; eval: (hide-body)
;;; outline-regexp: "^;;; "
;;; End:

When the file opens however, it shows all the contents, but I would like to see only the headings. How can I achieve this?

2
  • 1
    If you call org-overview, does that give you the visual appearance you are looking for? You do not need an org-mode major-mode buffer for that to work. If so, then you can try putting an eval: of that into your file local variables. Also, have a look at the functions org-content and related functions -- type M-x find-function to trace and see what other functions might help you achieve your goal. – lawlist Jan 10 at 16:49
  • @RaoulComninos: please make your comment an answer (and assuming that you find it answers your question :-), you can also go ahead and accept it.) – NickD Jan 10 at 22:37
1

I was using the incorrect function. Using find-function I discovered that the correct function is outline-hide-subtree. My dot emacs now has these local variables:

;; Local Variables:
;; eval: (outline-minor-mode 1)
;; eval: (while (re-search-forward outline-regexp nil t) (outline-hide-subtree))
;; outline-regexp: "^;;; "
;; End:

When I open my dot emacs now, only headings (with this form: ;;; HEADING:) appear. Many thanks to @lawlist.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.