From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Wales Subject: Re: Re: user-defined agenda sorting Date: Fri, 19 Jun 2009 13:00:07 -0700 Message-ID: <20524da70906191300t68758b56i81ecef1db8dcf961@mail.gmail.com> References: <20524da70906160157u518e2cf5tc6cc795de6bbf64@mail.gmail.com> <20524da70906160213k55ebc984t92abc4abe3a2fc35@mail.gmail.com> <9A9BB2D2-834D-45DE-B106-55617720EB26@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MHkGI-0006EA-Mn for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 16:00:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MHkGE-00064s-Pv for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 16:00:34 -0400 Received: from [199.232.76.173] (port=60988 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHkGE-00064b-Ls for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 16:00:30 -0400 Received: from mail-pz0-f182.google.com ([209.85.222.182]:54952) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MHkGE-0008Lb-1g for emacs-orgmode@gnu.org; Fri, 19 Jun 2009 16:00:30 -0400 Received: by pzk12 with SMTP id 12so384278pzk.14 for ; Fri, 19 Jun 2009 13:00:28 -0700 (PDT) In-Reply-To: <9A9BB2D2-834D-45DE-B106-55617720EB26@gmail.com> 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: Carsten Dominik Cc: emacs-orgmode@gnu.org Thanks. Just to confirm, to get the inherited tags and the priority letter, I have to go to the original buffer? On Fri, Jun 19, 2009 at 08:39, Carsten Dominik w= rote: > > On Jun 16, 2009, at 11:13 AM, Samuel Wales wrote: > >> If my skills at cargo-cult programming can summon the air force, then >> (get-text-property 1 'priority a/b] will work. =A0But I'm not sure if >> there are functions for parsing tags etc. =A0Testing seems difficult as >> cut and paste of headline strings seems to not include properties. >> >> Thanks. >> >> On Tue, Jun 16, 2009 at 01:57, Samuel Wales wrote: >>> >>> I have a sort comparison function for the outline, which >>> returns a number. =A0This works well. >>> >>> The documentation for user-defined agenda sorting says "This >>> function must receive two arguments, agenda entry a and b." >>> I am not sure what a and b are, strings? >>> >>> My function gets priorities, tags, and todo kw assuming point is on a >>> headline. =A0It uses org functions to get those. =A0The org code for >>> agenda sorting uses text properties. >>> >>> How to adapt my function to get the following information: priorities >>> as [?A..?C], inherited and local tags as a list, and todo kw as a >>> string? >>> >>> Is there a place where how to parse a and b is documented? > > > Not really. =A0`a' and `b' are the strings that are inserted into the age= nda, > each line in the agenda may be `a' or `b'. > The strings are loaded with text properties carrying all kinds of > information. > You can look at these properties by pressing `C-u C-x =3D' on a line in t= he > agenda. > If the information you want is not there, you can take the > org-morker and org-hd-marker properties to visit the original entries and > get the needed info from there. =A0And example for this is in > `org-cmp-todo-state' > which returns to the original buffer in order to get the buffer-local > list of TODO states from there. > > All the org-cmp-.... functions contain examples on how the text propertie= s > are used from comparing entries. > > The reason why these are in different text properties is historic, becaus= e I > added this stuff one by one, over time. =A0Looking back, a single propert= y > list > would have been better for tasks like the one you are working on. > > HTH > > - Carsten > >>> >>> Thanks. >>> >>> -- >>> Myalgic encephalomyelitis denialism is causing death and severe >>> suffering, >>> worse than MS. =A0Conflicts of interest are destroying research. =A0/Yo= u/ can >>> get the disease at any time permanently. =A0Do science and justice matt= er >>> to >>> you? =A0http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm >>> >> >> >> >> -- >> Myalgic encephalomyelitis denialism is causing death and severe sufferin= g, >> worse than MS. =A0Conflicts of interest are destroying research. =A0/You= / can >> get the disease at any time permanently. =A0Do science and justice matte= r to >> you? =A0http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm >> >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Remember: use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > --=20 Myalgic encephalomyelitis denialism is causing death and severe suffering, worse than MS. Conflicts of interest are destroying research. /You/ can get the disease at any time permanently. Do science and justice matter to you? http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm