Skip to content

Commit

Permalink
Support embark--restart for multitarget actions
Browse files Browse the repository at this point in the history
  • Loading branch information
oantolin committed Jul 16, 2023
1 parent 644fb10 commit 9a44418
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions embark.el
Original file line number Diff line number Diff line change
Expand Up @@ -2400,16 +2400,15 @@ 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 (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 (memq 'embark--restart
(alist-get action embark-post-action-hooks))
(embark--restart)))))))
(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)))))
(dolist (cand candidates)
(when-let ((bounds (plist-get cand :bounds)))
(set-marker (car bounds) nil) ; yay, manual memory management!
Expand Down

0 comments on commit 9a44418

Please sign in to comment.