emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Patch to implement sorting Org tables by IP address


From: Jon Snader
Subject: Re: [O] Patch to implement sorting Org tables by IP address
Date: Sat, 20 Dec 2014 13:40:29 -0500


On Dec 20, 2014, at 6:57 AM, Nicolas Goaziou <address@hidden> wrote:

+ extractfun comparefun tempfun extract-string-p)

EXTRACT-STRING-P, and possibly TEMPFUN, are bound too early. See below.

I moved EXTRACT-STRING-P to a lower let but TEMPFUN has to be available to the call to sort so I left it in the outer let.

I suggest something like

 (let* ((tempfun (or getkey-func
                     (intern ...)))
        (extract-string-p (stringp (funcall tempfun (caar table)))))
   (setq extractfun (if (and extract-string-p (not with-case))
                        `(lambda (x) (downcase (funcall ',tempfun x)))
                      tempfun))
   (setq comparefun
        (cond (compare-func)
              (extract-string-p (if (= sorting-type ?f) #'string< #'org-string>))
              ((= sorting-type ?f) #'<)
              (t #'>))))

I followed this suggestion modulo leaving TEMPFUN in the outer let.

Thanks for your suggestions.

The attached patch was against the latest master branch at the time I generated it.

Attachment: 0001-org.el-Implement-user-defined-table-sorting.patch
Description: Binary data


Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail


reply via email to

[Prev in Thread] Current Thread [Next in Thread]