From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Wittern Subject: convenience sort function Date: Mon, 23 Sep 2013 18:48:56 +0900 Message-ID: <52400E88.1050609@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO2lS-0005S9-0B for emacs-orgmode@gnu.org; Mon, 23 Sep 2013 05:49:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VO2lJ-0007O6-Iq for emacs-orgmode@gnu.org; Mon, 23 Sep 2013 05:49:09 -0400 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]:48525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO2lJ-0007Ny-Ai for emacs-orgmode@gnu.org; Mon, 23 Sep 2013 05:49:01 -0400 Received: by mail-pa0-f51.google.com with SMTP id kp14so2075838pab.38 for ; Mon, 23 Sep 2013 02:48:59 -0700 (PDT) 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: Org Mode Mailing List Dear org users, I would like to define a convenience sort function to sort on a certain property (e.g PRE), which I can assign to a key, so that I can avoid having to type C-^ r PRE It seems that I want to call org-sort-entries, which has the following signature: (defun org-sort-entries (&optional with-case sorting-type getkey-func compare-func property) From the docstring, I learn that I have to use ?r to sort on properties and the last parameter is the property to sort on, "PRE" in this case. However, what I do not understand is what I should give for getkey-func and compare-func. Something like this (org-sort-entries t ?r t t "PRE") or this (org-sort-entries t ?r nil nil "PRE") does not work, and reading the source does not give me any clues (probably because I do not understand what is going on....) Any help would be apprectiated, Christian -- Christian Wittern, Kyoto