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: Eli Zaretskii
Subject: bug#21816: elisp-mode-tests fails on a case-preserving filesystem
Date: Tue, 03 Nov 2015 17:40:34 +0200

> From: Stephen Leake <stephen_leake@stephe-leake.org>
> Date: Tue, 03 Nov 2015 08:51:29 -0600
> Cc: 21816@debbugs.gnu.org
> 
> >> 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
> 
> Which is why I always put the right case in `load-path' :).

You cannot rely on that, in general.  File names don't have to come
from load-path, and load-path is not entirely under your control.

> There's probably a way (other than fixing your load-path) to suppress
> those warnings; ert can redirect errors in general. I did not look into
> it.
> 
> More worrisome is this from the byte compiler:
> 
> In xref-elisp-test-run:
> ../../../master/test/automated/elisp-mode-tests.el:185:57:Warning: Unknown
>     slot `:location'
> ../../../master/test/automated/elisp-mode-tests.el:189:60:Warning: Unknown
>     slot `:location'
> 
> yet the code runs and the tests pass. Changing ":location" to "location"
> fixes the warning.
> 
> There are also several "unused lexical arg" warnings; see the WORKAROUND
> comment.
> 
> >> If no one objects to this, I'll commit it.
> >
> > Please do, thanks.
> 
> Done.

Sorry to bust this party, guys, but I don't think this solution is
"good enough".  First, it won't DTRT with Windows file names that have
backslashes (yes, they happen in Emacs).  Second, 'downcase' has a
known gotcha of using the current buffer's case tables, which is
something you definitely don't want here.

Bottom line, doing this "right" is not so trivial, and a dedicated
function is a better solution, IMO.  If you put it in files-x.el, it
could be reused by other Lisp programs in the need of this.

IME, it doesn't pay off to use such incomplete solutions, the result
is an annoying, albeit minor, maintenance burden.  It's much better
IMO to fix this once and for all, then we could just forget about this
issue.

Thanks.





reply via email to

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