While in a dired buffer, after pressing C to copy a file, often the new filename you want is actually a variation of the original file name. Is there a easy way to get original file name in to the minibuffer prompt?

  • @NickD: This (the answer at least) is really not specific to Dired. It might be good to change this question to a general one, about inserting the default value into the minibuffer. And maybe change it to a Community question (?).
    – Drew
    Dec 1, 2020 at 17:52
  • @Drew: I can probably generalize the answer to make it clear that this is not just for dired and maybe then generalize the question, but it is going to take some time (which I don't have atm). So I bookmarked the question and I'll try to get back to it asap: no promises though.
    – NickD
    Dec 3, 2020 at 17:52
  • @NickD: Great. Thx.
    – Drew
    Dec 3, 2020 at 18:39

1 Answer 1


The dired section of the Emacs manual says:

The usual history and completion commands can be used in the minibuffer; in particular, ‘M-n’ puts the name of the visited file (if any) in the minibuffer (*note Minibuffer History::).

So, typing M-n at the minibuffer prompt will fill out the name and allow you to change it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.