Function: embark--insert-in-minibuffer-selected-window-if-quitting
embark--insert-in-minibuffer-selected-window-if-quitting is a
byte-compiled function defined in embark.el.
Signature
(embark--insert-in-minibuffer-selected-window-if-quitting &rest ARGS &key QUIT RUN &allow-other-keys)
Documentation
Insert in minibuffer-selected-window if called quittingly from minibuffer.
For use as an around action hook on embark-insert. When called as an
action from the minibuffer, embark-insert will insert into the window
returned by minibuffer-selected-window if the minibuffer is in a
completion session, and into the minibuffer itself- if not. This is not
useful behavior if the action will also quit the minibuffer, so this
hook makes the minibuffer read-only in the quitting case, which causes
embark-insert to insert into the window returned by
other-window-for-scrolling instead.
Source Code
;; Defined in ~/.emacs.d/elpa/embark-20260610.302/embark.el
(cl-defun embark--insert-in-minibuffer-selected-window-if-quitting
(&rest args &key quit run &allow-other-keys)
"Insert in `minibuffer-selected-window' if called quittingly from minibuffer.
For use as an around action hook on `embark-insert'. When called as an
action from the minibuffer, `embark-insert' will insert into the window
returned by `minibuffer-selected-window' if the minibuffer is in a
completion session, and into the minibuffer itself- if not. This is not
useful behavior if the action will also quit the minibuffer, so this
hook makes the minibuffer read-only in the quitting case, which causes
`embark-insert' to insert into the window returned by
`other-window-for-scrolling' instead."
(let ((buffer-read-only (or (and quit (minibufferp)) buffer-read-only)))
(apply run args)))