Reputation: 37
Using org, I'd like to execute Lisp code which prints the value of a variable into a results block. E.g. I'm trying to print the value of org-babel-default-header-args
.
I've tried this:
#+BEGIN_SRC elisp :exports both
(print 'org-babel-default-header-args)
#+END_SRC
#+BEGIN_SRC elisp :exports both
(org-babel-default-header-args)
#+END_SRC
#+BEGIN_SRC elisp :exports both
(symbol-value 'org-babel-default-header-args)
#+END_SRC
The closest thing I've gotten to work is this:
#+BEGIN_SRC elisp :exports both
(describe-variable 'org-babel-default-header-args)
#+END_SRC
But that prints out some extra text. I'd like to literally just print the value of the variable.
Upvotes: 1
Views: 526
Reputation: 6412
To print the value of a variable foo
, use
(print foo)
without quoting it. Quote inhibits evaluation: that's exactly what you don't want to do here.
Upvotes: 2