branch: externals/embark commit c672dcf1eb8c1be0462778b2ab5a115150568c83 Author: Omar Antolín <omar.anto...@gmail.com> Commit: Omar Antolín <omar.anto...@gmail.com>
Don't inject target into pre-action hook minibuffers! I can't believe this bug was undiscovered for so long. The minibuffer injection applied to the pre-action hook if it happened to open a minibuffer! This was only discovered due to the new embark--confirm action which uses the minibuffer or not depending on the value of the variable y-or-n-p-use-read-key. This change also fixes #439. --- embark.el | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/embark.el b/embark.el index 772667c4af..a62babb4d2 100644 --- a/embark.el +++ b/embark.el @@ -1768,27 +1768,27 @@ minibuffer before executing the action." (run-action (if (and (commandp action) (not multi)) (lambda () - (minibuffer-with-setup-hook inject - (let (final-window) - (when dedicate (set-window-dedicated-p dedicate t)) - (unwind-protect - (with-selected-window action-window - (let ((enable-recursive-minibuffers t) - (embark--command command) - (this-command action) - ;; the next two avoid mouse dialogs - (use-dialog-box nil) - (last-nonmenu-event 13)) - (setq prefix-arg prefix) - (embark--run-action-hooks embark-pre-action-hooks - action target quit) - (command-execute action)) - (setq final-window (selected-window))) - (embark--run-action-hooks embark-post-action-hooks - action target quit) - (when dedicate (set-window-dedicated-p dedicate nil))) - (unless (eq final-window action-window) - (select-window final-window))))) + (let (final-window) + (when dedicate (set-window-dedicated-p dedicate t)) + (unwind-protect + (with-selected-window action-window + (let ((enable-recursive-minibuffers t) + (embark--command command) + (this-command action) + (prefix-arg prefix) + ;; the next two avoid mouse dialogs + (use-dialog-box nil) + (last-nonmenu-event 13)) + (embark--run-action-hooks embark-pre-action-hooks + action target quit) + (minibuffer-with-setup-hook inject + (command-execute action))) + (setq final-window (selected-window))) + (embark--run-action-hooks embark-post-action-hooks + action target quit) + (when dedicate (set-window-dedicated-p dedicate nil))) + (unless (eq final-window action-window) + (select-window final-window)))) (let ((argument (if multi (or (plist-get target :candidates) ; embark-act-all