Subject: bug#28834: 25.1; dired-do-copy: allow to copy into a nonexistent directory

From: Drew Adams <[email-masked]>
Date: Sun, 15 Oct 2017 08:43:32 -0700 (PDT)

> > I want to copy file from "d:/TEMP/test/test.txt" to nonexistent
> > directory "d:/TEMP/test/new/" with Dired
> > Copy ‘d:/TEMP/test/test.txt’ to ‘d:/TEMP/test/new/test.txt’ failed:
> >
> > (file-error Copying file Operation not permitted d:/TEMP/test/test.txt
> d:/TEMP/test/new/test.txt)
> >
> > It would be good if Emacs can autocreate not exist directory when
> > copy/move files.
> 
> It might has sense that Dired handle the creation of those destination
> dirs.  WDOT?

The enhancement request is "It would be good if Emacs CAN
autocreate not exist directory when copy/move files."

The operative word here is "CAN".  A change to _always_
create missing dirs would be inappropriate.  (I have
not looked at your patch in detail.)

It is important that Dired not just create dirs on its
own, especially since that would be an incompatible
behavior change, and also because it would mean also
creating "missing dirs" as a result of a user making
a typing mistake.  At the very least, users should be
able to control this by way of confirming.

What should be done is to offer users the POSSIBILITY
of having Dired create the missing directories.

This can be done in various ways:

1. Have a different command, which users can bind in
   place of the existing command.

2. Have a user option that controls whether Dired creates
   missing dirs by default, i.e., without confirmation.

3. Have Dired ask whether to create missing directories.

I think probably 2+3 would be good: have Dired prompt
when dirs are missing, but have an option that lets
users who never want to be prompted bypass prompting.
The option could be 3-valued: `always-prompt',
`always-create', `never-create' (or other names).