Yours looks at least as good as mine and probably better. I made no
attempt to make it work in the cygwin build, so that's a definite advantage
of yours. If no one disagrees, I think we should use your version.
Mike
--On Friday, September 1, 2000 12:23 AM +0200 Dan Holmsand <dan(a)eyebee.com>
wrote:
Mike Alexander <mta(a)arbortext.com> writes:
> It's annoyed me for some time that the native Windows version of
> XEmacs often ends up with two (or more) buffers visiting the same
> file, even if find-file-compare-truenames or find-file-use-truenames
> is set.
I totally agree. In fact I also started to fix this a while ago...
[...]
> The attached patch changed Ffile_truename to use
> win32_get_long_filename on Windows after changing it to do something
> reasonable when given a path that contains a file or directory that
> doesn't exist. This latter change might cause a problem with code
> that used win32-long-file-name to test for the existence of a file,
> but I can't find any code that uses it at all, let alone for that
> purpose. I also changed xemacs.mak to remove realpath.c from the
> native Windows build since it isn't needed anymore. With this patch I
> haven't had any more problems with multiple buffers visiting the same
> file if I set find-file-compare-truenames or find-file-use-truenames.
I chose the other alternative - making xrealpath work on windows. I
obviously think this is a better choice, mainly because it's mine :-)
My code have some real advantages, though. Mainly, it also works with
cygwin xemacs, which is broken in basically the same way as the native
built one. Besides that the current code doesn't care for case or
short filenames, it is totally broken when you feed it UNC paths.
My code deals with UNC paths by lower-casing the server and share
parts of the filename (i.e. //server/share/...), since case is not
significant here.
It is perhaps also an advantage that the code is shared between unix,
cygwin and native windows xemacsen. It should, for example, be quite
easy to add support for Win2k's reparse points (which basically work
like symlinks).
I also definitely think find-file-compare-truenames should be true by
default on windows.
Anyway, here it is. I've been using it for a while, on both native
xemacs and cygwin. However, I haven't tested the code on unix (the
changes there are mainly trivial, though; mostly *s == '/' ->
IS_DIRECTORY_SEP (*s), etc.).
/dan
--
Dan Ola Holmsand
IB
dan(a)eyebee.com