From 31d602f1cc12dadd153a89f13c4a7e428b76a0c9 Mon Sep 17 00:00:00 2001 From: Daniel <89086143+BardofSprites@users.noreply.github.com> Date: Tue, 9 Apr 2024 17:48:45 -0400 Subject: embark configurations --- bard-emacs-modules/bard-emacs-completion.el | 66 ++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 16 deletions(-) (limited to 'bard-emacs-modules/bard-emacs-completion.el') diff --git a/bard-emacs-modules/bard-emacs-completion.el b/bard-emacs-modules/bard-emacs-completion.el index a2e30b1..0ee63e1 100644 --- a/bard-emacs-modules/bard-emacs-completion.el +++ b/bard-emacs-modules/bard-emacs-completion.el @@ -52,22 +52,56 @@ ("C-x b" . consult-buffer) ("C-z s" . consult-ripgrep)) -;; (use-package embark -;; :ensure t -;; :config -;; (setq embark-confirm-act-all nil) -;; ;; The prot-embark.el has an advice to further simplify the -;; ;; minimal indicator. It shows cycling, which I never want to see -;; ;; or do. -;; (setq embark-mixed-indicator-both nil) -;; (setq embark-mixed-indicator-delay 1.0) -;; (setq embark-indicators '(embark-mixed-indicator embark-highlight-indicator)) -;; (setq embark-verbose-indicator-nested nil) ; I think I don't have them, but I do not want them either -;; (setq embark-verbose-indicator-buffer-sections '(bindings)) -;; (setq embark-verbose-indicator-excluded-actions -;; '(embark-cycle embark-act-all embark-collect embark-export embark-insert)) - -;; ) +(use-package embark + :ensure t + :bind + (("C-," . bard-embark-act-no-quit) + ("C-." . bard-embark-act-quit)) + :config + + (setq embark-keymap-alist + '((buffer bard-embark-buffer-map) + (command bard-embark-command-map) + (expression bard-embark-expression-map) + (file bard-embark-file-map) + (function bard-embark-function-map) + (identifier bard-embark-identifier-map) + (package bard-embark-package-map) + (region bard-embark-region-map) + (symbol bard-embark-symbol-map) + (url bard-embark-url-map) + (variable bard-embark-variable-map) + (t embark-general-map))) + + + (defun bard-embark-act-no-quit () + "Call `embark-act' but do not quit after the action." + (interactive) + (let ((embark-quit-after-action nil)) + (call-interactively #'embark-act))) + + (defun bard-embark-act-quit () + "Call `embark-act' and quit after the action." + (interactive) + (let ((embark-quit-after-action t)) + (call-interactively #'embark-act)) + (when (and (> (minibuffer-depth) 0) + (derived-mode-p 'completion-list-mode)) + (abort-recursive-edit))) + + + (setq embark-confirm-act-all nil) + ;; The prot-embark.el has an advice to further simplify the + ;; minimal indicator. It shows cycling, which I never want to see + ;; or do. + (setq embark-mixed-indicator-both nil) + (setq embark-mixed-indicator-delay 1.0) + (setq embark-indicators '(embark-mixed-indicator embark-highlight-indicator)) + (setq embark-verbose-indicator-nested nil) ; I think I don't have them, but I do not want them either + (setq embark-verbose-indicator-buffer-sections '(bindings)) + (setq embark-verbose-indicator-excluded-actions + '(embark-cycle embark-act-all embark-collect embark-export embark-insert)) + ) (use-package imenu-list :config -- cgit v1.2.3