[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Passing values by reference to src-blocks
From: |
Thorsten Jolitz |
Subject: |
Re: [O] Passing values by reference to src-blocks |
Date: |
Wed, 25 Jun 2014 05:12:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Thorsten Jolitz <address@hidden> writes:
> Hi List,
>
> this does not work, although I would think it should (at least if there
> is no typo or so):
>
> ,----
> | #+name: project-root
> | #+header: :var buf-file=(buffer-file-name)
> | #+begin_src emacs-lisp
> | (file-name-directory
> | (directory-file-name
> | (file-name-directory buf-file)))
> | #+end_src
> `----
>
> #+results: project-root
> : /home/tj/News/drafts/
>
> ,----
> | #+name: project-name
> | #+header: :exports none
> | #+header: :var root-dir=project-root(buf-file=(buffer-file-name))
> | #+begin_src emacs-lisp
> | (mapconcat
> | 'capitalize
> | (split-string
> | (file-name-nondirectory root-dir)
> | "-" 'OMIT-NULLS)
> | " ")
> | #+end_src
> `----
>
> #+results: project-name
>
> Wrong usage of :var or limitations of header arguments?
This works
,----
| #+name: project-root
| #+header: :var buf-file=(buffer-file-name)
| #+begin_src emacs-lisp
| (file-name-directory
| (directory-file-name
| (file-name-directory buf-file)))
| #+end_src
|
| #+name: project-name
| #+header: :exports none
| #+header: :var root=project-root
| #+begin_src emacs-lisp
| (mapconcat
| 'capitalize
| (split-string
| (file-name-nondirectory
| (directory-file-name root))
| "-" 'OMIT-NULLS)
| " ")
| #+end_src
`----
so it was just wrong usage ... sorry for the noise
--
cheers,
Thorsten