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 17:37:13 -0500 Message-ID: <2217AFF8-7135-4EAC-A189-8152FDDE52F9@mac.com> 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> Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/signed; boundary="Apple-Mail=_C0EFD869-E6D2-4B21-806B-4BC758F4CB78"; protocol="application/pgp-signature"; micalg=pgp-sha1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzvK3-0008BC-5x for emacs-orgmode@gnu.org; Sat, 13 Dec 2014 17:38:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XzvJw-0007zl-Sl for emacs-orgmode@gnu.org; Sat, 13 Dec 2014 17:37:59 -0500 Received: from st11p01mm-asmtp002.mac.com ([17.172.204.237]:39054) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzvJw-0007zZ-O6 for emacs-orgmode@gnu.org; Sat, 13 Dec 2014 17:37:52 -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 <0NGJ009V8LIELF40@st11p01mm-asmtp002.mac.com> for emacs-orgmode@gnu.org; Sat, 13 Dec 2014 22:37:28 +0000 (GMT) In-reply-to: <87bnn78apu.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=_C0EFD869-E6D2-4B21-806B-4BC758F4CB78 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 13, 2014, at 5:07 PM, Nicolas Goaziou = wrote: > I don't think it needs to vary. As I suggested already, we can use = cells > contents (in the appropriate column) as trimmed strings. So, it could = be > built-in. >=20 > Do you see any downside to it? 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. Anyway, what I was suggesting in my last post was that we duplicate the = functionality of org-sort-list. There, if you=E2=80=99re calling it = programmatically you specify getkey-func 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? --Apple-Mail=_C0EFD869-E6D2-4B21-806B-4BC758F4CB78 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 iQIcBAEBAgAGBQJUjL+gAAoJEO+a/ARTO0yy5YoP/iWwuksPhDHT9pi2roIgFMex 7JLXQB8dCdq+LIsvien11WGJrs4QTlAnnFT7XUrSuXjIRd3TzVBe0FyhGvrfpTxt KDm+D6eeScgt6NwdIm+z/KKbeK4OgNEenbgStu8Il6zNr+Xx/tXUSkGwStOa2JkY 88IU9PNu/Fb2qoU1s24tj3V+aQi3i4RfIrk3geRu8xtcFX85jmEVtLGEDyR94GhR Pvee03qgaKSWvRAGJAiwRF/zuq3EfRlqLiwxRuqFVuv32bfwd/zEEkab4nT/GT35 iFmV4PCq6i6Ilm8f19edQNhcx0DRPL+Ok6qsdL6uzO446GkUiMIXli9JsVOs8aqV Eg17LJh+GNl96GSnYOl58b1xSLH1LTEcM+Df5NePTnu/0pwnxWup8vwEKem6Bztd HJhegI3eyWJmpejW3N3L8+k6xTueFlpHkuoeldn3zIYSJWTyUq/qvYw181fWSDgI 0LFTp/voxd8l2+KvpQVeBhi2sG8QCC/zAUn6pUkXlqMgh6zuUrVYUStKRv9YQxQ6 mBCnDNhGgkynyvqsBnjdRUdEYWFxEX+6hbO+Ryw0Tj12cnFScsuwaEKKp6pA6knS HxQuU7gLI/9r4+Czk0aApAfllH14i7YFDfVu6nB9pV0s+JeR1SPrQkkCw2eSLh5E HRw5l1bjreUkbnTaz70F =lO5O -----END PGP SIGNATURE----- --Apple-Mail=_C0EFD869-E6D2-4B21-806B-4BC758F4CB78--