refactor!: move helpful from :core to :lang emacs-lisp

BREAKING CHANGE: This moves helpful.el out of core into :lang
emacs-lisp. Since most (all) people have this module enabled, this
shouldn't make a difference for most people, but if you're one of the
few that don't have :lang emacs-lisp enabled, Doom will revert to using
Emacs' built-in help.el and describe-* commands.

Others can also disable helpful with (package! helpful :disable t) if
they prefer Emacs' built-in help system, which wasn't possible before,
because it was a core package.

This was done as part of an ongoing effort to slim down Doom's core in
preparation for v3.
This commit is contained in:
Henrik Lissner 2024-08-30 01:56:03 -04:00
parent bf9e619533
commit 6671adc687
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
13 changed files with 127 additions and 116 deletions

View file

@ -165,8 +165,7 @@ buffers."
"Look up documentation for QUERY.
If QUERY is in the format of an ex command, it will map it to the underlying
function and open its documentation with `helpful-function'. Otherwise, it will
search for it with `apropos'.
function and open its documentation.
If QUERY is empty, this runs the equivalent of 'M-x apropos'. If BANG is
non-nil, a search is preformed against Doom's manual (with
@ -180,8 +179,9 @@ non-nil, a search is preformed against Doom's manual (with
(or (command-remapping #'apropos)
#'apropos)))
((string-match "^ *:\\([^ ]+\\)$" query)
(helpful-function
(evil-ex-completed-binding (match-string 1 query))))
(funcall (or (command-remapping #'describe-function)
#'describe-function)
(evil-ex-completed-binding (match-string 1 query))))
((message "Searching for %S, this may take a while..." query)
(apropos query t))))))

View file

@ -150,15 +150,6 @@ directives. By default, this only recognizes C directives.")
:after-until #'evil-global-marker-p
(and (>= char ?2) (<= char ?9)))
;; HACK Invoking helpful from evil-ex throws a "No recursive edit is in
;; progress" error because, between evil-ex and helpful,
;; `abort-recursive-edit' gets called one time too many.
(defadvice! +evil--fix-helpful-key-in-evil-ex-a (key-sequence)
:before #'helpful-key
(when (evil-ex-p)
(run-at-time 0.1 nil #'helpful-key key-sequence)
(abort-recursive-edit)))
;; Make J (evil-join) remove comment delimiters when joining lines.
(advice-add #'evil-join :around #'+evil-join-a)
@ -464,9 +455,6 @@ directives. By default, this only recognizes C directives.")
:v "gR" #'+eval:replace-region
;; Restore these keybinds, since the blacklisted/overwritten gr/gR will
;; undo them:
(:after helpful
:map helpful-mode-map
:n "gr" #'helpful-update)
(:after compile
:map (compilation-mode-map compilation-minor-mode-map)
:n "gr" #'recompile)