feature/lookup: rewrite dash docset integration

+ Uses alist variable to store config, rather than hooks
+ Added check for installed docsets in +lookup/documentation
+ Set docsets for various language modules (c-mode, c++-mode, css-mode,
  scss-mode, sass-mode, web-mode, go-mode, racket-mode, emacs-lisp-mode,
  js2-mode, rjsx-mode, typescript-mode, rust-mode, and php-mode)
+ Made *eww* popups for dash docsets larger
+ Renamed set-docset! => set-docsets! (set-docset! is aliased to
  set-docsets!)
+ New +lookup/install-docset alias
This commit is contained in:
Henrik Lissner 2018-08-31 02:44:49 +02:00
parent 2df2622329
commit fd8f8c5108
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
13 changed files with 119 additions and 35 deletions

View file

@ -63,6 +63,10 @@ properties:
`(set-lookup-handlers! ,modes ,@plist))
;;
;; Library
;;
;; Helpers
(defun +lookup--online-provider (&optional force-p namespace)
(let ((key (or namespace major-mode)))
@ -201,17 +205,18 @@ Goes down a list of possible backends:
3. Fall back to an online search, with `+lookup/online'"
(interactive
(list (+lookup--symbol-or-region)))
(cond ((and +lookup-documentation-functions
(cond ((null identifier) (user-error "Nothing under point"))
((and +lookup-documentation-functions
(+lookup--jump-to :documentation identifier)))
((and (featurep! +docsets)
(or (require 'counsel-dash nil t)
(require 'helm-dash nil t))
(or (bound-and-true-p counsel-dash-docsets)
(bound-and-true-p helm-dash-docsets))
;; counsel-dash uses helm-dash under the hood
(helm-dash-installed-docsets))
(+lookup/in-docsets identifier))
(let ((docsets (+lookup-docsets-for-buffer)))
(when (cl-some #'+lookup-docset-installed-p docsets)
(+lookup/in-docsets identifier docsets)
t))))
((+lookup/online
identifier