From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Landscheidt Newsgroups: gmane.emacs.help Subject: Sorting on compound keys? Date: Tue, 24 May 2011 20:57:03 +0000 Organization: Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1306270661 31580 80.91.229.12 (24 May 2011 20:57:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 24 May 2011 20:57:41 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 24 22:57:37 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 1QOyfS-0003vQ-43 for geh-help-gnu-emacs@m.gmane.org; Tue, 24 May 2011 22:57:30 +0200 Original-Received: from localhost ([::1]:44938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOyfR-00011l-Q4 for geh-help-gnu-emacs@m.gmane.org; Tue, 24 May 2011 16:57:29 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:58228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOyfL-00011e-UJ for help-gnu-emacs@gnu.org; Tue, 24 May 2011 16:57:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOyfK-0004IM-TQ for help-gnu-emacs@gnu.org; Tue, 24 May 2011 16:57:23 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:34765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOyfK-0004IF-Kx for help-gnu-emacs@gnu.org; Tue, 24 May 2011 16:57:22 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QOyfG-0003lP-PY for help-gnu-emacs@gnu.org; Tue, 24 May 2011 22:57:18 +0200 Original-Received: from f054052055.adsl.alicedsl.de ([78.54.52.55]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 May 2011 22:57:18 +0200 Original-Received: from tim by f054052055.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 May 2011 22:57:18 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 25 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: f054052055.adsl.alicedsl.de Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:qJAqdnxqbKLaeMJoXXufwsO5uNU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:81232 Archived-At: 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 to achieve sorting on compound keys. Tim