all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Thomas S. Dye" <tsd@tsdye.com>
To: emacs-orgmode@gnu.org
Subject: [babel] noweb for :sessions?
Date: Mon, 19 Oct 2009 07:12:37 -1000	[thread overview]
Message-ID: <CC57D69C-4CC1-4957-AC20-CB84E2039FA0@tsdye.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 661 bytes --]

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
# <<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
http://www.tsdye.com



[-- Attachment #1.2: Type: text/html, Size: 3310 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
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

             reply	other threads:[~2009-10-19 17:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-19 17:12 Thomas S. Dye [this message]
2009-10-19 18:15 ` [babel] noweb for :sessions? Eric Schulte
2009-10-19 18:40   ` Thomas S. Dye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CC57D69C-4CC1-4957-AC20-CB84E2039FA0@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.