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
|
@ -316,29 +316,3 @@ Otherwise, falls back on `find-file-at-point'."
|
|||
(run-hooks 'projectile-find-file-hook))))))
|
||||
(#'doom-project-browse))))
|
||||
(find-file-at-point path))))))
|
||||
|
||||
|
||||
;;
|
||||
;;; Source-specific commands
|
||||
|
||||
(defvar counsel-dash-docsets)
|
||||
(defvar helm-dash-docsets)
|
||||
;;;###autoload
|
||||
(defun +lookup/in-docsets (&optional query docsets)
|
||||
"Looks up QUERY (a string) in available Dash docsets for the current buffer.
|
||||
|
||||
DOCSETS is a list of docset strings. Docsets can be installed with
|
||||
`+lookup/install-docset'."
|
||||
(interactive)
|
||||
(let* ((counsel-dash-docsets
|
||||
(unless (eq docsets 'blank)
|
||||
(or docsets
|
||||
(or (bound-and-true-p counsel-dash-docsets)
|
||||
(bound-and-true-p helm-dash-docsets)))))
|
||||
(helm-dash-docsets counsel-dash-docsets)
|
||||
(query (or query (+lookup-symbol-or-region) "")))
|
||||
(cond ((featurep! :completion helm)
|
||||
(helm-dash query))
|
||||
((featurep! :completion ivy)
|
||||
(counsel-dash query))
|
||||
((user-error "No dash backend is installed, enable ivy or helm.")))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue