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

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

Re: case-insensitive string<


From: Nikolaj Schumacher
Subject: Re: case-insensitive string<
Date: Fri, 17 Apr 2009 23:13:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (darwin)

Ted Zlatanov <tzz@lifelogs.com> wrote:

> Perhaps you can use `sort' with a predicate that uses `compare-strings'?
> The latter function has a ignore-case parameter, and is implemented in C
> so should be quite fast.

Thanks.  `company-strings' is indeed fast.  Unfortunately the return
value is odd.  It returns a positiv/negative number if different, but t
(instead of 0) when they are equal.  That means some work to turn it
into a compatible predicate...

(byte-compile
 (lambda (a b)
   (let ((v (compare-strings a nil nil b nil nil t)))
     (or (eq v t) (< v 0)))))

All this fuss eventually makes it slower... :(

regards,
Nikolaj Schumacher




reply via email to

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