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 10:19:41 -0500 Message-ID: <42DDD6AD-8F6F-4F85-840B-4C3946AD3C55@mac.com> References: <87r3w4a326.fsf@nicolasgoaziou.fr> <87tx0z8vxw.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/signed; boundary="Apple-Mail=_1671D128-483B-42CC-8DB3-3E1B668C8968"; protocol="application/pgp-signature"; micalg=pgp-sha1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzoU8-00080N-Vp for emacs-orgmode@gnu.org; Sat, 13 Dec 2014 10:20:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XzoU2-000485-O2 for emacs-orgmode@gnu.org; Sat, 13 Dec 2014 10:19:56 -0500 Received: from st11p01mm-asmtp002.mac.com ([17.172.204.237]:37139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzoU2-000471-J0 for emacs-orgmode@gnu.org; Sat, 13 Dec 2014 10:19:50 -0500 Received: from [172.30.0.157] (unknown [75.115.6.171]) by st11p01mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.33.0 64bit (built Aug 27 2014)) with ESMTPSA id <0NGJ007LN18ZAG10@st11p01mm-asmtp002.mac.com> for emacs-orgmode@gnu.org; Sat, 13 Dec 2014 15:19:48 +0000 (GMT) In-reply-to: <87tx0z8vxw.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=_1671D128-483B-42CC-8DB3-3E1B668C8968 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 13, 2014, at 9:29 AM, Nicolas Goaziou = wrote: > I think my proposal is simpler: add ?f and ?F to built-in options, in > which case user is prompted for a custom sorting function (in your = case, > `org-ip-lessp'). It is also more consistent with `org-sort-list=E2=80=99= . The problem with that solution is that the user has to answer the = additional prompts every time he calls org-table-sort-lines with a = custom sort. Imagine, for example, a networking researcher who often = builds tables that he or she wants to sort by IP address (or any other = special format). Why should the researcher have to answer additional = prompts every time a table needs to be sorted? What if a user wants to = call org-do-sort from Elisp? We=E2=80=99d have to add additional = parameters for the custom sort functions. The solution I=E2=80=99m suggesting will simplify org-do-sort, make it = easily expandable, and allow programmatic calls to it. It is, it seems = to me, consistent with how Emacs does things: add to little Elisp to = expand a functionality to cover an additional case. As things stand now, = it=E2=80=99s not possible for me to add an IP sort locally. Your = solution does provide that, after a fashion, but at the cost of having = to enter additional information each time I call the sort. It doesn=E2=80=99= t really make it easier for the user because the extraction and compare = functions will still have to be written (at least in most cases I can = think of). As for org-sort-list, it too would benefit from being table driven for = the same reason that org-do-sort would: it enables users to define = custom sorts. If we agree on this approach, I=E2=80=99ll submit another = patch for org-sort-list. > Also, IMO, IP address sort should not be built-in, and needs not with > the proposal above. I don=E2=80=99t care overmuch if the IP address sort is built in = (although others might appreciate the functionality) only that I have a = way of adding it locally. --Apple-Mail=_1671D128-483B-42CC-8DB3-3E1B668C8968 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 iQIcBAEBAgAGBQJUjFkNAAoJEO+a/ARTO0yyhuwP/0ZRvD18e3Qs6++5uQ2hA56W CNBK+8Nsf1LGhwqC4cu5br+Wa6GNqhGrW94jFGfsR98KoqtkLa01Fc132/yf9qi1 Xlw5VVmf0WAwWpAoGaLH5BJ5o25VaBgMTCIxOpuUlWkGSUFwt3A9WXNJPeRLhVvt E75YD9XWk5nRhBA4sQ0XWortF/U6isSkvjAihOdf4EMcpL+miVy/51chOFafZbI1 5zH8AEsBbro95WFTXuciv7yU7Cll4iPbWvkTh6UktIjvVmBCsG5g4wMwWVhIeyqZ WVjIdAF+wBEwhLkg+NoeVqVgJETlqbuIDBdBpwvGZLZvGYKbfqAz+1pMCpdV9Cql CSyi79s1aF4zDpUTX1pWg1TbZ/HT9mRqbFfWsUyReMWoLy4qX3REYaTntiytTsbM mSkrUcJeb4KNjmf9xxkO3tdelL+4Ci09x1q8fBd7RE+41GG+dOz+SpM3cQ+xffYk gGdIMpxj2EysAcsCF6NVwCB4b3lXRcjHFDw9vVLGPg1uZ7pqS2973lXNk1VQSLQ/ BqqIQd6Dw1TV7sqNTG1qfmEd4NbLgcSmNq0lyMYNB2KYPBW7cXDAMqOL/g1Uhp5v IVwCn8dDgLK3sbmksoUClvrBJy5uGH3uJNPicmVK5wgZo+ovTqWdllAVG82gqj0M ZMa2XcpgPF6YedZ/JRfW =SJP3 -----END PGP SIGNATURE----- --Apple-Mail=_1671D128-483B-42CC-8DB3-3E1B668C8968--