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 06:46:04 +0200
User-agent: mu4e 1.7.0; emacs 28.0.50

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

>> It solves the problem of moving/copying a file or directory into a
>> not-yet-existing directory.  So with the above example, you can do
>> 
>>   R /new_name/ RET
>
> So the behavior will now differ depending on whether new_name already
> exists or not?

Right.  And also `dired-create-destination-dirs' has to be non-nil for
the new behavior which conforms to its documentation.  I have that set
to 'ask, and when I apply Rudi's patch and do the recipe, it'll ask if a
new directory new_name/ should be created.

> 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.  You explicitly need to type non_existing_dir/ with trailing
slash for the new behavior which will surely never be completed because
of its non-existence.

FWIW, I've applied the patch locally and like it very much.  Of course,
if we agree on including it, it will need to be documented somewhere.
I'm not sure where the best place is.  It's concerned with possibly
creating a new target directory which happens not only with our
renaming/moving example but also with copying, symlinking, etc.  Maybe a
good spot would be the docstring/texinfo docs for
`dired-create-destination-dirs'.  It basically needs another sentence
that when specifying a target of a dired operation, one can add a
trailing / to inform dired that the target is a directory which should
be created if non-existent.

Bye,
Tassilo



reply via email to

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