Reuse helpful-mode buffers when traversing documentation

Instead of scattering helpful-mode buffers, reuse existing buffers when
traversing documentation.

See this blog post for more information:
https://d12frosted.io/posts/2019-06-26-emacs-helpful.html
This commit is contained in:
William Carroll 2020-09-27 23:49:38 +01:00
parent bae3ff4378
commit 1ad6c30acc

View file

@ -140,6 +140,14 @@
;; alternative to help
(use-package helpful)
;; If called from an existing helpful-mode buffer, reuse that buffer; otherwise,
;; call `pop-to-buffer'.
(setq helpful-switch-buffer-function
(lambda (buffer-or-name)
(if (eq major-mode 'helpful-mode)
(switch-to-buffer buffer-or-name)
(pop-to-buffer buffer-or-name))))
;; Emacs integration with direnv
(use-package direnv
:config