Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [babel]

The tag has no usage guidance.

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

Header arguments for emacs-jupyter

The following example uses emacs-jupyter. I'm happy with the result (i.e. display inside emacs, and export to LaTeX), but I'm unhappy that the second and the third code block use different header ...
Andreas Matthias's user avatar
0 votes
1 answer
173 views

Customise org babel block color

Customise org-babel source block color such that: when the block is folded, the #+begin_src line is the default color when the block is open, the #+begin_src and #+end_src lines are highlighted a ...
user615536's user avatar
2 votes
0 answers
176 views

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 ...
dlid's user avatar
  • 121
0 votes
2 answers
247 views

Using org-mode babel, how do I quickly export some html soure block to a separate file?

I am taking notes on a course in org-mode. I am using HTML source-blocks to write down examples of html code. This serves me because I have text and code in one file and it will be easier to export it ...
mor3dr3ad's user avatar
0 votes
0 answers
54 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 ...
CD86's user avatar
  • 573
0 votes
1 answer
21 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?
CD86's user avatar
  • 573
0 votes
1 answer
131 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 ...
CD86's user avatar
  • 573
3 votes
3 answers
2k 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: ...
CD86's user avatar
  • 573
0 votes
0 answers
30 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-...
mhass's user avatar
  • 11
3 votes
1 answer
486 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 ...
rho's user avatar
  • 253
3 votes
1 answer
81 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, ...
dalanicolai's user avatar
  • 7,855
1 vote
1 answer
172 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 ...
slk500's user avatar
  • 471
2 votes
1 answer
167 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 ...
spw's user avatar
  • 21
0 votes
2 answers
458 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 ...
Ed Prince's user avatar
  • 101
3 votes
1 answer
1k 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, ...
cammil's user avatar
  • 509
4 votes
0 answers
356 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 ...
Matthew Piziak's user avatar
1 vote
1 answer
709 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 ...
ch-pub's user avatar
  • 220
1 vote
0 answers
59 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 ...
actondev's user avatar
4 votes
2 answers
1k 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 ...
dmg's user avatar
  • 659
2 votes
0 answers
301 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, ...
Werner's user avatar
  • 355
2 votes
1 answer
156 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://...
american-ninja-warrior's user avatar
8 votes
1 answer
5k 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 ...
american-ninja-warrior's user avatar
1 vote
1 answer
740 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 ...
pandita's user avatar
  • 235
5 votes
2 answers
1k 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 :...
E Bro's user avatar
  • 133
4 votes
1 answer
674 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 :...
stardiviner's user avatar
  • 1,938
1 vote
1 answer
556 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-...
Daniel's user avatar
  • 99
2 votes
0 answers
761 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, ...
csantosb's user avatar
  • 1,075