From: Mark Tilford <ralphmerridew@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Sorting on compound keys?
Date: Sun, 29 May 2011 16:50:54 -0500 [thread overview]
Message-ID: <BANLkTinDQn=m0=8pCJiXMrwu3PbKHf3UnQ@mail.gmail.com> (raw)
In-Reply-To: <m3fwo3hl5s.fsf@passepartout.tim-landscheidt.de>
On Tue, May 24, 2011 at 3:57 PM, Tim Landscheidt <tim@tim-landscheidt.de> wrote:
> 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
Is there an option to do a stable sort, such as mergesort?
next prev parent reply other threads:[~2011-05-29 21:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-24 20:57 Sorting on compound keys? Tim Landscheidt
2011-05-25 5:58 ` Andreas Röhler
2011-05-25 22:08 ` Tim Landscheidt
2011-05-26 6:28 ` Andreas Röhler
2011-05-26 22:49 ` Tim Landscheidt
2011-05-29 20:17 ` Andreas Röhler
2011-06-10 0:26 ` Tim Landscheidt
2011-06-13 7:32 ` Andreas Röhler
2011-05-29 21:50 ` Mark Tilford [this message]
2011-06-10 0:27 ` Tim Landscheidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='BANLkTinDQn=m0=8pCJiXMrwu3PbKHf3UnQ@mail.gmail.com' \
--to=ralphmerridew@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).