spacemacs/layers/+readers/dash/funcs.el
madand a281e6979f Fix dash//activate-package-docsets when using counsel-dash
When counsel-dash is installed, but helm-dash isn't, startup error
(void-function dash-docs-installed-docsets) will be triggered.

Since common functionality of both counsel-dash and helm-dash was refactored
into dash-docs, a standalone package, the layer code was updated to use the
variables and functions from that package. This also fixed the mentioned error.
2019-05-31 12:11:33 +02:00

26 lines
854 B
EmacsLisp

;;; funcs.el --- Dash Layer functions File for Spacemacs
;;
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
;;
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defun dash//activate-package-docsets (path)
"Add dash docsets from specified PATH."
(when (not (string-blank-p path))
(setq dash-docs-docsets-path (expand-file-name path)))
(setq dash-docs-common-docsets (dash-docs-installed-docsets))
(message (format "activated %d docsets from: %s"
(length dash-docs-common-docsets) path)))
(defun counsel-dash-at-point ()
"Counsel dash with selected point"
(interactive)
(counsel-dash
(if (use-region-p)
(buffer-substring-no-properties (region-beginning) (region-end))
(substring-no-properties (or (thing-at-point 'symbol) "")))))