Skip to content

ivy cause read-file-name bug #514

Closed
Closed

Description

@zilongshanren

when call read-file-name without a chosen parameter, ivy still use default-directory as the input which is weird

Activity

  1. abo-abo commented on May 20, 2016

    @abo-abo
    Owner

    A minimal example, please.

  2. zilongshanren commented on May 20, 2016

    @zilongshanren
    Author

    At first, turn ivy-mode on, open any file and press M-S-: to execute the sexp (read-file-name "test:" ~/.emacs.d"),

    it will list the current file's directory rather than the files in "~/.emacs.d" directory.

  3. zilongshanren commented on May 20, 2016

    @zilongshanren
    Author

    @abo-abo
    If I give a extra 3nd parameter to the read-file-name function, it will give me the correct file lists.

  4. abo-abo commented on May 20, 2016

    @abo-abo
    Owner

    That's because the first arg is prompt and the second is dir.
    This works:

    (read-file-name "test: " "~/.emacs.d")
  5. zilongshanren commented on May 20, 2016

    @zilongshanren
    Author

    @abo-abo
    sorry, my mistake, (read-file-name "test: " "~/.emacs.d") is still not working...

  6. zilongshanren commented on May 20, 2016

    @zilongshanren
    Author

    @abo-abo if I call (read-file-name "test: " "~/.emacs.d") in scratch buffer , then the result is correct, but it's not working when I open any files in my disk...

  7. abo-abo commented on May 20, 2016

    @abo-abo
    Owner

    Read the doc of read-file-name:

    DIR is the directory to use for completing relative file names.
    It should be an absolute directory name, or nil (which means the
    current buffer's value of `default-directory').

    You must use an absolute path.

  8. zilongshanren commented on May 20, 2016

    @zilongshanren
    Author

    @abo-abo

    it's still not working... when I disable the ivy-mode, problem solves...

    (read-file-name "Load perspectives from a file: "
                                           "/Users/guanghui/.emacs.d/")

    /Users/guanghui is my HOME directory, am I wrong here?

    Thanks.

  9. abo-abo commented on May 20, 2016

    @abo-abo
    Owner

    Please check.

  10. zilongshanren commented on May 20, 2016

    @zilongshanren
    Author

    @abo-abo 👍 thanks, problem solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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