From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.help Subject: Re: case-insensitive string< Date: Mon, 20 Apr 2009 13:37:37 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <86fxg3yxvy.fsf@lifelogs.com> 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 1240252864 10557 80.91.229.12 (20 Apr 2009 18:41:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Apr 2009 18:41:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 20 20:42:24 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 1LvyRj-00067x-Ec for geh-help-gnu-emacs@m.gmane.org; Mon, 20 Apr 2009 20:42:23 +0200 Original-Received: from localhost ([127.0.0.1]:55105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LvyQK-0007Db-HN for geh-help-gnu-emacs@m.gmane.org; Mon, 20 Apr 2009 14:40:56 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!newsfeed.straub-nv.de!news.albasani.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-X-Trace: news.albasani.net iSefOjSuxDalhREXnkT4faaO02GkhG7My1Rq2K/kT9i/iLFMRkRkzwi1Rc12Es7dprvZDa0ag6Kq/v8vOMEnFf59FnQqRM2U+i+hTr6QiDSswA77alTdJ/Wxx3n6jMTe Original-X-Complaints-To: abuse@albasani.net Original-NNTP-Posting-Date: Mon, 20 Apr 2009 18:33:00 +0000 (UTC) X-User-ID: Cu8GcElGkJWfh5NjAa7igTq4rHNk1l8JkIhAYa6JYNU= X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Cancel-Lock: sha1:uEdOzp/MEn931szllXt4b5bHAUc= sha1:ClT8gbdIrmN6ZuivOPqauIqPMNg= User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.92 (gnu/linux) X-NNTP-Posting-Host: A0cyh1mjHIJ5Y/8YONc/KFUPvhl3Pprn1QBm8XIYbW4= Original-Xref: news.stanford.edu gnu.emacs.help:168632 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:63905 Archived-At: On Fri, 17 Apr 2009 23:13:54 +0200 Nikolaj Schumacher wrote: NS> 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. NS> Thanks. `company-strings' is indeed fast. Unfortunately the return s/company/compare/ NS> value is odd. It returns a positiv/negative number if different, but t NS> (instead of 0) when they are equal. That means some work to turn it NS> into a compatible predicate... NS> (byte-compile NS> (lambda (a b) NS> (let ((v (compare-strings a nil nil b nil nil t))) NS> (or (eq v t) (< v 0))))) NS> All this fuss eventually makes it slower... :( Modifying the C source code is pretty easy, but I would actually submit this as a feature request on emacs-devel if you're interested. The right way to solve it may be to add a case-fold-compare global variable similar to case-fold-search, with the same automatic buffer-local behavior. Ted