Subject: Re: bug#22300: 25.1.50; Dired -- renaming folders/files to CamelCase/UPPERCASE/lowercase.

From: Keith David Bershatsky <[email-masked]>
Date: Sun, 03 Jan 2016 20:19:50 -0800

I won't be of very much help debugging the C-source code issue of `rename-file`:

  (let ((default-directory "/Users/HOME/Desktop/"))
    (rename-file "/Users/HOME/Desktop/FOO" "/Users/HOME/Desktop/foo" 'ok-if-already-exists))

which yields the following debugger output:

  (file-error "Renaming" "Invalid argument" "/Users/HOME/Desktop/FOO" "/Users/HOME/Desktop/foo/FOO")

However, part of the `dired` problem stems from the outset of `dired-create-files' when the let-bound variable `to' is initially set based on the `name-constructor':

name-constructor:  (lambda (from) (expand-file-name (file-name-nondirectory from) target))

from:  "/Users/HOME/Desktop/FOO"

target:  "/Users/HOME/Desktop/foo"

Put it all together and we have:

  (funcall (lambda (from) (expand-file-name (file-name-nondirectory from) "/Users/HOME/Desktop/foo" )) "/Users/HOME/Desktop/FOO")

Which yields the erroneous `to`:  "/Users/HOME/Desktop/foo/FOO"

Keith

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

At Mon, 04 Jan 2016 05:31:38 +0200,
Eli Zaretskii wrote:
> 
>  Dired -- renaming folders/files to CamelCase/UPPERCASE/lowercase.
> 
> > Date: Sun, 03 Jan 2016 12:57:27 -0800
> > From: Keith David Bershatsky <[email-masked]>
> > 
> > On an Emacs build (master branch), using Emacs -Q, I am unable to change files and folders in dired-mode from CamelCase/UPPERCASE/lowercase.
> > 
> > A folder named `FOO` cannot be changed to `foo` using `dired-do-rename`.
> > 
> >     Move ‘/Users/HOME/Desktop/FOO' to ‘/Users/HOME/Desktop/foo/FOO' failed:
> >       (file-error Renaming Invalid argument /Users/HOME/Desktop/FOO /Users/HOME/Desktop/foo/FOO)
> 
> Why is it trying to make a directory into a subdirectory of itself?