This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+tools/fasd/packages.el
Aaron L. Zeng 2b4fd06dc1 [fasd] Fix bug in fasd-find-directory-only
`fasd-find-file` incorrectly interprets a prefix argument of value 1
as equivalent to nil ([issue][0]).

Work around this bug by just passing another positive number instead.
We choose 2.

[0]: https://framagit.org/steckerhalter/emacs-fasd/-/issues/14
2020-09-14 18:34:38 +02:00

40 lines
1.4 KiB
EmacsLisp

(setq fasd-packages
'((helm-fasd :requires helm
:location (recipe :repo "ajsalminen/helm-fasd"
:fetcher github
:files ("*.el")))
(fasd :toggle (not (configuration-layer/layer-used-p 'helm)))))
(defun fasd/init-fasd ()
"initializes fasd-emacs and adds a key binding to `SPC f z'"
(use-package fasd
:init
(progn
(defun fasd-find-file-only ()
(interactive)
(fasd-find-file -1))
(defun fasd-find-directory-only ()
(interactive)
(fasd-find-file 2))
(global-fasd-mode 1)
(spacemacs/declare-prefix "fa" "fasd-find")
(spacemacs/set-leader-keys "fad" 'fasd-find-directory-only)
(spacemacs/set-leader-keys "faf" 'fasd-find-file-only)
(spacemacs/set-leader-keys "fas" 'fasd-find-file)
;; we will fall back to using the default completing-read function, which is helm once helm is loaded.
(setq fasd-completing-read-function 'nil))))
(defun fasd/init-helm-fasd ()
"initializes fasd-emacs and adds a key binding to `SPC f z'"
(use-package helm-fasd
:init
(progn
(spacemacs/declare-prefix "fa" "fasd find")
(spacemacs/set-leader-keys "fad" #'helm-fasd-directories)
(spacemacs/set-leader-keys "faf" #'helm-fasd-files)
(spacemacs/set-leader-keys "fas" #'helm-fasd))))