1
votes

When passing arguments to code block that exports results Org-mode fails to export with the error "Wrong type argument: listp". How can I fix this?

Here is an example. When it is exported it gives the error 'Wrong type argument: listp, "bar"'.

#+TITLE: Example

#+SOURCE: example-one
#+BEGIN_SRC emacs-lisp :exports results
(setq foo "bar")
#+END_SRC

#+SOURCE: example-two
#+BEGIN_SRC emacs-lisp :exports results :var x=example-one
(setq foo (concat x x))
#+END_SRC

I am running Org-mode 7.6 in Emacs 23.3.1.

2
Your examples don't give this error in org-mode 7.8. Asking this question on the org-mode mailing list seems more appropriate.pmr

2 Answers

1
votes

This issue might simply be with the older copy of Org that you're running. Tested it today with a recent git pull and get the results below. As pmr suggested, you might have better luck asking on the mailing list ( [email protected] ) since there might be someone there who would know what caused this issue and what might have been changed to resolve it in later versions.

The features and examples discussed in the manual are based on the current release version (7.8.03 in this case) so they will not always be compatible with older versions. Does the info-node in your version indicate that it should work?

These 2 commands will show you the associated info-nodes for that section of the Org Manual

; The node itself
(Info-goto-node "(org) var") 
; Parent node, in case the first node isn't present
(Info-goto-node "(org) Working With Source Code") 

Test Results

* Test variable passing
Headlines are created to split the code blocks apart.  When trying to eval on export I'm getting a syntax read error which was reported here: http://lists.gnu.org/archive/html/emacs-orgmode/2012-01/msg00993.html 

** Ex 1
#+name: example-one
#+BEGIN_SRC emacs-lisp :exports results
(setq foo "bar")
#+END_SRC

** Ex 2

#+name: example-two
#+BEGIN_SRC emacs-lisp :exports results :var x=example-one
(setq foo (concat x x))
#+END_SRC
\vspace*{1cm}
Headlines are created to split the code blocks apart.  When trying to eval on export I'm getting a syntax read error which was reported here: \href{http://lists.gnu.org/archive/html/emacs-orgmode/2012-01/msg00993.html}{http://lists.gnu.org/archive/html/emacs-orgmode/2012-01/msg00993.html} 

\section{Ex 1}
\label{sec-1}



\begin{verbatim}
 bar
\end{verbatim}
\section{Ex 2}
\label{sec-2}




\begin{verbatim}
 barbar
\end{verbatim}
-1
votes

in your .emacs file - make sure you have the following line:

(setq org-babel-load-languages (quote ((emacs-lisp . t))))