From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Question related to org-babel-expand-src-block Date: Fri, 03 Feb 2012 11:49:32 -0700 Message-ID: <87bopfsqf7.fsf@gmx.com> References: <87ty3915t6.fsf@xtof-netbook.home> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:46419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtOU9-0007YQ-IJ for emacs-orgmode@gnu.org; Fri, 03 Feb 2012 14:07:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RtOU8-0007MJ-8o for emacs-orgmode@gnu.org; Fri, 03 Feb 2012 14:07:49 -0500 Received: from mailout-us.gmx.com ([74.208.5.67]:42825) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RtOU8-0007Ll-3b for emacs-orgmode@gnu.org; Fri, 03 Feb 2012 14:07:48 -0500 In-Reply-To: <87ty3915t6.fsf@xtof-netbook.home> (Christophe Pouzat's message of "Thu, 02 Feb 2012 18:52:21 +0100") 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: Christophe Pouzat Cc: emacs-orgmode@gnu.org Christophe Pouzat writes: > Hi all, > > Using the last org-mode version from the git repository (7.8.03) I've found a > mismatch between the key-chord required to call function > =org-babel-expand-src-block= (=C-c C-v v=) and the ones given in the > info file: =C-c C-v p= or =C-c C-v C-p=. The same goes for the > [[http://orgmode.org/worg/org-contrib/babel/intro.html][Babel: > Introduction]] where the given key-chord is =C-c M-b p=. > > In the same line, I have a question concerning the inclusion of the > /expanded/ source block in the generated output. Let's assume that I > define in my =.org= file a variable containing a file name like: > > #+name: my-file-name > : dataFile.mat > > I want then a code block (using =R= in that case) that checks if > "dataFile.mat" is in the working directory with something like: > > #+BEGIN_SRC R :var fileName=my-file-name :exports both > fileName %in% list.files(pattern="*.mat") > #+END_SRC > > I'm passing the file name as a variable because I want to repeat the same > analysis on different data files. But I would like to see in the HTML output > the value of the above variable =fileName=. I would like essentially to > export the expanded source block. Is there a way to do that? > > Thanks, > > Christophe Hi Christophe, Thanks for reporting the documentation issue, I've just pushed up a patch which updates the documentation appropriately. I do not believe there is a way to export an expanded code blocks, and I fear you may not want to see the variable assignment code in your export. You can however use noweb references to achieve the behavior you are after with the following. #+name: my-file-name : dataFile.mat #+BEGIN_SRC R :exports both :noweb yes <> %in% list.files(pattern="*.mat") #+END_SRC Best, -- Eric Schulte http://cs.unm.edu/~eschulte/