From mboxrd@z Thu Jan 1 00:00:00 1970 From: jenia.ivlev@gmail.com (jenia.ivlev) Subject: Re: babel, header arguments. Date: Fri, 21 Nov 2014 15:55:43 -0500 Message-ID: <87r3wwgto0.fsf@gmail.com> References: <8761ec2vsp.fsf@gmail.com> <86389emcxa.fsf@example.com> <87h9xsibxv.fsf@gmail.com> <87bno0iadl.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrvCm-0000PO-0g for emacs-orgmode@gnu.org; Fri, 21 Nov 2014 15:53:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrvCg-0008Oz-CN for emacs-orgmode@gnu.org; Fri, 21 Nov 2014 15:53:23 -0500 Received: from plane.gmane.org ([80.91.229.3]:33774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrvCg-0008Os-5a for emacs-orgmode@gnu.org; Fri, 21 Nov 2014 15:53:18 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XrvCe-0001ug-2y for emacs-orgmode@gnu.org; Fri, 21 Nov 2014 21:53:16 +0100 Received: from modemcable112.235-178-173.mc.videotron.ca ([173.178.235.112]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 Nov 2014 21:53:16 +0100 Received: from jenia.ivlev by modemcable112.235-178-173.mc.videotron.ca with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 Nov 2014 21:53:16 +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: emacs-orgmode@gnu.org tsd@tsdye.com (Thomas S. Dye) writes: > jenia.ivlev@gmail.com (jenia.ivlev) writes: > >> tsd@tsdye.com (Thomas S. Dye) writes: >> >>> Aloha, >>> >>> jenia.ivlev@gmail.com (jenia.ivlev) writes: >>> >>>> Also, what if I want to import the actual function defintion into >>>> another src block: >>>> >>>> #+begin_src scheme >>>> (+ (my-plus 3 4) 1) >>>> #+end_src >>>> something here that import the previous function definitions >>>> >>>> Is that possible? >>> >>> Yes, see section 14.10 Noweb reference syntax in the manual. >>> >>> You'll have something that looks like this: >>> >>> #+header: :noweb yes >>> #+begin_src scheme >>> <> >>> (+ (previous-function 3 4) 1) >>> #+end_src >>> >>> hth, >>> Tom >> >> What do you mean? <> should be replaced >> with the actual function definition? But I use babel-mode so that I can >> interlace code in a natural language document. I want these src blocks >> to be separate. >> >> > > Sorry, it refers to the name of the source code block. > > ,------------------------------------------------------------------------- > | The “noweb” (see ) Literate > | Programming system allows named blocks of code to be referenced by using > | the familiar Noweb syntax: > | > | <> > `------------------------------------------------------------------------- > > hth, > Tom I have one last quick question, I have an exmaple here with no-web that I think should work but doesnt. I wonder why: #+BEGIN_SRC C :noweb-ref begin int main() { printf("Line 1\n"); #+END_SRC #+BEGIN_SRC C :noweb-ref middle printf("Second\n"); #+END_SRC #+BEGIN_SRC C :noweb-ref end } main(); #+END_SRC #+BEGIN_SRC C :noweb yes <> <> <> printf("some appropriate debug word"); #+END_SRC And the output is: /tmp/babel-15080Ms4/C-src-150805OE.c: In function ‘main’: /tmp/babel-15080Ms4/C-src-150805OE.c:6:7: warning: incompatible implicit declaration of built-in function ‘printf’ printf("Line 1\n"); ^ /tmp/babel-15080Ms4/C-src-150805OE.c: At top level: /tmp/babel-15080Ms4/C-src-150805OE.c:10:5: warning: data definition has no type or storage class main(); ^ /tmp/babel-15080Ms4/C-src-150805OE.c:12:8: error: expected declaration specifiers or ‘...’ before string constant printf("asti"); ^ /bin/bash: /tmp/babel-15080Ms4/C-bin-15080GZK: Permission denied Or if I dont include the printf("some appropriate debug word"); then, I get no output at all. `Code block produced no output.` So my question is how do I make this work. lol. Thanks in advance again