From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christophe Pouzat Subject: Re: Question related to org-babel-expand-src-block Date: Fri, 03 Feb 2012 21:20:54 +0100 Message-ID: <87y5sjwtw9.fsf@xtof-netbook.home> References: <87ty3915t6.fsf@xtof-netbook.home> <87bopfsqf7.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:57545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtPcz-0005am-Kd for emacs-orgmode@gnu.org; Fri, 03 Feb 2012 15:21:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RtPcx-0005Jh-V5 for emacs-orgmode@gnu.org; Fri, 03 Feb 2012 15:21:01 -0500 Received: from mail-wi0-f169.google.com ([209.85.212.169]:61289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtPcx-0005JW-Nt for emacs-orgmode@gnu.org; Fri, 03 Feb 2012 15:20:59 -0500 Received: by wibhj13 with SMTP id hj13so4136561wib.0 for ; Fri, 03 Feb 2012 12:20:58 -0800 (PST) In-Reply-To: <87bopfsqf7.fsf@gmx.com> (Eric Schulte's message of "Fri, 03 Feb 2012 11:49:32 -0700") 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: Eric Schulte Cc: emacs-orgmode@gnu.org Eric Schulte writes: > Christophe Pouzat writes: > >> Hi all, >> >> Using the last org-mode version from the git repository (7.8.03) I've fo= und a >> mismatch between the key-chord required to call function >> =3Dorg-babel-expand-src-block=3D (=3DC-c C-v v=3D) and the ones given in= the >> info file: =3DC-c C-v p=3D or =3DC-c C-v C-p=3D. The same goes for the >> [[http://orgmode.org/worg/org-contrib/babel/intro.html][Babel: >> Introduction]] where the given key-chord is =3DC-c M-b p=3D.=20 >> >> 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 =3D.org=3D file a variable containing a file name like: >> >> #+name: my-file-name >> : dataFile.mat >> >> I want then a code block (using =3DR=3D in that case) that checks if >> "dataFile.mat" is in the working directory with something like: >> >> #+BEGIN_SRC R :var fileName=3Dmy-file-name :exports both >> fileName %in% list.files(pattern=3D"*.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 ou= tput >> the value of the above variable =3DfileName=3D. 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=3D"*.mat") > #+END_SRC > > Best, Hi Eric, I agree with you: I don't want to see the variable assignment code in my export in general =E2=80=93 in particular if this means assigning a big mat= rix to a variable. I will try your noweb suggestion for the few cases where I want to export the assignment. Thanks for your help. Christophe=20 --=20 Most people are not natural-born statisticians. Left to our own devices we are not very good at picking out patterns from a sea of noisy data. To put it another way, we are all too good at picking out non-existent patterns that happen to suit our purposes. Bradley Efron & Robert Tibshirani (1993) An Introduction to the Bootstrap -- Christophe Pouzat MAP5 - Math=C3=A9matiques Appliqu=C3=A9es =C3=A0 Paris 5 CNRS UMR 8145 45, rue des Saints-P=C3=A8res 75006 PARIS France tel: +33142863828 mobile: +33662941034 web: http://www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.html