emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] Re: [BABEL][PROPOSAL] headlines as executable srcnames


From: Jambunathan K
Subject: [Orgmode] Re: [BABEL][PROPOSAL] headlines as executable srcnames
Date: Thu, 09 Sep 2010 22:00:00 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (windows-nt)

In the context of 'expanding babel macros', I think it would be useful
to think of the context in which the babel macros are expanded.

For example, if the macro is expanded with 'point' at the point of macro
call then one would be able to pull in information from the current
subtree (like property, tags etc etc)

I was looking at this post -

http://www.mail-archive.com/address@hidden/msg29961.html

and reference to the existing #+MACRO facility within orgmode and the
need for accessing properties etc triggered this post.

Hope I could be of some help even if my thougts are a bit fragmented and
in the clouds ...

Jambunathan K.


ps: In the version control example down below the only context is
filename and it doesn't matter where the 'point' is when the macro is
expanded.

> * Revision
> #+begin_src emacs-lisp
>   (vc-working-revision (or (buffer-file-name) org-current-export-file))
> #+end_src  
>
>
> # Variant-1:
>
> * revision control
>   Version of the file is <<Revision()>>
>
> # Variant-2:
>
> Or better still something like this
>
> * revision control
>   Version of the file [[<<Revision()>>][Rev-1]]
>
>
> Following items are worthy of note:
>
> 1. The body of the headline is provided by executing the blocks
>    undeneath it.
>
>    Worth comparing this with the idea that emerged in the original post
>    - where the content of the headline is provided by the user (for
>    example a pdf link or body of a letter) and the results of the
>    execution is one that obtained by piping the results through a custom
>    exporter (latex)
>
> 2. In both cases there is no notion of a '#+results ' being created.
>
> 3. In Variant-2, the org's notion of what a link is redefined (Remember
>    extensible link syntax proposed by Samuel Wales).
>
>    Let's look at how the link is defined in the example
>
>    [[<<Revision()>>][Rev-1]]
>
>    The url portion of the link is actually a 'babel macro call' and
>    provides the content. Note how the macro call is embedded in the url
>    portion and there by hidden from human eye and Rev-1 provides a
>    placeholder. The special link face (or may be a 'babel macro face')
>    would let the user know that there are more things lurking
>    underground.
>





reply via email to

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