From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: including the result of a block in several places? Date: Mon, 10 Dec 2012 09:57:04 +0100 Message-ID: References: <8038zh3eil.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:37218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ThzBp-0001Dk-4m for emacs-orgmode@gnu.org; Mon, 10 Dec 2012 03:58:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ThzBj-0003P4-4K for emacs-orgmode@gnu.org; Mon, 10 Dec 2012 03:58:17 -0500 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:9130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ThzBi-0003Oj-UF for emacs-orgmode@gnu.org; Mon, 10 Dec 2012 03:58:11 -0500 In-Reply-To: (Thomas S. Dye's message of "Sat, 08 Dec 2012 06:57:57 -1000") 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: "Thomas S. Dye" Cc: emacs-orgmode@gnu.org tsd@tsdye.com (Thomas S. Dye) writes: > I've had these in my .emacs for quite a while and they seem to work: > > ** ON Load Standard Library of Babel > #+begin_src emacs-lisp :tangle yes > (org-babel-lob-ingest "~/.emacs.d/src/org-mode/contrib/babel/library-of-babel.org") > #+end_src Thanks a lot, I'm now able to call the "echo" function. Unfortunately it does not exactly do what I want (but I was not really clear about what I wanted first). Here is the code I have (don't worry about the code inside the blocks, the idea is that I want a source block and its results on two different slides, without having to duplicate them): #+begin_src org ** Prototype-based objects #+name: object_example #+begin_src js :results code output :exports both var f = function(a) { this.x = a } f.prototype = {y : 1} var o = new f (42) console.log("o.x = " + o.x + ", o.y = " + o.y) #+end_src Results #+results: object_example ** Prototypes resolution #+BEGIN_SRC coq Inductive proto : heap -> field -> loc -> loc -> Prop := | proto_null : forall h f, proto h f loc_null loc_null | proto_here : forall h l f, indom h l f -> proto h f l l | proto_next : forall h l f l' l'', ~ indom h l f -> binds h l field_proto l' -> proto h f l' l'' -> proto h f l l''. #+END_SRC ** Prototype-based objects #+call: echo(object_example) :results code output :exports both #+end_src My problem is twofold. - The code from "object_example" is not repeated. I guess that here what I want is to be able to export a source code block in several places. Is it possible? - The highlighting of the results in the "#+call:" line is not in javascript syntax, and I don't know how to tell the call that the result will be javascript. Thanks again, Alan