emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jon Snader <jsnader@mac.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: Patch to implement sorting Org tables by IP address
Date: Sat, 13 Dec 2014 13:47:24 -0500	[thread overview]
Message-ID: <8C2CF3B2-399D-4944-8CE9-D486EA1A0985@mac.com> (raw)
In-Reply-To: <87oar78ro1.fsf@nicolasgoaziou.fr>

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]


> On Dec 13, 2014, at 11:01 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

> `org-do-sort' is an internal function, which isn't meant to be used
> publicly. It really should be named `org-table--do-sort' and be moved
> within "org-table.el". OTOH, we can extend `org-table-sort-lines' to
> allow custom sorting function as a parameter.

I like the idea of providing optional parameters to org-table-sort-lines.

The extraction function varies with the type of sort so it has to be specified one way or the other. In org-sort-list, that’s what the getkey-func parameter supplies. Thus if we wanted an alist we’d need to provide it too. If you want simplicity, how about this: Add ?f ?F and two optional parameters for getkey-func and compare-func to org-table-sort-lines. Then add optional parameters to org-do-sort for the getkey-func and compare-func functions. If the sort type is ?f or ?F org-do-sort would use getkey-func and compare-func instead of the built-in functions.

This would make org-table-sort-lines behave the same way that org-sort-list does. Then I could solve my original problem by writing a local function that calls org-table-sort-lines with the ?f or ?F sort type and appropriate extraction and compare functions.

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

  reply	other threads:[~2014-12-13 18:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-09 19:16 Patch to implement sorting Org tables by IP address Jon Snader
2014-12-12 22:58 ` Nicolas Goaziou
2014-12-13 14:19   ` Jon Snader
2014-12-13 14:29     ` Nicolas Goaziou
2014-12-13 15:19       ` Jon Snader
2014-12-13 16:01         ` Nicolas Goaziou
2014-12-13 18:47           ` Jon Snader [this message]
2014-12-13 22:07             ` Nicolas Goaziou
2014-12-13 22:37               ` Jon Snader
2014-12-14 11:25                 ` Nicolas Goaziou
2014-12-14 15:19                   ` Jon Snader
2014-12-14 17:18                     ` Nicolas Goaziou
2014-12-17 17:31                       ` Jon Snader
2014-12-20 11:57                         ` Nicolas Goaziou
2014-12-20 18:40                           ` Jon Snader
2014-12-20 20:55                             ` Nicolas Goaziou

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.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8C2CF3B2-399D-4944-8CE9-D486EA1A0985@mac.com \
    --to=jsnader@mac.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).