From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolaj Schumacher Newsgroups: gmane.emacs.help Subject: Re: case-insensitive string< Date: Fri, 17 Apr 2009 23:13:54 +0200 Message-ID: References: <86zlefdxk4.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1240003959 13440 80.91.229.12 (17 Apr 2009 21:32:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Apr 2009 21:32:39 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Ted Zlatanov Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 17 23:33:58 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Luvgv-0002eQ-Bz for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Apr 2009 23:33:46 +0200 Original-Received: from localhost ([127.0.0.1]:46023 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LuvfW-0003ng-I5 for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Apr 2009 17:32:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LuvNl-0006rU-68 for help-gnu-emacs@gnu.org; Fri, 17 Apr 2009 17:13:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LuvNk-0006qc-Fe for help-gnu-emacs@gnu.org; Fri, 17 Apr 2009 17:13:56 -0400 Original-Received: from [199.232.76.173] (port=48913 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LuvNk-0006qS-8I for help-gnu-emacs@gnu.org; Fri, 17 Apr 2009 17:13:56 -0400 Original-Received: from dd18200.kasserver.com ([85.13.138.168]:35094) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LuvNj-00023i-Vo for help-gnu-emacs@gnu.org; Fri, 17 Apr 2009 17:13:56 -0400 Original-Received: from thursday (f050196013.adsl.alicedsl.de [78.50.196.13]) by dd18200.kasserver.com (Postfix) with ESMTP id 51C10180D9D6E; Fri, 17 Apr 2009 23:13:59 +0200 (CEST) In-Reply-To: <86zlefdxk4.fsf@lifelogs.com> (Ted Zlatanov's message of "Fri, 17 Apr 2009 12:01:15 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (darwin) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:63824 Archived-At: Ted Zlatanov 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