Quitting the minibuffer after an action
By default, if you call ‘embark-act’ from the minibuffer it quits the minibuffer after performing the action. You can change this by setting the user option ‘embark-quit-after-action’ to ‘nil’. Having ‘embark-act’ not quit the minibuffer can be useful to turn commands into little "thing managers". For example, you can use ‘find-file’ as a little file manager or ‘describe-package’ as a little package manager: you can run those commands, perform a series of actions, and then quit the command.
If you want to control the quitting behavior in a fine-grained manner depending on the action, you can set ‘embark-quit-after-action’ to an alist, associating commands to either ‘t’ for quitting or ‘nil’ for not quitting. When using an alist, you can use the special key ‘t’ to specify the default behavior. For example, to specify that by default actions should not quit the minibuffer but that using ‘kill-buffer’ as an action should quit, you can use the following configuration:
(setq embark-quit-after-action '((kill-buffer . t) (t . nil)))The variable ‘embark-quit-after-action’ only specifies a default, that is, it only controls whether or not ‘embark-act’ quits the minibuffer when you call it without a prefix argument, and you can select the opposite behavior to what the variable says by calling ‘embark-act’ with ‘C-u’. Also note that both the variable ‘embark-quit-after-action’ and ‘C-u’ have no effect when you call ‘embark-act’ outside the minibuffer.
If you find yourself using the quitting and non-quitting variants of ‘embark-act’ about equally often, independently of the action, you may prefer to simply have separate commands for them instead of a single command that you call with ‘C-u’ half the time. You could, for example, keep the default exiting behavior of ‘embark-act’ and define a non-quitting version as follows:
(defun embark-act-noquit ()
"Run action but don't quit the minibuffer afterwards."
(interactive)
(let ((embark-quit-after-action nil))
(embark-act)))