From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: [org-babel] How to refer to a specific property when it is defined multiple times? Date: Fri, 26 Mar 2010 12:33:13 -0400 Message-ID: <874ok3f3g6.fsf@stats.ox.ac.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvCTL-0008Ab-6D for emacs-orgmode@gnu.org; Fri, 26 Mar 2010 12:33:23 -0400 Received: from [140.186.70.92] (port=33837 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvCTJ-00089h-GI for emacs-orgmode@gnu.org; Fri, 26 Mar 2010 12:33:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvCTH-00038E-2i for emacs-orgmode@gnu.org; Fri, 26 Mar 2010 12:33:20 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:48980) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvCTG-000384-Q7 for emacs-orgmode@gnu.org; Fri, 26 Mar 2010 12:33:18 -0400 In-Reply-To: (Julien Fantin's message of "Fri, 26 Mar 2010 16:54:08 +0100") 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: Julien Fantin Cc: emacs-orgmode@gnu.org Julien Fantin writes: > Consider the following : > =C2=A0 > * heading A > :PROPERTIES: > :BUSY_PROPERTY: AAA > :END: > * heading B > :PROPERTIES: > :BUSY_PROPERTY: BBB > :END: > > #+begin_src emacs-lisp=C2=A0=C2=A0:var test=3D(org-entry-get nil "BUSY_PR= OPERTY" t) > test > #+end_src > #+results: > : BBB > > #+begin_src emacs-lisp=C2=A0=C2=A0:var test=3D(org-property-values "BUSY_= PROPERTY") > test > #+end_src > #+results: > | BBB | AAA | > > > Is there a way I can refer to my BUSY_PROPERTY, in the context of particu= lar > heading ? Hi Julien, You've probably thought of these, but the ways I can think of are An org-babel method:=20 -------------------- 1. place a "reporter" elisp block in the heading, e.g. * heading A :PROPERTIES: :BUSY_PROPERTY: AAA :END: #+source: reporter-A #+begin_src emacs-lisp :var prop=3D"" (org-entry-get nil prop t) #+end_src * heading B :PROPERTIES: :BUSY_PROPERTY: BBB :END: #+begin_src emacs-lisp :var test=3Dreporter-A(prop=3D"BUSY_PROPERTY") test #+end_src #+results: : AAA Elisp methods: -------------- I think identifying headings with CUSTOM_IDs, and usinng the org function org-id-find could help here: 1. Expand the elisp code in the :var reference so that it moves to the desired heading before calling org-entry-get, under the protection of a save-excursion. 2. Put the elisp code in (1) into an elisp block "get-property-at-heading", and use something like=20 :var test=3Dget-property-at-heading(heading-id=3Did, prop=3D"BUSY_PROPER= TY") Dan > Has shown above, I can not get a reference to the heading it was defined = in. > Is there a way to deal with those namespacing conerns right now ? > > Note : This emacs-lisp evaluation in src headers has only been recently > implemented by Eric schulte. > > cheers > _______________________________________________ > 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