Add avy action for embark-dwim

This commit is contained in:
2024-09-30 22:12:50 -07:00
parent 078d396565
commit bb37ac0803

View File

@@ -204,7 +204,17 @@
(cdr (ring-ref avy-ring 0)))) (cdr (ring-ref avy-ring 0))))
t) t)
(defun avy-action-embark-dwim (pt)
(unwind-protect
(save-excursion
(goto-char pt)
(embark-dwim))
(select-window
(cdr (ring-ref avy-ring 0))))
t)
(setf (alist-get ?\; avy-dispatch-alist) 'avy-action-embark) (setf (alist-get ?\; avy-dispatch-alist) 'avy-action-embark)
(setf (alist-get ?\: avy-dispatch-alist) 'avy-action-embark-dwim)
(setq avy-timeout-seconds 0.25) (setq avy-timeout-seconds 0.25)
;; Always show candidates even when there's just one, to give an ;; Always show candidates even when there's just one, to give an