Hot answers tagged

11

According to https://lists.gnu.org/archive/html/emacs-orgmode/2015-11/msg00425.html ob-sh was renamed ob-shell in org 8.2 ... and I cite from there: org-babel-get-header was removed in 0d000f5 (babel: small change in API., 2015-10-29), but the old ob-sh.el is still trying to call it. That means you should replace (sh . t) by (shell . t) in your call of ...


3

You can find out how your code is executed by checking ob-shell.el. As for your particular example, your code is passed to bash as stdin, something like the following $ echo 'echo $VAR_DEFINED_IN_BASHRC' | bash It will not work, you need the following instead $ echo 'echo $VAR_DEFINED_IN_BASHRC' | bash -i So you need to run bash interactively (-i) to ...


3

The function org-babel-expand-noweb-referenes will expand the <<noweb>> entries. You can call this function from another source block (use a :wrap header argument to make source the output is wrapped in an appropriate source block): #+NAME: expand-noweb #+BEGIN_SRC elisp :exports none (save-excursion (org-babel-goto-named-src-block name) ...


2

#+begin_src clojure :results pp (+ 1 4) #+end_src #+RESULTS: : 5 #+begin_src clojure :results output (print "Hello World!") #+end_src #+RESULTS: : Hello World! So we have to specify the output.


2

Only if you use the header argument :results value the code of the block is wrapped by a function and the result of the code block is the return value of that function. #+BEGIN_SRC python :exports both :results value return 7 + 7 #+END_SRC On the other hand :results output means that the code of the block is sent to the interpreter. The result of the code ...


2

You have #+end_src emacs-lisp. This confuses org-babel. Use just #+end_src. Use the easy template system to insert structural elements and avoid such issues. Source blocks are <s <TAB>.


2

There are multiple issues going on, which I will do my best to address in a language agnostic manner. Short Generic Answer Use org-babel-expand-src-block1 to preview code that will be executed in the temporary file. Place cursor, i.e. the point, inside the code block on on the #+BEGIN_SRC line. Press C-c C-v v to open new Org-Babel Preview buffer. Debug ...


1

Try the full path to python3 inside the double quotes "foo/bar/baz/python3"


1

There are two options you could use, but I imagine that none are exactly what you want: 1) Create derived classes from the template classes #+begin_src ruby :tangle ./app/models/appuser.rb class AppUser < User after_create :create_braintree_customer def create_braintree_customer Braintree.api_key = "bk-54cfa45" self.id = Braintree::...


1

By pass in target directory as path into Clojure code, and use java.io.File.renameTo to move generate plot image file to target dir. Here is the complete story background: https://stardiviner.github.io/Blog/Clojure-Plotting-to-Org-inline-image-in-ob-clojure.html Here is a complete example: #+begin_src clojure :results file link :dir "data/images" :file "...


Only top voted, non community-wiki answers of a minimum length are eligible