Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

feature of Org mode that handles source code for multiple languages. It can execute source code from within Org mode documents, making it convenient for producing literate programming documents and managing reproducible research. Note that [tag:org-babel] is now incorporated into [tag:orgmode] as `...

1
vote
1answer
43 views

quickly clear org babel results buffer

How to quickly remove this bit #+RESULTS: :RESULTS: ...
2
votes
0answers
31 views

Setting org-babel-load-languages in .dir-locals.el

As per the title, I'd like to set the org-babel-load-languages (to contain ditaa and calc languages) for a specific project only. The only solution I found so far is this one ( (org-mode . ...
0
votes
0answers
14 views

How to update code specific header argument in org mode

For the :file argument, I want to update it when I press C-c C-c (org-ctrl-c-ctrl-c)
0
votes
1answer
31 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
1answer
29 views

Set correct gnuplot version

Due to a bug, I want to execute LD_PRELOAD=/lib/x86_64-linux-gnu/libreadline.so.6 gnuplot instead of just gnuplot to create plots with gnuplot. I already put an alias in my zsh source file, so that ...
3
votes
1answer
29 views

Evaluating all elisp org source blocks in buffer

Is there a way to evaluate all elisp org source blocks in the current buffer? The best I have now is: save to file, and do: (org-babel-load-file buffer-file-name) Is there a more direct way?
1
vote
1answer
72 views

SVG image from org-babel

I am trying to create a SVG image from latex code in an org-mode file. #+name: foo #+header: :file foo.svg #+begin_src latex bar #+end_src But I keep getting the following error: executing Latex ...
1
vote
1answer
55 views

How to add hline and column sum to bottom of table using a src block?

I want to (non-interactively) add (one hline and) a last line to a table in which the last column is summed. Like so: #+name: mytable | p | q | |---+---| | a | 5 | | b | 2 | #+begin_src emacs-...
0
votes
0answers
43 views

ledger in org-babel blocks uses incorrect path data in Windows 10

I am trying to include a ledger data file from an org-babel block. I am using Windows10 and the SciMax emacs distribution. #+begin_src ledger :cmdline bal :results output :exports results !include d:/...
1
vote
1answer
32 views

Dynamic IP address for org babel ssh dir param

I use this in emacs to connect and execute commands remotely: #+BEGIN_SRC sh :dir /ssh:app_user@34.143.149.84:/tmp pwd #+END_SRC #+RESULTS: : /tmp Recently, people have gone "cloud scaling" so the ...
2
votes
2answers
76 views

Running elisp within an orgmode code block

Consider the following elisp source code within a .org file: #+BEGIN_SRC elisp :results silent (delete-other-windows) (split-window-right) (switch-to-buffer-other-window '"*Python*") #+END_SRC This ...
4
votes
1answer
42 views

Inline babel source blocks in org table

(How) can I include (or their resulting variables) in an org table? * Inline code in table src_R{1+1} | src_R{1+1} | when exported to, e.g. HTML, results in Inline code in table 2 src_R{1+1}
1
vote
2answers
83 views

Accessing properties in org-babel source code blocks

noweb expantion is a very nice tool but it generally allows one to refer to other src-code blocks: #+NAME: hellomessage #+BEGIN_SRC emacs-lisp "hello" #+END_SRC #+BEGIN_SRC emacs-lisp :noweb yes (...
0
votes
0answers
12 views

How do I export the code behind a CALL block?

Emacs 25.3.1, Org 9.1.13 from GNU ELPA. I'm using the Library of Babel to store some code blocks that I frequently use. I incorporate them into my workflow just fine with #+CALL: some_lob_function()...
1
vote
0answers
57 views

Org-babel: Set root dir for tangled files

I have started using org-babel for a larger project, and have found the readthedocs to be a great resource. I have been using tangling to generate code from documentation, however setting the export ...
0
votes
1answer
29 views

How to prevent org-mode loading babel's major mode stuffs unless entering `org-src-mode`?

I have some Java's scripts in a org file. And I use meghanada-mode in java-mode. Each time I open this org file and do nothing, I get the following error since the mehanada server loaded by java-mode ...
2
votes
1answer
35 views

Org Mode's :output-dir and :file-ext arguments cause ALL output to be saved to files

Org Mode's Babel for executing code blocks provides two header arguments, :output-dir and :file-ext that were clearly intended to be used in the global document header, applying to all blocks. They ...
1
vote
0answers
72 views

how to “slow” down the execution of code blocks

on OSX 10.13.4 with emacs 25.3 and org-mode 9.1.12. Python is 3.5.2 with matplotlib 2.2.2 I am trying to find a way to have org-mode babel for python to slow down in some of the points of my code ...
0
votes
1answer
153 views

Python in org babel will not work

I've recently moved to a new computer and cannot get org babel to work with Python (it worked fine on my old machine). I'm using OS X 10.12.6 with Emacs for Mac OS X based on Emacs 25.3 with org-mode-...
1
vote
0answers
44 views

Org mode elisp in :var in header-args causing max-specpdl-size error

In org mode, :var header arg definitions can actually call functions, which is very nice! However I've run into a problem that I can't explain, exemplified by the following org file: #+NAME: add3 #+...
2
votes
0answers
24 views

Re-apply table formulas on org-mode export

I'm using an org-mode file to do some filesystem monitoring. To that purpose I have a table in which I'm calling code blocks through org-sbe in the formulas. It looks like this: #+NAME: part-size #+...
1
vote
0answers
37 views

get contents of source block

I'm trying go get the src block contents with (org-element-property :value (org-element-at-point)), but when I apply this on a block like: #+BEGIN_SRC emacs-lisp (print "foo") #+END_SRC the result ...
2
votes
2answers
147 views

ob-tangle or not?

I'm experimenting with Uncle Dave's config which is using a minimum init.el to launch config.org, which is full of elisp babel source blocks. Here's his relevant launching code: (when (file-readable-...
3
votes
1answer
88 views

How do I generate & tangle source code in a different language?

In an org file, I have a Perl source code block that generates SQL code. The Perl code is to be part of the exported document, but the SQL code is not; it is supposed to be tangled to the ...
0
votes
1answer
29 views

Trouble with org-export-before-processing-hook in .emacs

When I eval (add-hook 'org-export-before-processing-hook #'org-update-all-dblocks) in an emacs session, function org-update-all-dblocks seems to be called at the preprocessing stage of export, as ...
3
votes
2answers
132 views

Managing code libraries with org-babel

I want to take a literate programming approach to managing my library of code snippets with org-babel. I have a ~/Code folder which I use to save various org-mode documents, each of which contains a ...
0
votes
0answers
37 views

ob-ipython src code in mu4e-org message image location

Background The way to include ipython source code for data analysis, including the plotting library matplotlib in org-babel, is to start a jupyter-console in a shell and then copy the json kernel ...
2
votes
1answer
61 views

Querying remote postgres from org

this is a bit complicated, please bear with me I want to use org-babel to query postgresql, and I can do it for DBs that I can access directly from my localhost: #+begin_src sql :engine postgresql :...
1
vote
0answers
39 views

Save org-babel output with org-attach

I am using org-babel to write R code in Emacs org-mode. Here's an example: #+BEGIN_SRC R :session *R* :results output graphics :width 5 :height 5 data(AirPassengers) AP <- AirPassengers plot(AP) ...
1
vote
1answer
47 views

Force org to use `:` instead of `begin_example` for source block output

When executing a source block in org mode with the output set to verbatim, it will sometimes wrap the results in an #begin_example block, and sometimes it uses : symbols at the beginning of the line. ...
2
votes
0answers
72 views

Prevent Org mode from raising Emacs frame while exporting to PDF

Some of my org mode files take a long time to export because they include code for number crunching that is executed during export (via Org Babel) . I usually minimize the Emacs frame while the ...
2
votes
1answer
49 views

How to make org-babel call all remote code blocks under a specific headline?

For example, I have following org file: ***** user level ****** copy system service file At first copy system's systemd service file to systemd user level. by check it out, and tangle it to target ...
0
votes
1answer
167 views

How to execute sudo command in org-babel in relative path under current working directory

I want to execute sudo command in org-babel like this: #+begin_src shell :dir "/sudo::" :cache no make sudo make install #+end_src It works fine. It use TRAMP /sudo: method. But I need to execute ...
1
vote
2answers
159 views

Org-babel: using properties as code block header arguments, how to make it work?

I am able to execute SQL block with the following: #+NAME:test-1 #+BEGIN_SRC sql :noweb no-export :tangle :engine mssql :cmdline "-S localhost -U SA -P myPassword" select * from OtherDW.dbo....
0
votes
1answer
66 views

Tangle only selected src blocks using org-babel on export

I have a document with only several source code blocks that should be tangled. So the structure is: # Some main.org ... #+BEGIN_SRC awk :tangle file1.awk ... #+END_SRC awk ... ...
1
vote
0answers
59 views

org alters output of bash code blocks when run with :session

I am running a short bash command from an org mode code block, using the program fold to wrap it at 60 characters. If I run the code without a session argument, the results display as expected. ...
4
votes
4answers
653 views

literate programming: do folks revise tangle blocks or make copies

So I'm making a website using an org document and tangling. I've created the basic structure of the site using * file coolsite.org #+BEGIN_SRC sh rails new coolapp #+END_SRC This creates a app/...
0
votes
0answers
52 views

Org-Mode: Inline Formula in Source Code Caption

I would like to do a calculation in the caption of a source code listing like so: #+CAPTION: The result is src_python[:results raw]{2*3.1416}. #+BEGIN_SRC python tau = 2*3.1416 #+END_SRC When I ...
0
votes
0answers
24 views

Reference not found errors when executing org-mode-active-doc.org

I was trying to follow along with this org file http://www.cs.unm.edu/~eschulte/data/CISE-13-3-SciProg.pdf aliased at https://raw.githubusercontent.com/eschulte/CiSE/master/org-mode-active-doc.org ...
0
votes
0answers
18 views

Use output of one block for the dir argument of block 3

I've seen that org babel allows you to hook up code blocks to pass variables around. Can that feature help me with this org file? In the first block, I create a cloud ubuntu instance. In the second ...
1
vote
1answer
51 views

Is this a bug? emacs freezes when doing “sudo service apache2 status” inside a org babel tramp remote code block

I think I've found a bug with emacs+org+babel. This block runs fine #+BEGIN_SRC sh :dir /ssh:ubuntu@54.175.231.31:~/ :exports both :results output sudo service --...
0
votes
1answer
168 views

org-babel-execute:clojure handle :file result error

-- UPDATE -- Declare what my code is trying to do: I want to let org-babel insert an inline image link which is generated by Clojure code. Here the image is generated by Incanter's function save. ...
0
votes
0answers
31 views

org-babel uses wrong directory during execution of source blocks (org-compile-file error)

I'm experiencing a strange error when trying to execute/compile a LaTeX source block in org-babel. A simple example looks like this: #+NAME: latex1802142321 #+BEGIN_SRC latex :results raw :file ...
0
votes
1answer
55 views

How to write this advice for inject code into let-binding?

I want to write an advice on original code. But don't know how to write it in my case. I just did some modification, and do an diff. Hope the you can understand what I need. Here is the diff ...
5
votes
1answer
138 views

switch-buffer for literate programming

When doing literate programming, I do web development in a single org file, and do org tangle to generate the relevant html and css files. This works, for a few hours/days. When the number of files in ...
1
vote
1answer
76 views

Org-mode: Get src block result inside block definition for clocktable

I'm trying to create a clocktable that starts recording working time at the date of the last commit. So far I've got a src block and I'm satisfied with the resulting date, I'd like to include this ...
5
votes
1answer
145 views

Metaprogramming org-mode

My aim is to write dynamic reports which will be generated using a base skeleton file and snippets that correspond to and parametrise the particular issues. These issues are all content-wise similar ...
0
votes
1answer
40 views

Exist an ob-erlang for src code block on org mode

I'm looking for an ob-erlang library in order to execute erlang in source code blocks in org-mode; I looked on the language table, googled and on github and I didn't fin anything for erlang. I know ...
3
votes
1answer
95 views

Org-Mode: Using Source Code Blocks in Table Formulas

I would like to use source code blocks in org-mode table formulas using something similar to: #+NAME: square #+BEGIN_SRC python :var x=0 return x**2 #+END_SRC | 1 | 1 | | 2 | 4 | | 3 | 9 | #+TBLFM: $...
0
votes
1answer
85 views

Code block evaluated when exporting, not when publishing

I have this basic org publishing project to test that code blocks evaluation is triggered by publishing in html (org-html-publish-to-html). While exporting through org-mode export dispatcher does ...