Emacs folding functions in a class using outline-minor-mode

Which hook should I use to collapse only functions in the class. I want to see the contours of functions in the class, but if I delay the hide, everything, including the class, collapses during opening.

+4
source share
2 answers

This little snippet does the trick for me. However, you probably want to limit which files are included in schema mode. You can customize the when comment for this. And add the right close wig.

 (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) 
+2
source

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

+1
source

All Articles