On Tue, Nov 3, 2015 at 10:17 AM, Stephen Leake <
stephen_leake@stephe-leake.org> wrote:
> Well, since this is only a problem in a test run by developers (not
> general users), we _could_ insist on that, but I agree it would be nice
> not to.
I think it points to a problem with xrefs in general. IMO xref-location should have a generic compare function (specialized by default on xref-file-location) so two of them can be compared other than by `equal' and get the right result in case-insensitive systems. And xref-item should also have a generic compare function, whose default implementation would use xref-compare-locations (or whatever the name) to compare its location slots.
> The canonical solution for case-insensitive string comparisons is to use
> `downcase' on both values before using `equal'. This works for me:
It works for me too, though I get a whole bunch of warnings running the test:
c:/devel/emacs/repo/trunk/test/automated/elisp-mode-tests.el and c:/Devel/emacs/repo/trunk/test/automated/elisp-mode-tests.el are the same file
> ;; We add 'downcase' here to deliberately cause a potential problem on
> ;; case-insensitive file systems. On such systems, `load-file-name'
> ;; may not have the same case as the real file system, since the user
> ;; can set `load-path' to have the wrong case. This is handled in
> ;; `xref-elisp-test-run'.
In case-insensitive (or, as Windows, case-preserving) systems, that's not the "wrong" case, just an alternative ;-)
> If no one objects to this, I'll commit it.
Please do, thanks.