branch: externals/embark commit 66a8f5895dea60b128341813bb08495aa0d48ff4 Author: Omar Antolín <omar.anto...@gmail.com> Commit: Omar Antolín <omar.anto...@gmail.com>
Fix support for quitting multitarget actions (fixes #657) This corrects the change made in commit 9a44418c349e41020cdc5ad1bd21e8c77a429062, which handled the case of quitting a multitarget action incorrectly. --- embark.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/embark.el b/embark.el index 41f26336c2..1885a70ec3 100644 --- a/embark.el +++ b/embark.el @@ -2404,15 +2404,17 @@ ARG is the prefix argument." (alist-get action embark-pre-action-hooks)))) (y-or-n-p (format "Run %s on %d %ss? " action (length candidates) type))) - (if quit - (embark--quit-and-run #'mapc act candidates) - (if (memq action embark-multitarget-actions) - (let ((prefix-arg prefix)) - (embark--act action transformed quit)) - (save-excursion (mapc act candidates))) - (when (memq 'embark--restart - (alist-get action embark-post-action-hooks)) - (embark--restart))))) + (if (memq action embark-multitarget-actions) + (let ((prefix-arg prefix)) + (embark--act action transformed quit)) + (save-excursion + (if quit + (embark--quit-and-run #'mapc act candidates) + (mapc act candidates)))) + (when (and (not quit) + (memq 'embark--restart + (alist-get action embark-post-action-hooks))) + (embark--restart)))) (dolist (cand candidates) (when-let ((bounds (plist-get cand :bounds))) (set-marker (car bounds) nil) ; yay, manual memory management!