emacs-devel
[Top][All Lists]
Advanced

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

Re: PR: dired-do-create-files now checks for trailing slashes in the tar


From: Tassilo Horn
Subject: Re: PR: dired-do-create-files now checks for trailing slashes in the target
Date: Wed, 29 Sep 2021 15:23:39 +0200
User-agent: mu4e 1.7.0; emacs 28.0.50

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

>> > because if the user types
>> >
>> >   R /new_ TAB
>> >
>> > Emacs will complete it to "/new_name/", including the trailing slash.
>> 
>> But only if it exists, and then the patch makes no difference in
>> behavior.
>
> Isn't that exactly the problem?  If both old_name and new_name exist,
> how do I rename old_name into new_name so that it overwrites new_name
> instead of becoming its subdirectory?  I must carefully type new_name
> RET so as to avoid having a slash at its end.

That's already the case without this patch and emacs 27.2 started with
"emacs -Q".  I have both foo and bar directories in my dired buffer,
then hit R on foo and complete bar/.  It will move foo inside of bar.
The very same happens if I just complete to bar without trailing /.

IMHO, that makes sense because you usually don't want to rename a
directory so that it gets a name which already exists.  And its also
consistent with "mv" from GNU coreutils 9.0 where "mv foo bar" also
moves foo into bar if both exist and at least bar is a directory.

That makes the proposed patch a very natural extension of what we
already have, i.e., it just ensures `dired-create-destination-dirs' is
obeyed.

> I would support such a change only if it had an explicit defcustom to
> control it.  (It could be a new value of
> dired-create-destination-dirs, if that makes sense.)

I disagree based on above observations.  Is the behavior different on
Windows?

Bye,
Tassilo



reply via email to

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