Function: embark-act-all
embark-act-all is an autoloaded, interactive and byte-compiled
function defined in embark.el.
Signature
(embark-act-all &optional ARG)
Documentation
Prompt the user for an action and perform it on each candidate.
The candidates are chosen by embark-candidate-collectors. By
default, if embark-select has been used to select some
candidates, then embark-act-all will act on those candidates;
otherwise, if the selection is empty and embark-act-all is
called from a minibuffer, then the candidates are the completion
candidates.
This command uses embark-prompter to ask the user to specify an
action, and calls it injecting the target at the first minibuffer
prompt.
If you call this from the minibuffer, it can optionally quit the
minibuffer. The variable embark-quit-after-action controls
whether calling embark-act with nil ARG quits the minibuffer,
and if ARG is non-nil it will do the opposite. Interactively,
ARG is the prefix argument.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/embark-20260610.302/embark.el
;;;###autoload
(defun embark-act-all (&optional arg)
"Prompt the user for an action and perform it on each candidate.
The candidates are chosen by `embark-candidate-collectors'. By
default, if `embark-select' has been used to select some
candidates, then `embark-act-all' will act on those candidates;
otherwise, if the selection is empty and `embark-act-all' is
called from a minibuffer, then the candidates are the completion
candidates.
This command uses `embark-prompter' to ask the user to specify an
action, and calls it injecting the target at the first minibuffer
prompt.
If you call this from the minibuffer, it can optionally quit the
minibuffer. The variable `embark-quit-after-action' controls
whether calling `embark-act' with nil ARG quits the minibuffer,
and if ARG is non-nil it will do the opposite. Interactively,
ARG is the prefix argument."
(interactive "P")
(let* ((transformed (embark--maybe-transform-candidates))
(type (plist-get transformed :type))
(orig-type (plist-get transformed :orig-type))
(candidates
(or (cl-mapcar
(lambda (cand orig-cand bounds)
(list :type type :target cand
:bounds (when bounds
(cons (copy-marker (car bounds))
(copy-marker (cdr bounds))))
:orig-type orig-type :orig-target orig-cand))
(plist-get transformed :candidates)
(plist-get transformed :orig-candidates)
(plist-get transformed :bounds))
(user-error "No candidates to act on")))
(indicators (mapcar #'funcall embark-indicators)))
(when arg (embark-toggle-quit))
(unwind-protect
(let* ((action
(or (embark--prompt
indicators (embark--action-keymap type nil)
(list (list :type type :multi (length candidates))))
(user-error "Canceled")))
(prefix prefix-arg)
(act (lambda (candidate)
(cl-letf (((symbol-function 'embark--restart) #'ignore)
((symbol-function 'embark--confirm) #'ignore))
(let ((prefix-arg prefix))
(when-let* ((bounds (plist-get candidate :bounds)))
(goto-char (car bounds)))
(embark--act action candidate)))))
(quit (embark--quit-p action)))
(when (and (eq action (embark--default-action type))
(eq action embark--command))
(setq candidates (mapcar #'embark--orig-target candidates)))
(when (or (not (or embark-confirm-act-all
(memq 'embark--confirm
(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 (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!
(set-marker (cdr bounds) nil)))
(setq prefix-arg nil)
(mapc #'funcall indicators))))