4

I am a beginner who wants to evaluate a Call to a code block in an org-file and get the same results as when I evaluate the actual code block. Like so:

#+NAME: Myblock
#+BEGIN_SRC emacs-lisp :results output raw
  (progn
    (princ "Hello"))
#+END_SRC

Which gives:

#+RESULTS:  
Hello

But when I do

#+CALL: Myblock()

It gives me

#+RESULTS:
: Hello

I tried to give arguments to the call, but it didn't seem to affect it at all.

Please help!

/HC

  • Which version of Org-mode are you using (M-x org-version)? I tested your example on 9.0.9 and did not see the colon. – Wojciech Gac Aug 16 '17 at 10:47
  • I am using 8.2.10, that I guess came with the Emacs installation. I am on a machine using Mac OS X Sierra. Thank you for answering! I will look into how I can upgrade org! – Hans Christian Aug 16 '17 at 10:50
  • I upgraded, but it then says that execution of the code block has been blocked. It doesn't matter whether try to evaluate the code or the call. Also, ox-pandoc stops working properly when I upgrade. I remember now that I had to remove the org library from .emacs/elpa in order to make ox-pandoc work. – Hans Christian Aug 16 '17 at 11:13
  • 1
    I solved it! It's not pretty, but: "#+CALL: Longerblock[:results output]() :results raw" gives the correct result. I wish I could do that in just one word though! – Hans Christian Aug 16 '17 at 11:40
  • 1
    You could try language-specific headers like here. – Wojciech Gac Aug 16 '17 at 11:46
0

Once upgraded, add () to the #+call: line. This works for me.

  • Thank you for pointing this out -- I forgot to add "()" when I wrote the post. I corrected it now. In the org document I've had them all along though. It would seem upgrading solves the issue, only I can't get the upgrade to work properly (see the comments on the initial post). Thanks for helping out! – Hans Christian Aug 16 '17 at 12:56
  • Hans, when you upgrade org-mode you should also install org-plus-contrib. I had the same problem when I upgraded to version 9, it didn't execute the source code blocks until I installed that additional package. See orgmode.org/elpa.html – Martín Oct 16 '17 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.