emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Babel #+CALL: results?


From: Phil Regier
Subject: [O] Babel #+CALL: results?
Date: Tue, 12 Nov 2013 16:54:24 -0600 (CST)

I'm new to Babel -- I've been using Org for the last few years just to organize 
and typeset simple LaTeX for PDF and MathJax export -- and furthermore have had 
to compile Emacs from scratch and install into my home directory (installing 
Org as an ELPA package) to get my versions to sync up with the Worg 
documentation, so I may have broken something, but I've had no end of trouble 
trying to get even the simplest named block calls to produce output.

As I understand Worg, and some old list messages from gmane, the following 
should produce meaningful output:

#+NAME: testfun
#+BEGIN_SRC sh :var Var1="Val1"                                                 
                                     
echo "Var1:  $Var1"                                                             
                                     
#+END_SRC                                                                       
                                     

#+CALL: testfun[:results output](Var1="Val3") :results output verbatim

#+RESULTS:
: ""                                                                            
                                     


*Once* I got output, but I could not reproduce this after making and undoing a 
few formatting changes; I would chalk this up to my own cluelessness, except 
that I can get what I *think* is statefully incorrect output from the first 
block:

Iteration 1 (control case):  Begin with only the #+NAME: ... #+END_SRC with 
":results verbatim" and execute block to get

#+NAME: testfun
#+BEGIN_SRC sh :var Var1="Val1" :results output verbatim
echo "Var1:  $Var1"
#+END_SRC

#+RESULTS: testfun
: Var1:  Val1
                                                                                
     

Iteration 2:  Replace ":results output verbatim" with ":results output raw" and 
execute block to get

#+NAME: testfun
#+BEGIN_SRC sh :var Var1="Val1" :results output raw
echo "Var1:  $Var1"
#+END_SRC

#+RESULTS: testfun
Var1:  Val1


Iteration 3:  Change back to ":results output verbatim" and execute block to get

#+NAME: testfun
#+BEGIN_SRC sh :var Var1="Val1" :results output verbatim
echo "Var1:  $Var1"
#+END_SRC

#+RESULTS: testfun
=Var1:  Val1
=Var1:  Val1


Iteration 3+n:  Execute the same block to get

#+NAME: testfun
#+BEGIN_SRC sh :var Var1="Val1" :results output verbatim
echo "Var1:  $Var1"
#+END_SRC

#+RESULTS: testfun
=Var1:  Val1
==Var1:  Val1
==Var1:  Val1
(prev. line repeated n times total)
=Var1:  Val1


Is this intended behavior?  I will admit I don't understand Babel's output 
modes sufficiently well to know for sure; *however*, I also believe my one 
isolated success in getting output from #+CALL: was a side effect of this 
stateful behavior.  If this is likely to be due to a bad install/configuration, 
can anyone clarify the "right" way to get a current org-mode installation (or 
at least, a version that corresponds to one or more "official" online 
documentation repositories) as an unprivileged user on a system that already 
has a prepackaged emacs installation?  If this is intended behavior, where can 
I find the right combination of :results properties to pass output from a named 
block to a later call for display and/or export?

Running from my current home directory installation, here are my emacs and Org 
versions:

GNU Emacs 24.3.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.18.9) of 2013-11-10 
on <host>
Org-mode version 8.2.2 (8.2.2-dist @ /<homedir>/.emacs.d/elpa/org-20131108/)

Any guidance would be greatly appreciated...


Phil Regier
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]