Questions tagged [babel]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

condition on “if the source code block is tangled”

is there a way to query if the current source code block is tangled and if so, to execute e.g. shell stuff depending on if it was or not? I know I can make tangling conditional, but can one also do ...
0
votes
1answer
15 views

evaluate src blocks only if individually pressed and not if globally executed

Is there a way to enable source block execution only if C-c C-c is pressed and keep them silent when C-c C-v C-b is used, i.e. all source blocks are executed?
0
votes
1answer
32 views

Confusion about header arguments

I get that there are different levels at which Header arguments in org mode, specifically LP can be defined and that the more specialized ones, i.e. deeper within the tree hierarchy, take precedence ...
1
vote
3answers
242 views

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: ...
0
votes
0answers
17 views

how to check if a babel block finished the execution

I am searching for a piece of emacs-lisp code that checks if an emacs-babel block finished its execution. I am trying to write smth like (while (babel-block not finished its execution) (sleep-...
1
vote
0answers
18 views

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 ...
3
votes
1answer
34 views

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, ...
0
votes
1answer
60 views

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 ...
0
votes
0answers
10 views

Feeding narrowed org subtree contents to a babel block of code?

I have a usecase where I make structured notes under an org heading, and then would like to occasionally perform some little analytics to the contents. Currently I have to navigate to the heading, ...
1
vote
1answer
74 views

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 <stdio.h> int main () { printf("Hello, World!"); return 0; } #+END_SRC How can I use the compiled output in another ...
0
votes
2answers
87 views

Why isn't my codeblock executing and displaying the output?

I have an org-mode file, with org-mode version 9+ (so my understanding is that Babel should be integrated). Then I have the following in the file #+BEGIN_SRC python :exports both :results output ...
2
votes
1answer
738 views

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, ...
4
votes
0answers
140 views

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 ...
1
vote
1answer
417 views

Interpreter discrepancy in org-babel-python and python-mode

(Emacs version 26.1, Org version 9.1.9) I have tried numerous solutions to get working in org-mode source blocks. This solution works to change python-mode to utilize the Python3 interpreter, which I ...
1
vote
0answers
48 views

Org-mode :results file hook to launch file

My scenario python code creating a wav file last line of code returns the written file name org-mode src block with the option :results file The result block correctly links to the audio file, and I ...
3
votes
2answers
393 views

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 ...
2
votes
0answers
156 views

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, ...
2
votes
1answer
144 views

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://...
7
votes
1answer
3k views

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 ...
1
vote
1answer
507 views

org-babel-load-file doesn't load entire file

In ~/.emacs.d/init.el I'm calling my annotated configurations file settings.org like so: (require 'ob-tangle) (org-babel-load-file (expand-file-name "~/.emacs.d/settings.org")) This generates ...
5
votes
2answers
595 views

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 :...
4
votes
1answer
455 views

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 :...
1
vote
1answer
433 views

Error when (stata . t) added to org-babel-do-load-languages in an attempt to evaluate Stata code in org-mode [closed]

Important Note: As of Spring 2020, ob-stata.el via Emacs Speaks Statistics has been deprecated. Even the updated version described below in this thread is broken. I (the author of the updated ob-...
2
votes
0answers
412 views

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, ...