with-electric-help

with-electric-help is an autoloaded compiled Lisp function in `ehelp.el'.

(with-electric-help THUNK &optional BUFFER NOERASE MINHEIGHT)

Pop up an "electric" help buffer.
THUNK is a function of no arguments which is called to initialize the
contents of BUFFER. BUFFER defaults to `*Help*'. BUFFER will be
erased before THUNK is called unless NOERASE is non-nil. THUNK will
be called while BUFFER is current and with `standard-output' bound to
the buffer specified by BUFFER.

If THUNK returns nil, we display BUFFER starting at the top, and shrink
the window to fit. If THUNK returns non-nil, we don't do those things.

After THUNK has been called, this function "electrically" pops up a
window in which BUFFER is displayed and allows the user to scroll
through that buffer in `electric-help-mode'. The window's height will
be at least MINHEIGHT if this value is non-nil.

If THUNK returns nil, we display BUFFER starting at the top, and
shrink the window to fit if `electric-help-shrink-window' is non-nil.
If THUNK returns non-nil, we don't do those things.

When the user exits (with `electric-help-exit', or otherwise), the help
buffer's window disappears (i.e., we use `save-window-excursion'), and
BUFFER is put back into its original major mode.