Question

What kind of a hook should i use to collapse just functions in the class. I want to see the outline of the functions in the class but if i hook hide-all everything including the class is collapsed during open.

Was it helpful?

Solution

This little snippet does the trick for me. However, you probably want to restrict which files have outline mode enabled. You can customize the commented out when statement to do that. And add the proper close paren.

(defun my-outline-trigger ()
  "enable outline mode and hide all the function bodies"
  ;; (when (member major-mode '(cc-mode emacs-lisp-mode)) ....)
  (outline-minor-mode)
  (hide-body))

(add-hook 'find-file-hooks 'my-outline-trigger)

OTHER TIPS

I use hideshow.el - it seems to work better for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top