From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: Passing values by reference to src-blocks Date: Wed, 25 Jun 2014 05:12:31 +0200 Message-ID: <87oaxh1y3k.fsf@gmail.com> References: <87wqc5srtf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzddr-0004YQ-A5 for emacs-orgmode@gnu.org; Tue, 24 Jun 2014 23:13:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wzdde-0005YN-6a for emacs-orgmode@gnu.org; Tue, 24 Jun 2014 23:12:59 -0400 Received: from plane.gmane.org ([80.91.229.3]:41728) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzdde-0005Y7-0U for emacs-orgmode@gnu.org; Tue, 24 Jun 2014 23:12:46 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Wzddc-0002V9-Mt for emacs-orgmode@gnu.org; Wed, 25 Jun 2014 05:12:44 +0200 Received: from e178059054.adsl.alicedsl.de ([85.178.59.54]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 Jun 2014 05:12:44 +0200 Received: from tjolitz by e178059054.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 Jun 2014 05:12:44 +0200 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: emacs-orgmode@gnu.org Thorsten Jolitz 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