From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: :session question -- and changes to #+Property: syntax Date: Tue, 25 Jun 2013 08:20:23 -0600 Message-ID: <87li5ytc3z.fsf@gmail.com> References: <51501AF2.1070405@easy-emacs.de> <8738vjugwd.fsf@gmail.com> <51516699.6090604@gmail.com> <87ip4ezf93.fsf@med.uni-goettingen.de> <87fvzi72ve.fsf@gmail.com> <87ip4e5gai.fsf@gmail.com> <87k3nmd5es.fsf@Rainer.invalid> <87sj264o0f.fsf@gmail.com> <87k3n8gf47.fsf@Rainer.invalid> <878v2l7v7s.fsf@Rainer.invalid> <87txl9u4c4.fsf_-_@gmail.com> <87d2rjcfsv.fsf@Rainer.invalid> <87ehbwsq5v.fsf@gmail.com> <874ncsad3p.fsf@Rainer.invalid> <87a9mkskfa.fsf@gmail.com> <87vc588uha.fsf@Rainer.invalid> <87obawhg20.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrVfo-0005Zi-Gb for emacs-orgmode@gnu.org; Tue, 25 Jun 2013 12:00:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrVfl-0000hL-SE for emacs-orgmode@gnu.org; Tue, 25 Jun 2013 12:00:52 -0400 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]:54729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrVfl-0000h5-JK for emacs-orgmode@gnu.org; Tue, 25 Jun 2013 12:00:49 -0400 Received: by mail-pa0-f41.google.com with SMTP id bj3so12943266pad.28 for ; Tue, 25 Jun 2013 09:00:48 -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: Achim Gratz Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >>> Hopefully the simpler solution which uses the existing value of >>> `org-babel-current-src-block-location' will prove sufficient (once >>> someone implements it that is...). >> >> I'll implement it and see if this seems more useful than the current >> behaviour. If it is, then we'll have to decide if that new behaviour >> replaces the old one or yet another header argument or option switches >> between old and new. I guess it could be arranged so that the old-style >> properties kept the old behaviour and the new-style properties followed >> the new=E2=80=A6 > > I've pushed this to master, with documentation and testing. Old style > property-based header arguments keep the old behaviour of looking up the > properties at the point of source block definition for backwards > compatibility and are now deprecated. The new header-args[:lang] > properties use the location of the call as recorded in > `org-babel-current-src-block-location'. > This is great, thanks. I now see that we had different things in mind when talking about the location used when evaluating header arguments, however both were required and are now implemented. You implemented location-specific look up of header argument properties, I just pushed up location-specific evaluation of elisp embedded in header arguments as shown in the attached example file. Thanks, --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=header-eval-location.org * First :PROPERTIES: :CUSTOM_ID: one :END: #+name: heading-id #+begin_src emacs-lisp :var point=(point) :var loc=(format "%S" org-babel-current-src-block-location) (format "property %S at %d really %s" (org-entry-get point "CUSTOM_ID") point loc) #+end_src #+RESULTS: heading-id : property "one" at 70 really 70 * Second :PROPERTIES: :CUSTOM_ID: two :END: Call with all header arguments at the point of execution #+call: heading-id(point=(point)) #+RESULTS: heading-id(point=(point)) : property "two" at 433 really # #+call: heading-id() #+RESULTS: heading-id() : property "two" at 582 really # Another call from a code block rather than a call line. #+begin_src emacs-lisp :var in=heading-id() in #+end_src #+RESULTS: : property "two" at 762 really 762 --=-=-= Content-Type: text/plain -- Eric Schulte http://cs.unm.edu/~eschulte --=-=-=--