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

From: Drew Adams <[email-masked]>
Date: Mon, 4 Jan 2016 08:14:55 -0800 (PST)

> > I do not understand why this is his error msg:
> >
> >     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)
> >
> > That looks peculiar, if all he did was hit `R' on a directory name.
> > That message seems to be saying that Emacs asked the OS to move
> > directory .../FOO to .../foo/FOO.  That doesn't seem like the right
> > thing for Emacs to do.  Seems like Emacs should have asked the OS
> > to move .../FOO to .../foo (without the trailing /FOO).
> 
> Would you still think that if the arguments were changed as below?
> 
>   Move '/Users/HOME/Desktop/FOO' to '/Users/HOME/Desktop/bar/FOO'

I don't understand why you ask that.  He (presumably) asked, interactively,
to move the directory from .../FOO to .../foo.  At least that's my
understanding of what he did - that's what he's said.  And when I do that
on MS Windows that's all that happens: FOO is renamed to foo.

In his case, it seems that the target is getting interpreted as .../foo/FOO.

Isn't the whole question here just what the "arguments" are?

> > Am I missing something?
> 
> Yes, you are:
> 
>   . The filesystem in question is evidently case-insensitive, so Emacs
>     thinks the user wants to move a directory into another _existing_
>     directory ('foo' exists because 'FOO' does)

Why would Emacs think that?  It doesn't think that when I do the same
thing on MS Windows.  He has said that he did exactly what I did, when
I told Emacs to rename "FOO" to "foo".

>   . When the target is an existing directory, rename-file _always_
>     behaves like shown above (which is actually what the user should
>     expect, don't you agree?)

See previous.  Dunno what you mean by it always behaving like you say.
`R' in Dired on MS Windows simply renames FOO to foo, if point is on
directory FOO and you type only "foo" as the new name.

According to what Keith has said, that is not the behavior he gets on
his OS.  He tells Emacs to rename the directory to "foo", and it
(apparently) tries to move (rename) it from FOO to foo/FOO.

>   . See my other message

OK.  Your other message says that MS Windows handles `R' correctly
because it knows that Windows file/folder names are handled
case-insensitively.  And it suggests that this is not the case for OS X.

So that's the bug (or enhancement request): Emacs should treat OS X
file/folder names appropriately.