When in a Dired buffer, is it possible to copy an existing file to a new file using the existing files name as a "base" and then edit it to create a new file name? I know you cannot copy a file to a new file with the exact same name. What I have been doing is copying the old file name to a register, using Shift-C
on the old file name, and then pasting and editing the new file name. I'm looking for a way to do this that allows me to skip the step of copying the old file name to a register.
Just use C
in Dired to copy the file of the current line to another file. At the prompt, use M-n
to retrieve the existing file's name as the default, and edit it.
Throughout Emacs, M-n
when you see a prompt retrieves the default value for your input. For file-name input in Dired, M-n
typically retrieves the name of the file on the current line.