Add some Embark stuff

This commit is contained in:
Alexander Rosenberg 2024-11-01 09:40:43 -07:00
parent a5e9144d63
commit 5d09db86a0
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

21
init.el
View File

@ -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