GNU bug report logs - #24441
24.5; rename directory in dired to change case

Previous Next

Package: emacs;

Reported by: Brady Trainor <brady <at> bradyt.com>

Date: Thu, 15 Sep 2016 04:01:02 UTC

Severity: normal

Merged with 22300

Found in versions 24.5, 25.1.50

Fixed in version 26.1

Done: Ken Brown <kbrown <at> cornell.edu>

Bug is archived. No further changes may be made.

Full log


Message #44 received at 24441 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 24441 <at> debbugs.gnu.org, schwab <at> suse.de, brady <at> bradyt.com,
 Ken Brown <kbrown <at> cornell.edu>
Subject: Re: bug#24441: 24.5; rename directory in dired to change case
Date: Fri, 11 Nov 2016 17:23:50 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

Hi Eli,

>> +/* Filesystems are case-sensitive on all supported systems except
>> +   MS-Windows, MS-DOS, Cygwin, and OS X.  They are always
>> +   case-insensitive on the first two, but they may or may not be
>> +   case-insensitive on Cygwin and OS X.  The following function
>> +   attempts to provide a runtime test on those two systems.  If the
>> +   test is not conclusive, we assume case-insensitivity on Cygwin and
>> +   case-sensitivity on OS X.  */
>> +static bool
>> +file_name_case_insensitive_p (const char *filename)
>
> What about filesystems mounted on Posix hosts, like Samba, NFS-mounted
> Windows volumes, etc. -- do those behave as case-sensitive or not?  If
> the latter, can that be detected?  Just asking, this shouldn't hold
> the patch, unless incorporating that is easy (or you feel like it even
> if it isn't ;-).
>
>> +DEFUN ("file-name-case-insensitive-p", Ffile_name_case_insensitive_p,
>> +       Sfile_name_case_insensitive_p, 1, 1, 0,
>> +       doc: /* Return t if file FILENAME is on a case-insensitive filesystem.
>> +The arg must be a string.  */)
>> +  (Lisp_Object filename)
>> +{
>> +  CHECK_STRING (filename);
>> +  return file_name_case_insensitive_p (SSDATA (filename)) ? Qt : Qnil;
>> +}
>
> This "needs work"™.  First, it should call expand-file-name, as all
> file-related primitives do.  Second, it should see if there's a file
> handler for this operation, and if so, call it instead (Michael,
> please take note ;-).

The same comment as for mounted fileystems is also valid for remote
files. Remote smb files could be or could be not case sensitive. The
same for remote files on Darwin macOS systems. I don't know whether this
could be detected automatically.

Furthermore, there are also other file name handlers in game. Think
about ange-ftp (ftp connections), think about url-handler-mode (http
connections and friends). One cannot know, whether the remote side is
case sensitive, or not.

In case it cannot be detected trustworthy, one could use default
assumptions depending on what the remote side is running. And a user
should be able to overwrite this assumption by setting a
connection-local variable for a remote machine, like
`case-insensitive-p'. Tramp and the orther file name handlers would take
this instead of its own heuristic, if this variable exists.

> Thanks again for working on this.

Best regards, Michael.




This bug report was last modified 8 years and 60 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.