From 5d09db86a09fb588e8c33c03457d5d860cf55937 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Fri, 1 Nov 2024 09:40:43 -0700 Subject: [PATCH] Add some Embark stuff --- init.el | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 2305363..cff4926 100644 --- a/init.el +++ b/init.el @@ -737,7 +737,26 @@ visual states." ("b" . consult-buffer) ("B" . switch-to-buffer)) :init - (setq embark-quit-after-action nil) + (setq embark-quit-after-action nil + embark-indicators '(embark-minimal-indicator + embark-isearch-highlight-indicator + embark-highlight-indicator)) + (defvar-keymap my/embark-string-map + :doc "Keymap for Embark string actions." + :parent embark-expression-map + "R" 'repunctuate-sentences) + (defun my/embark-target-string () + "Target the string at point." + (if-let (((not (eobp))) ; prevent next line from causing errors + (bounds (bounds-of-thing-at-point 'string))) + (append (list 'string (buffer-substring-no-properties (car bounds) + (cdr bounds))) + bounds))) + (add-to-list 'embark-around-action-hooks + '(repunctuate-sentences embark--mark-target)) + (add-to-list 'embark-keymap-alist + '(string my/embark-string-map)) + (add-to-list 'embark-target-finders 'my/embark-target-string) (add-to-list 'display-buffer-alist '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" nil