unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Keith David Bershatsky <esq@lawlist.com>
Cc: 22300@debbugs.gnu.org, jwiegley@gmail.com
Subject: bug#22300: 25.1.50; Dired -- renaming folders/files to CamelCase/UPPERCASE/lowercase.
Date: Tue, 05 Jan 2016 18:46:00 +0200	[thread overview]
Message-ID: <834mes560n.fsf@gnu.org> (raw)
In-Reply-To: <m2lh85ukzu.wl%esq@lawlist.com> (message from Keith David Bershatsky on Mon, 04 Jan 2016 12:51:01 -0800)

> Date:  Mon, 04 Jan 2016 12:51:01 -0800
> From:  Keith David Bershatsky <esq@lawlist.com>
> Cc:  22300@debbugs.gnu.org,Drew Adams <drew.adams@oracle.com>,John Wiegley <jwiegley@gmail.com>
> 
> I agree that `rename-file` could use a fix.
> 
> Once `rename-file` is ironed out on the C-source code level, I believe the tail 
> end of `dired-do-create-files` will also need to be fixed because the 
> `name-constructor`
> 
> (function (lambda (from) (expand-file-name (file-name-nondirectory from) 
> target)))
> 
> returns the wrong path when used by dired-create-files.  
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22300#29

Why do you think the result of that is wrong?  I think it's exactly as
expected, because this:

  (expand-file-name "SOMETHING" "/Users/HOME/Desktop/foo")

should produce "/Users/HOME/Desktop/foo/SOMETHING" for _any_ value of
SOMETHING, even if SOMETHING is exactly "foo", in the same letter-case
as the last component of "/Users/HOME/Desktop/foo".  That's what
expand-file-name does -- it produces a file name in the directory that
is its 2nd argument.

> So, I believe it will be both areas of Emacs that need some TLC.

There's already code in dired-create-files that handles the same
problem for MS-Windows and MS-DOS, it just needs to be reused for OS
X.  The tricky part with OS X is that its filesystems are not always
case-insensitive, so we need (a) a way to tell whether the filesystem
of the file being renamed is case-insensitive, and (b) tweak that code
a bit to use the above test instead of just testing the OS type.

In any case, invoking 'mv' as a workaround sounds not very clean to
me.  Emacs ought to do whatever 'mv' does to handle this problem by
itself.

I cannot produce a patch for these issues, as I don't have access to
OS X and the man page that John pointed to indicates that calling
getattrlist needs some non-trivial code (the API might not be
supported by the OS, and if it does, the specific attributes might not
be supported, so the code will have to include some reasonable
fallbacks).  So the code will need quite a bit of testing before it
becomes reliable enough to commit to the repository.  I hope someone
with good access to OS X will be able to come up with the changes and
test them.

Thanks.





  reply	other threads:[~2016-01-05 16:46 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03 20:57 bug#22300: 25.1.50; Dired -- renaming folders/files to CamelCase/UPPERCASE/lowercase Keith David Bershatsky
2016-01-03 21:10 ` John Wiegley
2016-01-04  0:47   ` Drew Adams
2016-01-04  1:11     ` John Wiegley
2016-01-04  1:37       ` Drew Adams
2016-01-04 15:46         ` Eli Zaretskii
2016-01-04 16:15           ` Drew Adams
2016-01-04 19:22           ` John Wiegley
2016-01-04 19:27             ` Drew Adams
2016-01-04 19:45               ` Eli Zaretskii
2016-01-04 19:44             ` Eli Zaretskii
2016-01-04 19:48               ` John Wiegley
2016-01-04 20:31                 ` Eli Zaretskii
2016-01-04 15:44     ` Eli Zaretskii
2016-01-04  3:31 ` Eli Zaretskii
2016-01-04  4:19 ` Keith David Bershatsky
2016-01-04 15:50   ` Eli Zaretskii
2016-01-04 17:41 ` Keith David Bershatsky
2016-01-04 19:12   ` Eli Zaretskii
2016-01-04 19:45 ` Keith David Bershatsky
2016-01-04 20:24   ` Eli Zaretskii
2016-01-04 20:51 ` Keith David Bershatsky
2016-01-05 16:46   ` Eli Zaretskii [this message]
2016-01-05 17:27 ` Keith David Bershatsky
2016-01-05 18:28   ` Eli Zaretskii
2016-01-06  3:56 ` Keith David Bershatsky
2016-01-06 15:40   ` Eli Zaretskii
2016-01-06 19:57 ` Keith David Bershatsky
     [not found] <<m2a8oml6tk.wl%esq@lawlist.com>
     [not found] ` <<m24meutlmk.fsf@newartisans.com>
     [not found]   ` <<a936bee4-3375-45cf-ab35-62e36a21f003@default>
     [not found]     ` <<83vb7973iy.fsf@gnu.org>
2016-01-04 16:14       ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=834mes560n.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=22300@debbugs.gnu.org \
    --cc=esq@lawlist.com \
    --cc=jwiegley@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).