emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thomas S. Dye <tsd@tsdye.com>
To: Grant Rettke <gcr@wisdomandwonder.com>
Cc: Jarmo Hurri <jarmo.hurri@iki.fi>,
	"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Local variables in an org file
Date: Thu, 20 Aug 2015 16:52:13 -1000	[thread overview]
Message-ID: <m237zdtkte.fsf@tsdye.com> (raw)
In-Reply-To: <CAAjq1meoBzsTQxUw5g1o4rbn-WGnw0oWwY-OdHU-mzbGbRJLcA@mail.gmail.com>

Aloha all,

Grant Rettke <gcr@wisdomandwonder.com> writes:

> I've been thinking about this all week. Must be in the global memory space.
> Grant Rettke

Here is one way.

* Define a local variable
#+name: my-var
#+header: :exports none
#+begin_src R
768
#+end_src

#+name: pass-my-var-to-code-block
#+header: :var x=my-var
#+header: :exports both
#+begin_src emacs-lisp
(+ x 1)
#+end_src

#+results: pass-my-var-to-code-block
: 769

The variable is call_my-var().

When I export this to an ASCII buffer, I get:

1 Define a local variable
=========================

  ,----
  | (+ x 1)
  `----

  ,----
  | 769
  `----

  The variable is `768'.

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com

  reply	other threads:[~2015-08-21  2:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-20  6:39 Local variables in an org file Jarmo Hurri
2015-08-21  2:23 ` Grant Rettke
2015-08-21  2:52   ` Thomas S. Dye [this message]
2015-08-21 10:54     ` Jarmo Hurri
2015-08-21 11:57       ` Rainer M Krug
2015-08-21 17:08       ` 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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=m237zdtkte.fsf@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=gcr@wisdomandwonder.com \
    --cc=jarmo.hurri@iki.fi \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).