From 02eb645dad1ff5da829f6572a4b24bc7156c0d39 Mon Sep 17 00:00:00 2001 From: kovan Date: Sat, 14 Feb 2026 21:51:23 +0100 Subject: [PATCH] fix(org): yield RET to evil-multiedit in org buffers When iedit (evil-multiedit's backend) is active in an org buffer, `+org/dwim-at-point` now defers to `evil-multiedit-toggle-or-restrict-region`, allowing RET to toggle marks as expected. Fix: #8369 Co-authored-by: Claude Opus 4.6 --- modules/lang/org/config.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index aa7ecec1800..4dc81e9f354 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -1187,6 +1187,20 @@ between the two." CSup (cmd! (org-eval-in-calendar '(calendar-backward-year 1))) CSdown (cmd! (org-eval-in-calendar '(calendar-forward-year 1))))))) +;; HACK When iedit (default backend for evil-multiedit) is active, +;; `+org/dwim-at-point' (bound to RET) should yield to multiedit's +;; toggle-or-restrict command. Without this, evil-org-mode-map takes +;; precedence over evil-multiedit-mode-map, making RET unusable for +;; toggling marks in org buffers. +;; REVIEW: PR this upstream! +(when (modulep! :editor multiple-cursors) + (defadvice! +org--yield-to-multiedit-a (fn &rest args) + "Defer to `evil-multiedit-toggle-or-restrict-region' if iedit is active." + :around #'+org/dwim-at-point + (if (and (bound-and-true-p iedit-mode) + (iedit-current-occurrence-string)) + (call-interactively #'evil-multiedit-toggle-or-restrict-region) + (apply fn args)))) (use-package! evil-org-agenda :when (modulep! :editor evil +everywhere)