Skip to content

ivy-read in temporary buffer #717

@ericdanan

Description

@ericdanan

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions