From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Patch to implement sorting Org tables by IP address Date: Sun, 14 Dec 2014 12:25:22 +0100 Message-ID: <87tx0y79st.fsf@nicolasgoaziou.fr> References: <87r3w4a326.fsf@nicolasgoaziou.fr> <87tx0z8vxw.fsf@nicolasgoaziou.fr> <42DDD6AD-8F6F-4F85-840B-4C3946AD3C55@mac.com> <87oar78ro1.fsf@nicolasgoaziou.fr> <8C2CF3B2-399D-4944-8CE9-D486EA1A0985@mac.com> <87bnn78apu.fsf@nicolasgoaziou.fr> <2217AFF8-7135-4EAC-A189-8152FDDE52F9@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y07I2-0003DB-66 for emacs-orgmode@gnu.org; Sun, 14 Dec 2014 06:24:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y07Hn-0004By-Ty for emacs-orgmode@gnu.org; Sun, 14 Dec 2014 06:24:41 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:52523) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y07Hn-0004Br-NX for emacs-orgmode@gnu.org; Sun, 14 Dec 2014 06:24:27 -0500 In-Reply-To: <2217AFF8-7135-4EAC-A189-8152FDDE52F9@mac.com> (Jon Snader's message of "Sat, 13 Dec 2014 17:37:13 -0500") 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: Jon Snader Cc: emacs-orgmode@gnu.org Jon Snader writes: > Well, I=E2=80=99m just going by what happens now. In org-do-sort, each of= the > sort options sets a different extraction function. For example, if you > want a numeric sort, the extraction function calls string-to-number, > while if you want an alphabetic sort it calls > org-sort-remove-invisible. Really, this doesn=E2=80=99t matter because I = was > merely commenting on why (prompt . comparison) isn=E2=80=99t enough. Of > course, you could roll any special extraction functionality into the > comparison but I don=E2=80=99t really like that. Then=20 (prompt comparison extraction) while still allowing=20 (prompt comparison) which would be a special case for (prompt comparison #'org-sort-remove-invisible) > Anyway, what I was suggesting in my last post was that we duplicate > the functionality of org-sort-list. This what I initially suggested. However, I'm trying to see if a table approach would ultimately be better. > There, if you=E2=80=99re calling it programmatically you specify getkey-f= unc > and compare-func. If you call it interactively, it asks you for the > extraction function (which must return a string or number) and it > tests it to see which comparison function to use. I like this approach > because it makes org-sort-list and org-table-sort-lines work the same > way. What=E2=80=99s not to like? The networking researcher will have to provide its sorting function each time, which was one of your arguments. Regards,