From 92586cacd4a1dcacb9fe8ddc4bd4371b8cdeca21 Mon Sep 17 00:00:00 2001 From: "Itai Y. Efrat" Date: Fri, 2 Jul 2021 23:32:01 +0300 Subject: [PATCH] selectrum: remove `doom-project-find-file` hack This solution doesn't rely on condition evaluation order, and doesn't contain `featurep!`'s unnecessarily. --- core/autoload/projects.el | 8 ++++---- modules/completion/selectrum/TODO.org | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/autoload/projects.el b/core/autoload/projects.el index 57d4c8b01..93c3117e8 100644 --- a/core/autoload/projects.el +++ b/core/autoload/projects.el @@ -128,13 +128,13 @@ If DIR is not a project, it will be indexed (but not cached)." (if (doom-module-p :completion 'ivy) #'counsel-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 + ((and (bound-and-true-p ivy-mode) + (fboundp 'counsel-file-jump)) (call-interactively #'counsel-file-jump)) ((project-current nil dir) (project-find-file-in nil nil dir)) - ((fboundp 'helm-find-files) + ((and (bound-and-true-p helm-mode) + (fboundp 'helm-find-files)) (call-interactively #'helm-find-files)) ((call-interactively #'find-file))))) diff --git a/modules/completion/selectrum/TODO.org b/modules/completion/selectrum/TODO.org index 48d91cf87..427e21969 100644 --- a/modules/completion/selectrum/TODO.org +++ b/modules/completion/selectrum/TODO.org @@ -97,7 +97,7 @@ This might be a temporary concern, but still. ** TODO ~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 +logic [[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 formerly [[file:~/.emacs.d/core/autoload/projects.el::(and (bound-and-true-p ivy-mode][here]]) won't work unless the selectrum option is checked first, which is what we do for now. ** TODO ~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