From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22300: 25.1.50; Dired -- renaming folders/files to CamelCase/UPPERCASE/lowercase. Date: Tue, 05 Jan 2016 18:46:00 +0200 Message-ID: <834mes560n.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1452012449 21344 80.91.229.3 (5 Jan 2016 16:47:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Jan 2016 16:47:29 +0000 (UTC) Cc: 22300@debbugs.gnu.org, jwiegley@gmail.com To: Keith David Bershatsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 05 17:47:18 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aGUlK-00061m-8r for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Jan 2016 17:47:10 +0100 Original-Received: from localhost ([::1]:50422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGUlJ-0001O0-OT for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Jan 2016 11:47:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGUlF-0001Nq-9N for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2016 11:47:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGUlC-0006JB-1D for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2016 11:47:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGUlB-0006J7-TK for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2016 11:47:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aGUlB-0007uI-Oe for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2016 11:47:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Jan 2016 16:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22300 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22300-submit@debbugs.gnu.org id=B22300.145201236930326 (code B ref 22300); Tue, 05 Jan 2016 16:47:01 +0000 Original-Received: (at 22300) by debbugs.gnu.org; 5 Jan 2016 16:46:09 +0000 Original-Received: from localhost ([127.0.0.1]:38999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aGUkL-0007t3-I0 for submit@debbugs.gnu.org; Tue, 05 Jan 2016 11:46:09 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43521) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aGUkJ-0007sn-W4 for 22300@debbugs.gnu.org; Tue, 05 Jan 2016 11:46:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGUkD-000693-Pa for 22300@debbugs.gnu.org; Tue, 05 Jan 2016 11:46:02 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGUk6-00061z-MG; Tue, 05 Jan 2016 11:45:54 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3884 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aGUk5-0000Vk-Ug; Tue, 05 Jan 2016 11:45:54 -0500 In-reply-to: (message from Keith David Bershatsky on Mon, 04 Jan 2016 12:51:01 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111238 Archived-At: > Date: Mon, 04 Jan 2016 12:51:01 -0800 > From: Keith David Bershatsky > Cc: 22300@debbugs.gnu.org,Drew Adams ,John Wiegley > > 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.