Fix docset lookup & lazyload *-dash
Have to forward declare *-dash-docsets so we can lazy load the *-dash libraries. Also fixes a void-variable error because helm-dash-docsets isn't defined by helm-dash, just used.
This commit is contained in:
parent
7773a312aa
commit
ef90633432
1 changed files with 6 additions and 3 deletions
|
@ -1,6 +1,12 @@
|
||||||
;;; feature/lookup/autoload/docsets.el -*- lexical-binding: t; -*-
|
;;; feature/lookup/autoload/docsets.el -*- lexical-binding: t; -*-
|
||||||
;;;###if (featurep! +docsets)
|
;;;###if (featurep! +docsets)
|
||||||
|
|
||||||
|
(defvar-local helm-dash-docsets nil
|
||||||
|
"Docsets to use for this buffer.")
|
||||||
|
|
||||||
|
(defvar-local counsel-dash-docsets nil
|
||||||
|
"Docsets to use for this buffer.")
|
||||||
|
|
||||||
;;;###autodef
|
;;;###autodef
|
||||||
(defun set-docset! (modes &rest docsets)
|
(defun set-docset! (modes &rest docsets)
|
||||||
"Registers a list of DOCSETS (strings) for MODES (either one major mode
|
"Registers a list of DOCSETS (strings) for MODES (either one major mode
|
||||||
|
@ -23,14 +29,11 @@ Used by `+lookup/in-docsets' and `+lookup/documentation'."
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(let (var-sym)
|
(let (var-sym)
|
||||||
(cond ((featurep! :completion ivy)
|
(cond ((featurep! :completion ivy)
|
||||||
(require 'counsel-dash)
|
|
||||||
(setq var-sym 'counsel-dash-docsets))
|
(setq var-sym 'counsel-dash-docsets))
|
||||||
((featurep! :completion helm)
|
((featurep! :completion helm)
|
||||||
(require 'helm-dash)
|
|
||||||
(setq var-sym 'helm-dash-docsets)))
|
(setq var-sym 'helm-dash-docsets)))
|
||||||
(when var-sym
|
(when var-sym
|
||||||
(let ((val (symbol-value var-sym)))
|
(let ((val (symbol-value var-sym)))
|
||||||
(make-variable-buffer-local var-sym)
|
|
||||||
(pcase (car docsets)
|
(pcase (car docsets)
|
||||||
(:add
|
(:add
|
||||||
(set var-sym (append val (cdr docsets))))
|
(set var-sym (append val (cdr docsets))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue