I wonder if it is possible to change the following functions:

  • dired-do-rename
  • dired-do-copy

such that when I operate on a single file, it prompts the selected file's name as the default target name.

Most of my files have long names, when I copy/rename a file, I usually copy/rename it to a similar name. It's painful to type the entire name or copy it from the original file.

Thanks a lot for any suggestions!


1 Answer 1


The ability to set the "copy to" or "rename/move to" name same as the original name is already built in.

  1. Initiate the copy or move (rename) in dired
  2. (only for ido users) C-f or C-x C-f - kick out of ido mode
  3. M-n - That will give you the current file/dir name

General tip that applies everywhere in emacs: Whenever you are hunting for a default that you think should be present, try out M-n or M-p.


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.