12
votes
How to fix "Symbol's function definition is void: org-babel-get-header"
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 (...
6
votes
Accepted
How to get bash source code blocks to execute .profile / .bashrc
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 $...
5
votes
Accepted
Babel org-mode, how to save the temporary file run
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 ...
4
votes
Accepted
Evaluating `org-babel-clojure` blocks returns nill & result
#+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.
3
votes
org-mode use output of source block in other source block header
Use org-sbe in :dir header to fetch the result from a named block.
Tip: Create dirB directory in same directory as the org-mode example file otherwise the pwd command will throw an error.
#+NAME: ...
3
votes
Why isn't my codeblock executing and displaying the output?
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 ...
3
votes
Accepted
Interpreter discrepancy in org-babel-python and python-mode
Try the full path to python3 inside the double quotes "foo/bar/baz/python3"
3
votes
Accepted
How to display a babel tangled source code block in org-mode?
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 ...
2
votes
Accepted
org-babel-load-file doesn't load entire file
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
votes
org babel sql results output in raw form
ob-sql passes the -A or --no-align option to psql that
Switches to unaligned output mode. (The default output mode is aligned.) This is equivalent to \pset format unaligned.
ob-sql's :cmdline line ...
2
votes
org-mode use output of source block in other source block header
Looks like it might be possible to achieve it by creating a helper lisp function:
#+name: block-1
#+BEGIN_SRC sh
echo '/bin'
#+END_SRC
#+RESULTS: block-1
: /bin
#+begin_src emacs-lisp :results ...
1
vote
org-mode use output of source block in other source block header
You can use org-babel-execute:org from that answer. Just put it in your init file. I think a (require 'cl-lib) in front of it should make the code run in your init file.
Therewith executing an org ...
1
vote
Accepted
Org-mode code blocks and results side-by-side in beamer export?
Here's the Beamer example from the manual, modified to use a python source block (I don't have racket or ob-racket installed):
#+STARTUP: beamer
#+TITLE: Example Presentation
#+AUTHOR: Carsten ...
1
vote
Accepted
Using org-mode babel, how do I quickly export some html soure block to a separate file?
C-c C-v C-t runs org-babel-tangle and exports all code blocks to the current buffer name plus the correct code extension (e.g. html blocks get .html, python blocks get .py). You can specify the ...
1
vote
evaluate src blocks only if individually pressed and not if globally executed
You can "deactivate" a block with the :eval no header argument. You could also try to cache the results, using the :cache yes, which would not re-execute the block unless its contents has changed.
...
1
vote
Confusion about header arguments
The rule is that if you want to specify header arguments for source blocks, then you need to use the various headers-args* properties: only those are consulted when a source block is executed.
You ...
1
vote
Accepted
What is the `'inf-template` file in the ob-template.el file (template for creating new babel language)
In the mean time I discovered some inf-... file on my system. (i.e. inf-lisp.el). From the contents of the file I found that the file defines an inferior lisp mode so that I understand that an inf-... ...
1
vote
Can tangling embed code in external files? instead of recreating files
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
...
1
vote
Accepted
How to generate inline plot result for ob-clojure?
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....
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
babel × 28org-mode × 24
org-babel × 7
literate-programming × 3
init-file × 2
bash × 2
clojure × 2
tangle × 2
postgresql × 2
latex × 1
python × 1
debugging × 1
hooks × 1
yasnippet × 1
flycheck × 1
html × 1
beamer × 1
prelude × 1
rectangle × 1
ruby × 1
sql × 1
inline-image × 1
ein × 1
jupyter × 1