bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24441: 24.5; rename directory in dired to change case


From: Michael Albinus
Subject: bug#24441: 24.5; rename directory in dired to change case
Date: Fri, 11 Nov 2016 17:23:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Eli Zaretskii <eliz@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]