From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Snader Subject: Re: Patch to implement sorting Org tables by IP address Date: Sat, 13 Dec 2014 13:47:24 -0500 Message-ID: <8C2CF3B2-399D-4944-8CE9-D486EA1A0985@mac.com> References: <87r3w4a326.fsf@nicolasgoaziou.fr> <87tx0z8vxw.fsf@nicolasgoaziou.fr> <42DDD6AD-8F6F-4F85-840B-4C3946AD3C55@mac.com> <87oar78ro1.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/signed; boundary="Apple-Mail=_18B30D59-9303-4598-A619-88AEAE8802FE"; protocol="application/pgp-signature"; micalg=pgp-sha1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzrjO-0001ST-Mo for emacs-orgmode@gnu.org; Sat, 13 Dec 2014 13:48:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XzrjI-0008Nv-K9 for emacs-orgmode@gnu.org; Sat, 13 Dec 2014 13:47:54 -0500 Received: from st11p01mm-asmtp001.mac.com ([17.172.204.239]:42733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzrjI-0008Nq-Fj for emacs-orgmode@gnu.org; Sat, 13 Dec 2014 13:47:48 -0500 Received: from [172.30.0.157] (unknown [75.115.6.171]) by st11p01mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTPSA id <0NGJ004D2AVHHZ00@st11p01mm-asmtp001.mac.com> for emacs-orgmode@gnu.org; Sat, 13 Dec 2014 18:47:44 +0000 (GMT) In-reply-to: <87oar78ro1.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org --Apple-Mail=_18B30D59-9303-4598-A619-88AEAE8802FE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 13, 2014, at 11:01 AM, Nicolas Goaziou = 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=E2=80=99s what = the getkey-func parameter supplies. Thus if we wanted an alist we=E2=80=99= 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. --Apple-Mail=_18B30D59-9303-4598-A619-88AEAE8802FE Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQIcBAEBAgAGBQJUjInHAAoJEO+a/ARTO0yy6GoP/1IEFNVEW4G5fiaYAbHZOAkm PYRTuMpVFkZ+8DzylrC/KLLGVi61+E7I/D5VPrjM4k31dK/Hloh6zDyUyjhGL2Qz IV1eWN0Kv1aiwrHOxN0J7WKQ+9WtJNGbTL9WnEvpSPj8bnzU+TkGlifsWqndnQnm bQVrKd8e/eLjCHZDxyNOaxtnsZ982U9bp9XAJAgrmXPXlIzSjVuRV1vktSDzSKq0 8nKToKrgx/vQtum4T654bRI29amkWmXeUMjPfyePeeBRstugo3k6DhwC6XwulbOP BDeQhg4ctj3AerSeAoNE7/EuJTF2+hvu193HISC+ub1TgY762/I3nW+kqjVKT4VD 0XeiOSg42TQwBRQgIO0Dty6rX2DoYISCyvbiUDA9bdF7KG61CCKXKK43CMt3NeGy GijJ42nRk3gk/I5QyZrRrq5bUWH3KCzHbgsUxPvOZ1lktYbOcpJXydFXdVrilrX+ RBk0xTFNPTtHyzuEO1UL85uLUy/mR01naDbHR/1JtL5aTaKsglZ/oqfbwVvZJbL3 11Md6v6VhcXUiw1tEnZyrLfAUhNKeCepi1+hgvvCowjb8QpAX+qPWCl2XDOFrMgd 5YLXMMOr826SjfQe+4JKOkq2fRN49H/DDcVUIRRFc4lHCtD0aXXD4TZbfw3K57F8 5yfgokplibckVGGj77W2 =ImSZ -----END PGP SIGNATURE----- --Apple-Mail=_18B30D59-9303-4598-A619-88AEAE8802FE--