casouri / ghelp

Emacs generic Help
43 stars 2 forks source link

Run run-mode-hooks #8

Open philc opened 11 months ago

philc commented 11 months ago

ghelp should provide a ghelp-mode-hook.

This can be achieved with run-mode-hooks (docs).

My use case is that I want to turn on visual-line-mode for ghelp buffers, but not other buffers. I'm not sure if the ghelp-mode-hook is the best place for it, but it's the first place I tried, and I was surprised that there was no such hook.

philc commented 11 months ago

I discovered that the help window I was interested in runs ghelp-page-mode-hook, which I was able to use to turn on line wrapping.

(defun on-ghelp-page-mode-hook ()
  (visual-line-mode 1))
(add-hook 'ghelp-page-mode-hook 'on-ghelp-page-mode-hook)
casouri commented 11 months ago

Yeah, that's what I would suggest.