feat(emacs-lisp): add back/forward commands for helpful

Adapted from Janfel's snippet in Wilfred/helpful#250.

And bound to C-{o,i} and {<,>} for evil users, and C-c C-{b,f} and {l,r}
for vanilla users (mirroring the back/forward keybinds for help.el).

Ref: Wilfred/helpful#250
This commit is contained in:
Henrik Lissner
2025-04-16 23:40:17 -04:00
parent 8f97949975
commit 20381dea16
3 changed files with 75 additions and 2 deletions

View File

@ -318,9 +318,20 @@ current buffer."
;; Open help:* links with helpful-* instead of describe-*
(advice-add #'org-link--open-help :around #'doom-use-helpful-a)
;; Keep a record of buffers so our next/previous commands work.
(advice-add #'helpful--buffer :filter-return #'+emacs-lisp-record-new-buffers-a)
(map! :map helpful-mode-map
:ng "o" #'link-hint-open-link
:n "gr" #'helpful-update))
:n "gr" #'helpful-update
:n "C-o" #'+emacs-lisp/helpful-previous
:n [C-i] #'+emacs-lisp/helpful-next
:n "<" #'+emacs-lisp/helpful-previous
:n ">" #'+emacs-lisp/helpful-next
"C-c C-b" #'+emacs-lisp/helpful-previous
"C-c C-f" #'+emacs-lisp/helpful-next
"l" #'+emacs-lisp/helpful-previous
"r" #'+emacs-lisp/helpful-next))
;;