emacs-devel
[Top][All Lists]
Advanced

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

Re: find-library-name fails if file (with no extension) exists.


From: David Kastrup
Subject: Re: find-library-name fails if file (with no extension) exists.
Date: Wed, 22 Nov 2006 23:06:26 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> Cc: Eli Zaretskii <address@hidden>,  address@hidden
>> From: David Kastrup <address@hidden>
>> Date: Wed, 22 Nov 2006 13:46:14 +0100
>> 
>> > Are there any reason in those relatively simple cases that they can
>> > not be solved?
>> 
>> How would you do that?  Once a path component is completed, you can
>> try to do an actual stat call whenever a file _appears_ not to be
>> there (and I guess that this is what happens, since `/c/my documents/'
>> _is_ a valid component for further completion), but an incomplete file
>> name?  There is no function of the operating system for asking "is
>> this a partial match with any filename"?
>
> It looks like you never saw any real example of file-name completion
> code.  Perhaps you should, because there's no problem at all to solve
> this.  I even mentioned it: readdir coupled with fnmatch (which has
> flags to become case-insensitive).  Of course, MS-Windows has a native
> API to do this on the system call level, but that's not an important
> detail.

Considering that
/c/my programs/
is the same directory as
/c/My Programs/
but
/C/My Programs/
does not exist, and
/media/usbdisk/My Programs/
may or may not be identical to
/media/usbdisk/my programs/
depending on the file system with which the stick is formatted,
and considering that fnmatch does not actually look at the file
systems to determine whether they are case insensitive or not and the
sensitivity depends on what is currently mounted where and is
different in different components of a file path, [deep breath]
I think you are misrepresenting how easy everything is.

> Again, it's a non-issue if you know that you shouldn't treat file
> names as simple strings.  You may think it's a very hard problem,
> but it isn't.

I'll cede that point once you fixed this in Emacs.  Should not be very
hard.

Good luck.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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