From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: sort-lines including non ASCII Date: Thu, 07 Jul 2016 19:32:17 +0200 Message-ID: <87wpkx73ry.fsf@web.de> References: <87bn2b6buh.fsf@mat.ucm.es> <83zipun8cf.fsf@gnu.org> <87inwiom3w.fsf@web.de> <877fcxyk9j.fsf@mat.ucm.es> <83eg75lbok.fsf@gnu.org> <8760shfm0u.fsf@web.de> <83twg1jsjf.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1467912811 10115 80.91.229.3 (7 Jul 2016 17:33:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Jul 2016 17:33:31 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 07 19:33:23 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bLDAv-0005WC-Bd for ged-emacs-devel@m.gmane.org; Thu, 07 Jul 2016 19:33:21 +0200 Original-Received: from localhost ([::1]:41461 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLDAu-0001Jl-7s for ged-emacs-devel@m.gmane.org; Thu, 07 Jul 2016 13:33:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLDAE-0001JY-Pg for emacs-devel@gnu.org; Thu, 07 Jul 2016 13:32:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLDAA-0005yH-Ip for emacs-devel@gnu.org; Thu, 07 Jul 2016 13:32:37 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:38942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLDAA-0005y7-Bo for emacs-devel@gnu.org; Thu, 07 Jul 2016 13:32:34 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bLDA9-0004qY-2u for emacs-devel@gnu.org; Thu, 07 Jul 2016 19:32:33 +0200 Original-Received: from dslb-088-067-073-210.088.067.pools.vodafone-ip.de ([88.67.73.210]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Jul 2016 19:32:33 +0200 Original-Received: from michael_heerdegen by dslb-088-067-073-210.088.067.pools.vodafone-ip.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Jul 2016 19:32:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 23 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dslb-088-067-073-210.088.067.pools.vodafone-ip.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) Cancel-Lock: sha1:wnvhr1WuQnpVDrlV2/AwsI8mWg4= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:205360 Archived-At: Eli Zaretskii writes: > Maybe if we figure out how to allow this in interactive usage, we can > pass that bit down? And if worse comes to worst, perhaps a separate > command is in order, which uses collation by default? Since `sort-lines' calls `sort-subr' with a fixed second and third argument, I guess we can assume that the key type the predicate must accept is always the same: (#1=(beg . end) . #1#). It would be nice if `sort-lines' as a function would at least accept an arbitrary predicate, and we transform it to accept the correct key type and pass it to `sort-subr', so that `string-collate-lessp' would work as PREDICATE argument. BTW, a relevant question is: Is `compare-buffer-substring' faster than `buffer-substring'+`string<'? I've no strong opinion about the command usage. I would even find it acceptable to leave it as is and force the user to call the thing as a function with M-:, since a lambda as predicate might also be useful quite often. Michael.