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

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

bug#21816: elisp-mode-tests fails on a case-preserving filesystem


From: Stephen Leake
Subject: bug#21816: elisp-mode-tests fails on a case-preserving filesystem
Date: Tue, 03 Nov 2015 16:24:35 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt)

Stephen Leake <stephen_leake@stephe-leake.org> writes:

> You asked about "sorting xrefs"; the only sorting that is currently done
> is in xref--analyze, which groups xrefs with the same filename. It uses
> cl-assoc on the filename, which uses "equal" or "eq" for the string
> comparison, I think. It does have a :test parameter we can use to
> override that.
>
> So that could fail due to filename case sensitivity; I'll see if I can
> construct an example.

Here's a simple example:

(let* ((xref1 (xref-make "(defvar foo"
                         (xref-make-elisp-location
                          'xref-elisp-location 'define-var
                          
"c:/projects/emacs/master/lisp/progmodes/elisp-mode.el")))
       (xref2 (xref-make "(defvar bar"
                         (xref-make-elisp-location
                          'xref-elisp-location 'define-var
                          
"c:/Projects/emacs/master/lisp/progmodes/elisp-mode.el")))
       (xref3 (xref-make "(defvar bar"
                         (xref-make-elisp-location
                          'xref-elisp-location 'define-var
                          
"c:/projects/emacs/master/lisp/progmodes/elisp-mode.el")))
       (alist1 (xref--analyze (list xref1 xref2)))
       (alist2 (xref--analyze (list xref1 xref3))))
  (list (length alist1) (length alist2))
  )

returns (2 1); xref1 and xref2 are not grouped, because the file names
compare not equal.

If xref-make-elisp-location used file-truename, this problem would be fixed:

(let* ((xref1 (xref-make "(defvar foo"
                         (xref-make-elisp-location
                          'xref-elisp-location 'define-var
                          (file-truename
                           
"c:/projects/emacs/master/lisp/progmodes/elisp-mode.el"))))
       (xref2 (xref-make "(defvar bar"
                         (xref-make-elisp-location
                          'xref-elisp-location 'define-var
                          (file-truename
                          
"c:/Projects/emacs/master/lisp/progmodes/elisp-mode.el"))))
       (xref3 (xref-make "(defvar bar"
                         (xref-make-elisp-location
                          'xref-elisp-location 'define-var
                          (file-truename
                          
"c:/projects/emacs/master/lisp/progmodes/elisp-mode.el"))))
       (alist1 (xref--analyze (list xref1 xref2)))
       (alist2 (xref--analyze (list xref1 xref3))))
  (list (length alist1) (length alist2))
  )

returns (1 1)
-- 
-- Stephe





reply via email to

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