-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyxl-dash.el
38 lines (30 loc) · 1.31 KB
/
yxl-dash.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
(require 'counsel-dash)
;; A rewrite of the stock spacemacs layer to fit my needs
(defvar yxl-dash-docset-path "~/.docsets"
"Path containing dash docsets.")
(defvar yxl-dash-browser-func 'browse-url
"Func to browse dash docsets.")
(defvar yxl-dash-search-history nil
"Search history for `yxl-dash-search-docset'")
(defun yxl-dash-activate-package-docsets (path)
"Add dash docsets from specified PATH."
(setq helm-dash-docsets-path (expand-file-name path))
(setq helm-dash-common-docsets (helm-dash-installed-docsets))
(message (format "activated %d docsets from: %s"
(length helm-dash-common-docsets) path)))
(defun yxl-dash-search-docset ()
(interactive)
(let* ((counsel-dash-common-docsets
(list (ivy-read "which docset to use: "
(helm-dash-installed-docsets)
:history 'yxl-dash-search-history
:preselect (if (listp yxl-dash-search-history)
(car yxl-dash-search-history)
yxl-dash-search-history)))))
(counsel-dash)))
(defun yxl-dash-search-docset-default-browser ()
(interactive)
(let ((counsel-dash-browser-func 'browse-url))
(counsel-dash-reset-connections)
(yxl-dash-search-docset)))
(provide 'yxl-dash)