From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: Sorting on compound keys? Date: Wed, 25 May 2011 07:58:44 +0200 Message-ID: <4DDC9A94.3080903@easy-emacs.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1306303139 29646 80.91.229.12 (25 May 2011 05:58:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 25 May 2011 05:58:59 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 25 07:58:55 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QP77O-0000q3-Dq for geh-help-gnu-emacs@m.gmane.org; Wed, 25 May 2011 07:58:54 +0200 Original-Received: from localhost ([::1]:34272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QP77O-0001fa-4m for geh-help-gnu-emacs@m.gmane.org; Wed, 25 May 2011 01:58:54 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QP77H-0001f9-Fl for help-gnu-emacs@gnu.org; Wed, 25 May 2011 01:58:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QP77G-0008Vx-Ol for help-gnu-emacs@gnu.org; Wed, 25 May 2011 01:58:47 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.186]:50955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QP77G-0008Vl-7x for help-gnu-emacs@gnu.org; Wed, 25 May 2011 01:58:46 -0400 Original-Received: from [192.168.178.27] (brln-4db9eac5.pool.mediaWays.net [77.185.234.197]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0M5c8C-1PRcfk3cYS-00xjXp; Wed, 25 May 2011 07:58:45 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.17) Gecko/20110414 SUSE/3.1.10 Thunderbird/3.1.10 In-Reply-To: X-Provags-ID: V02:K0:WysCQ4VfG+G4yHdzAm6uhj7pgHCiJ/1shTsrkSPsQEK RL778csOAGLfU9IQ2N6XzXMlvyRakWyiScJ+1X7Sl28Nn3NyJt wIRt6bQrMysvbiCZtAsU5tVBSsiunBxD3tpuboYK1vbpOVakQm /1peMq5x1zscfHQXzrN3CdnRzH7S9huwgX4Zg1FqjVtAxt3PfC iExtCpoMul7iXAUKFjb4ywi1OnaqtWuYnPqZtE7+oM= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.126.186 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81238 Archived-At: Am 24.05.2011 22:57, schrieb Tim Landscheidt: > Hi, > > sometimes I want to sort unified diffs of CSV files (sepa- > rated by tabs (here: \t)): > > | +A 1\t1\tx > | +A 1\t2\ty > | +B 2\t3\tz > | -A 1\t1\tx > | -B 2\t2\ty > | -B 2\t3\tz > > by the second column, then the first column, then "+" vs. > "-". Unfortunately, it seems that sort-regexp-fields doesn't > allow more than one match field as a key. sort-fields > doesn't work either as it requires the fields to be sur- > rounded by white space (no "+" vs. "-") and doesn't allow > white space inside the fields. > > Is there any function in vanilla Emacs (23.1.1) that I > missed? I looked at pimping sort-regexp-fields, but it seems > to me that sort-subr would have to be rewritten from scratch Hi, last time I looked into that feature was missing indeed. However, didn't look for a need of re-write from the scratch, just to extend to existing routine - ie. introduce one or more levels of sorting. Cheers, Andreas > to achieve sorting on compound keys. > > Tim > > >