Subject: Re: bug#38707: dired-do-rename doesn't check for "/" !

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 06 Aug 2020 12:13:48 +0200

Nick Helm <[email-masked]> writes:

> Dired could check for and issue an error in the case where the source is
> a file and the target appears to be a non-existent directory. Something
> like this perhaps?

[...]

> +      (if (and (not (file-directory-p (car fn-list)))
> +               (not (file-directory-p target))
> +               (directory-name-p target))
> +          (error "%s: Target directory does not exist: %s" operation target))

I think this makes sense, so I've applied it to Emacs 28.1.  However, it
is a slight behavioural change -- previously you could enter, say
"/tmp/bar/" (when moving one file), and it would move the file to the
file "/tmp/bar".

I think the new behaviour is better (i.e., bugging out), but if people
complain for some reason, then it should perhaps be reverted.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no