Is it possible to have hide-show folding display multiple lines (probably 3) in the folded version? This would get us practically to having a codox-like view right inside a buffer.
What I'm trying to accomplish is using clojure-mode to display the function signature and docstring. AFAICT, hs-toggle-hiding
(and hs-hide-*
etc) always collapse to a single line. If hide-show isn't capable of this, do you know of another tool that could do the job?
Presently, a multi-line fn loses some key parts.
Today
(defn foo
"Does something really fancy, and there are. Maybe. Multiple. Sentences/lines. Here."
[x y]
(some code ,,,))
becomes:
(defn foo...)
which is informationally kinda useless.
Goal
Instead, folds to:
(defn foo
"Does something really fancy, and there are. Maybe. Multiple. Sentences/lines. Here."
[x y] ...)
or maybe optimally:
(defn foo
"Does something really fancy, and there are..."
[x y] ...)
Attempts
I've tried setting things like this, but I still don't see that hide-show support multi-line display:
(setq hs-special-modes-alist '((clojure-mode "(defn [-a-z]+ \"[^\"]+\"" ")" ";; " nil nil)))
(A workaround is to use set-selective-display
with an argument of 3, but that only operates at a whole-buffer level, and shows other unwanted things.)