emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] :session question -- and changes to #+Property: syntax


From: Eric Schulte
Subject: Re: [O] :session question -- and changes to #+Property: syntax
Date: Tue, 25 Jun 2013 08:20:23 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

>>> 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…
>
> 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,

* 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 #<marker at 433 in header-eval-location.org>

#+call: heading-id()

#+RESULTS: heading-id()
: property "two" at 582 really #<marker at 582 in header-eval-location.org>

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
-- 
Eric Schulte
http://cs.unm.edu/~eschulte

reply via email to

[Prev in Thread] Current Thread [Next in Thread]