From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: custom sorting of agenda items Date: Mon, 16 Aug 2010 14:54:30 +0200 Message-ID: <693E7971-E33F-4354-B947-A07FA3D873A6@gmail.com> References: <87r5ie2dpx.fsf@gnu.org> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=46541 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OkzD6-0000m3-OK for emacs-orgmode@gnu.org; Mon, 16 Aug 2010 08:54:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OkzD0-0003lI-H4 for emacs-orgmode@gnu.org; Mon, 16 Aug 2010 08:54:40 -0400 Received: from mail-ew0-f41.google.com ([209.85.215.41]:53041) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkzD0-0003l9-Ax for emacs-orgmode@gnu.org; Mon, 16 Aug 2010 08:54:34 -0400 Received: by ewy28 with SMTP id 28so2427476ewy.0 for ; Mon, 16 Aug 2010 05:54:33 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ilya Shlyakhter Cc: emacs-orgmode , Bastien On Aug 5, 2010, at 1:01 AM, Ilya Shlyakhter wrote: > When giving a user-defined function for org-agenda-cmp-user-defined, > the function gets two agenda entries. Is there a way from an > agenda entry > to get to the original org entry? Yes, the marker that points to the original entry is stored in text properties. You can take it and then go to the entry, for example with (org-with-point-at (org-get-at-bol 'org-hd-marker) ;; do here what you need to do at the location of the entry ) You could do this in org-finalize-agenda-hook for all entries, for example. Might slow things down, of cause. HTH - Carsten > > Best would be if, besides a user-defined sort function, you could > also provide > a function that takes the org entry and the agenda item (i.e. is run > with point > on the org entry and is passed the agenda item), and can then store > anything > it wants about the org entry as text properties on the agenda item. > The companion user-defined sorting function could then use these > stored > text properties for ordering the agenda items. Could you add such > a hook? > > thanks, > > ilya > > On Wed, Aug 4, 2010 at 6:51 PM, Bastien > wrote: >> Hi Ilya, >> >> Ilya Shlyakhter writes: >> >>> I'd like to sort agenda entries in a custom agenda view by the value >>> of a text property that I put on the headlines. >>> Is there a way to do that? >> >> Well, no. >> >> Maybe playing around with org-map-entries could yield some result. >> >> -- >> Bastien >> > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten