From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: [babel] noweb for :sessions? Date: Mon, 19 Oct 2009 07:12:37 -1000 Message-ID: Mime-Version: 1.0 (Apple Message framework v936) Content-Type: multipart/mixed; boundary="===============0421910715==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mzvmo-0000kJ-KZ for emacs-orgmode@gnu.org; Mon, 19 Oct 2009 13:12:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mzvmk-0000je-Sx for emacs-orgmode@gnu.org; Mon, 19 Oct 2009 13:12:46 -0400 Received: from [199.232.76.173] (port=34610 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mzvmk-0000jb-Pw for emacs-orgmode@gnu.org; Mon, 19 Oct 2009 13:12:42 -0400 Received: from outbound-mail-27.bluehost.com ([69.89.17.193]:57361) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Mzvmk-00088A-A5 for emacs-orgmode@gnu.org; Mon, 19 Oct 2009 13:12:42 -0400 Received: from 176.sub-75-208-230.myvzw.com ([75.208.230.176]) by box472.bluehost.com with esmtpa (Exim 4.69) (envelope-from ) id 1Mzvmh-0004KV-Bv for emacs-orgmode@gnu.org; Mon, 19 Oct 2009 11:12:40 -0600 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============0421910715== Content-Type: multipart/alternative; boundary=Apple-Mail-77-639767351 --Apple-Mail-77-639767351 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Aloha all, Is it possible to define frequently used code snippets in a generic way so they can be used in different sessions? Something like this is what I have in mind: #+srcname: r-connect #+begin_src R :exports none :session any library(rMySQL) con <- dbConnect(MySQL(), user="user_name", password="password", dbname="db_name", host="host_name") #+end_src #+srcname: r-query #+begin_src R :session session-1 # <> res <- dbGetQuery(con, "select * from table_name where 1") #+end_src Tom Thomas S. Dye, Ph.D. T. S. Dye & Colleagues, Archaeologists, Inc. Phone: (808) 529-0866 Fax: (808) 529-0884 http://www.tsdye.com --Apple-Mail-77-639767351 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Aloha = all,

Is it possible to define frequently used code = snippets in a generic way so they can be used in different = sessions?

Something like this is what I have in = mind:

#+srcname: = r-connect
#+begin_src R :exports none :session = any
library(rMySQL)
con <- dbConnect(MySQL(), = user=3D"user_name", password=3D"password", 
   =                   = dbname=3D"db_name", = host=3D"host_name")
#+end_src

#+srcname= : r-query
#+begin_src R :session session-1 
# = <<r-connect>>
res <- dbGetQuery(con, = "select * from table_name where = 1")
#+end_src

Tom

=

Thomas S. Dye, Ph.D.

T. S. Dye & Colleagues, = Archaeologists, Inc.

Phone: (808) 529-0866 Fax: (808) 529-0884

=

= --Apple-Mail-77-639767351-- --===============0421910715== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0421910715==--