selectrum: fix bugs when counsel is loaded (hack)

some doom functions check the completion module with `fboundp`'s instead
of `featurep!`, and counsel can be loaded by using e.g. `lispy`. we add
temporary fixes for this by checking for selectrum stuff first, but this
should be given a more robust fix later on

also we document the selectrum PR's hacks in the TODO.org

see discussion on #5013
This commit is contained in:
Itai Y. Efrat 2021-05-20 17:45:30 +03:00
parent 23a47acc06
commit 49a5c51615
3 changed files with 14 additions and 2 deletions

View file

@ -128,6 +128,8 @@ If DIR is not a project, it will be indexed (but not cached)."
(if (doom-module-p :completion 'ivy) (if (doom-module-p :completion 'ivy)
#'counsel-projectile-find-file #'counsel-projectile-find-file
#'projectile-find-file))) #'projectile-find-file)))
((fboundp 'selectrum-mode) ;HACK see @ymarco's comment on #5013 and TODO.org in the selecturm module.
(call-interactively #'find-file))
((fboundp 'counsel-file-jump) ; ivy only ((fboundp 'counsel-file-jump) ; ivy only
(call-interactively #'counsel-file-jump)) (call-interactively #'counsel-file-jump))
((project-current nil dir) ((project-current nil dir)

View file

@ -10,6 +10,16 @@ regular isearch for now.
** TODO =SPC s B= ** TODO =SPC s B=
Selectrum/Consult don't have a ~swiper-all~ analogue either. Unbound for now. Selectrum/Consult don't have a ~swiper-all~ analogue either. Unbound for now.
* PROJ HACKs to be addressed
** ~fboundp~ issues
Even if the =ivy= module isn't loaded, it's packages can still get loaded by
other means, such as =lispy= requiring =counsel=. This means that the ~fboundp~
logic such [[file:~/.emacs.d/modules/config/default/autoload/text.el::(cond ((fboundp 'consult-yank-pop) #'consult-yank-pop) ;;HACK see @ymarco's comment on #5013 and TODO.org][here]] and [[file:~/.emacs.d/core/autoload/projects.el::((fboundp 'selectrum-mode) ;HACK see @ymarco's comment on #5013 and TODO.org][here]] won't work unless the selectrum option is checked
first, which is what we do for now.
** ~projectile-switch-project-action~ definition
Without [[file:~/.emacs.d/modules/ui/workspaces/config.el::;; HACK?? needs review][this]] change new projects don't get opened in a new tab, but the exact
working of this whole set up are a bit opaque to me.
* PROJ Bugs * PROJ Bugs
** TODO =C-SPC= and live previews ** TODO =C-SPC= and live previews
Automatic live previews have been disabled on slow ~consult~ commands. Automatic live previews have been disabled on slow ~consult~ commands.

View file

@ -27,8 +27,8 @@
"Interactively select what text to insert from the kill ring." "Interactively select what text to insert from the kill ring."
(interactive) (interactive)
(call-interactively (call-interactively
(cond ((fboundp 'counsel-yank-pop) #'counsel-yank-pop) (cond ((fboundp 'consult-yank-pop) #'consult-yank-pop) ;HACK see @ymarco's comment on #5013 and TODO.org in the selecturm module.
((fboundp 'consult-yank-pop) #'consult-yank-pop) ((fboundp 'counsel-yank-pop) #'counsel-yank-pop)
((fboundp 'helm-show-kill-ring) #'helm-show-kill-ring) ((fboundp 'helm-show-kill-ring) #'helm-show-kill-ring)
((error "No kill-ring search backend available. Enable ivy, helm or selectrum!"))))) ((error "No kill-ring search backend available. Enable ivy, helm or selectrum!")))))