It seems that if I call ivy-read in a temporary buffer, select a candidate and choose an action, then the action is not executed in the temp buffer but in the buffer from which the temp buffer was created.
Example. I am in a buffer where default-directory is "dir1" and evaluate:
(with-temp-buffer
(let ((default-directory "dir2"))
(ivy-read "choose: "
'("foo" "bar")
:action (lambda (x)
(message default-directory)))))
After I choose a candidate, the message is dir1 and not dir2.
Is this intended, or if not is there a simple way to make sure the action is run in the buffer in which ivy-read was called?
It seems that if I call
ivy-readin a temporary buffer, select a candidate and choose an action, then the action is not executed in the temp buffer but in the buffer from which the temp buffer was created.Example. I am in a buffer where
default-directoryis"dir1"and evaluate:After I choose a candidate, the message is
dir1and notdir2.Is this intended, or if not is there a simple way to make sure the action is run in the buffer in which ivy-read was called?