Does anyone have an emacs lisp hack that would allow the creation of a new directory on the fly during dired-do-copy or dired-do-rename? I understand that it can be created prior to running one of these two commands. Extra points for some type of “Are you sure…” prompt.
Share
It look like a case of applying an advice. The question being: what to
advice. Looking at the dired code, it seem that the correct target is
dired-mark-read-file-namethat is used to read the destinationfile-name. This will work:
Note that maybe the first
when(when (member op-symbol '(copy move))) could be removed for this to apply to more case of file creation in dired. But I’m not sure of when dired-mark-read-file-name is called, So I let this test there to reduce potential unwanted side-effect