From 76069d317e8e026f240b8e142ac7e248f2e323e0 Mon Sep 17 00:00:00 2001 From: Ravi R Kiran Date: Sun, 10 Oct 2021 15:47:05 -0500 Subject: Factor out minibuffer completion system map diff --git a/lisp/ravi-init-completion.el b/lisp/ravi-init-completion.el index 76d216c..9159a4c 100644 --- a/lisp/ravi-init-completion.el +++ b/lisp/ravi-init-completion.el @@ -67,6 +67,13 @@ :init (vertico-mode)) +(defun ravi/bind-key-selection-system-map (key func) + "Bind to appropriate minibuffer completion map" + (bind-key key func + (pcase ravi/use-selection-system + ('selectrum selectrum-minibuffer-map) + ('vertico vertico-map)))) + (use-package marginalia :if (member ravi/use-selection-system '(selectrum vertico)) :config (marginalia-mode)) @@ -82,10 +89,7 @@ :init ;; Optionally replace the key help with a completing-read interface (setq prefix-help-command #'embark-prefix-help-command) - (bind-key "C-t" #'embark-act - (pcase ravi/use-selection-system - ('selectrum selectrum-minibuffer-map) - ('vertico vertico-map))) + (ravi/bind-key-selection-system-map "C-t" #'embark-act) :config (defun embark-magit-status (file) "Run `magit-status` on repo containing the embark target." -- cgit v0.10.1