tools/lookup: remove duplicate code & minor fixes
- Removes vestigial definition of +lookup/in-docsets, which would throw an error. - Fixes the universal argument for this function. - Fix multiple set-docsets! calls prepending rather than setting dash-docs-docsets. - Logs search attempts for debugging purposes.
This commit is contained in:
parent
fbf58aac8c
commit
6973a8926d
2 changed files with 7 additions and 29 deletions
|
@ -29,7 +29,7 @@ Used by `+lookup/in-docsets' and `+lookup/documentation'."
|
|||
(let ((action (if (keywordp (car docsets)) (pop docsets))))
|
||||
(dolist (mode (doom-enlist modes))
|
||||
(let ((hook (intern (format "%s-hook" mode)))
|
||||
(fn (make-symbol (format "+lookup|init--%s-%s" (or action "set") mode))))
|
||||
(fn (intern (format "+lookup|init--%s-%s" (or action "set") mode))))
|
||||
(if (null docsets)
|
||||
(remove-hook hook fn)
|
||||
(fset fn
|
||||
|
@ -84,9 +84,13 @@ If prefix ARG is supplied, search all installed installed docsets. They can be
|
|||
installed with `dash-docs-install-docset'."
|
||||
(interactive "P")
|
||||
(require 'dash-docs)
|
||||
(let ((dash-docs-common-docsets (if arg dash-docs-common-docsets))
|
||||
(dash-docs-docsets (cl-remove-if-not #'dash-docs-docset-path (or docsets dash-docs-docsets)))
|
||||
(let ((dash-docs-common-docsets)
|
||||
(dash-docs-docsets
|
||||
(if arg
|
||||
(dash-docs-installed-docsets)
|
||||
(cl-remove-if-not #'dash-docs-docset-path (or docsets dash-docs-docsets))))
|
||||
(query (or query (+lookup-symbol-or-region) "")))
|
||||
(doom-log "Searching docsets %s" dash-docs-docsets)
|
||||
(cond ((featurep! :completion helm)
|
||||
(helm-dash query))
|
||||
((featurep! :completion ivy)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue