Questions tagged [babel]

26 questions
8
votes
1 answer

How to fix "Symbol's function definition is void: org-babel-get-header"

How do you trouble shoot this? (trying to run a sh block async) #+BEGIN_SRC sh /tmp/7.sh …
american-ninja-warrior
  • 3,773
  • 2
  • 21
  • 40
5
votes
2 answers

How to display a babel tangled source code block in org-mode?

I have simple code blocks that I would like to show the noweb generated source for inside the same org-mode file. eg: #+NAME: example #+BEGIN_SRC java :classname Test :results code :exports both :tangle yes :noweb yes <> String result =…
E Bro
  • 133
  • 4
4
votes
0 answers

Flycheck Emacs Lisp in Org-mode babel source blocks

I want to have Flycheck syntax checking when I am editing Emacs Lisp code in a literal Org-mode file using babel SRC blocks. (Using Org's editing buffers with C-c '). However the flycheck-emacs-lisp checker predicate has the following to…
Matthew Piziak
  • 5,958
  • 3
  • 29
  • 77
4
votes
1 answer

How to generate inline plot result for ob-clojure?

Question: How to generate inline plot image result in Org-mode babel clojure src block? I tried some ways: First way: use :results file :file "clojure-babel-figure-result.png" #+BEGIN_SRC clojure :session :results file :file…
stardiviner
  • 1,888
  • 26
  • 45
3
votes
1 answer

org babel sql results output in raw form

Is the way to get same output as in terminal with ob-doc-sql. Executing the sql-query in org will process results into org-table ignoring other than table information. It doesn't fare well with multiple query in the block as show below will squash…
rho
  • 243
  • 2
  • 10
3
votes
1 answer

What is the `'inf-template` file in the ob-template.el file (template for creating new babel language)

Because the options provided by the mathematica.el file in org-contrib are quite limited, I am trying to create a new, extended, mathematica.el file. As explained on the org language development page, I start out with the ob-template.el file.…
dalanicolai
  • 6,108
  • 7
  • 23
3
votes
1 answer

How to get bash source code blocks to execute .profile / .bashrc

I don't understand how the source code blocks work exactly. There are some variables, definitions and aliases in my .bashrc that I think I should be able to use in the source code blocks. However, when I run something like the following, the output…
cammil
  • 509
  • 3
  • 12
3
votes
2 answers

Babel org-mode, how to save the temporary file run

How can I save the temporary file that is used to run the script in a babel code block? I need to debug why the perl mode is not able to read values as tables any more. Example: #+BEGIN_SRC perl print "hello world\n"; #+END_SRC this…
dmg
  • 629
  • 4
  • 13
2
votes
0 answers

Reference env variable in org babel source block headers

I am setting up an org-mode document to connect to a postgreSQL database and execute+show the results of some queries. I don't want the database password visible in the org document (regardless of whether the document is exported: I want to be able…
dlid
  • 121
  • 5
2
votes
3 answers

org-mode use output of source block in other source block header

Is it possible to use the result of one source code block not within another code block but actually within another source blocks header argument? I know this piece of functionality works #+name: block-1 #+BEGIN_SRC…
CD86
  • 543
  • 2
  • 9
2
votes
1 answer

Is there a way to run a shell command on a previously compiled C org source block?

If i have the following block: #+NAME: my-code #+BEGIN_SRC C #include int main () { printf("Hello, World!"); return 0; } #+END_SRC How can I use the compiled output in another source block? #+BEGIN_SRC sh :noweb yes file…
spw
  • 21
  • 1
2
votes
0 answers

Aligning (ditaa) rectangles with variable string width in yasnippet

To quickly add simple diagrams to notes, I've created yasnippets for ditaa boxes. The text inside each box is a $x - and therefore has a length I do not know at snippet design time. As a consequence, the ditaa boxes are not aligned the way they…
Werner
  • 355
  • 2
  • 9
2
votes
1 answer

Can tangling embed code in external files? instead of recreating files

I'm building a web application using the literate programming style. At least trying to. I wanted to "hit the ground running", so I decided "make a copy" of one of the many "starter apps" https://github.com/RailsApps/rails-bootstrap So before I have…
american-ninja-warrior
  • 3,773
  • 2
  • 21
  • 40
2
votes
0 answers

Using a function as an org-babel header argument

Say I am using org-babel to tangle code blocks from an org document. I have several blocks with random code in them. My goal is to dynamically tangle (or not) individual blocks following a condition, for example, contents of first line of block,…
csantosb
  • 1,045
  • 6
  • 15
1
vote
1 answer

Evaluating `org-babel-clojure` blocks returns nill & result

Why the results is 'nil5'? Can't be just 5? #+begin_src clojure :results (+ 1 4) #+end_src #+RESULTS: : nil5 Also: #+begin_src clojure (print "Hello World!") #+end_src #+RESULTS: : nilnil I was expected just to print "Hello World!" in RESULTS.
slk500
  • 461
  • 2
  • 14
1
2