emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [External] : Re: PR: dired-do-create-files now checks for trailing s


From: Drew Adams
Subject: RE: [External] : Re: PR: dired-do-create-files now checks for trailing slashes in the target
Date: Thu, 30 Sep 2021 15:45:12 +0000

> With Rudi's patch, it's exactly the same when the destination is
> foo/bar.  But if you specify foo/bar/ as destination, dired will create
> foo/bar/ (maybe after asking as controlled by
> `dired-create-destination-dirs') and you get foo/bar/file.txt.
> 
> So basically the trailing / is an indicator to tell dired that the
> target must be a directory, and then the `dired-create-destination-
> dirs' semantics can apply.  Without the /, dired cannot know.

Except for the case where the "missing directory" part has the
same name as the file to be acted on (for the proposed feature
apparently, and also for the existing behavior of
`dired-create-destination-dirs').

You've confirmed that Emacs just raises an error in that case
for the new feature, and that's also what it does anyway for
the existing case of trying to copy (or move or whatever) file
`aaa' in dir `foo' to `foo/aaa/aaa/', where subdir `foo/aaa'
doesn't exist.  Emacs doesn't ask you to create the subdir if
`dired-create-destination-dirs' is `ask', and it doesn't create
it if that option value is t.  It always raises an error.

Whether such behavior is good, or the best, is another
question. But at least (IIUC) the proposed behavior is the
consistent with what we already have.

(However, the error message isn't ideal: "Cannot copy to same
file: ABS-DIR-FOR/foo/aaa".  Since, by the convention, the user
has specified a missing dir, the message should say that that
dir, .../foo/aaa, is missing, or something similar.)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]