4

One way might be like this, where expansion only occurs conditionally. Put this statement in an init file, or in an org-mode hook function and you should not get expansion in src-blocks. (setq abbrev-expand-function (lambda () (unless (org-in-src-block-p) (abbrev--default-expand))))


4

You can make your own execute function for diff blocks. #+BEGIN_SRC emacs-lisp (defun org-babel-execute:diff (body params) (with-temp-buffer (insert body "\n") (shell-command-on-region (point-min) (point-max) "patch" "*patch*") (prog1 (with-current-buffer "*patch*" (buffer-string)) (kill-buffer &...


3

What I do for cases like this, where I do not want the input to some src block exported, is put the input (the example block in your case) in a drawer and set the option d:nil so as to not export drawers. * example :input: #+name: input #+begin_example 5 1 3 2 0 #+end_example :end:


3

You could put the example in a separate section and tag it noexport: * example input :noexport: #+name: input #+begin_example 5 1 3 2 0 #+end_example * example code #+begin_src python :results output :eval yes :var x=input :exports results import matplotlib.pyplot as plt import numpy as np x = ...


2

If I understand you question correctly you wish to interpret ansi color codes in the results of org babel code blocks. I achieved this by adding a hook to org-babel-after-execute-hook: (defun ek/babel-ansi () (when-let ((beg (org-babel-where-is-src-block-result nil nil))) (save-excursion (goto-char beg) (when (looking-at org-babel-result-...


1

I don't think org offers any way to exclude example blocks from exporting. A possible work-around: if you don't want the example to show up in your export, does it need to be an example? You could make it a bash code block instead: * example #+name: input #+begin_src bash :exports none echo 5 1 3 2 0 #+end_src #+begin_src python :results output :eval yes :...


1

I think you should change :wrap math to :wrap export latex. That should wrap the output in a #+begin_latex: block, which should in turn export the way you want.


1

OK the following solution did the trick: add #+PROPERTY: header-args :var baseUrl="http://localhost:3000" restart org-mode Ctrlcc in my case while staying on that PROPERTY line Messages buffer would the following lines as a result: >org-mode restarted >Local setup has been refreshed Take a look at this related question if you want to ...


1

Tramp keeps its persistent data in ~/.emacs.d/tramp. You can either remove this file prior starting Emacs, or trash its contents by M-x tramp-cleanup-all-connections any time. I've tried to reproduce your scenario. I've used my own remote machine (obviously), with a non-standard port. In order to minimize interference with other packages, I have started ...


1

I don't find this any easier than what you have already shown, but here are some different approaches that use advanced features (https://orgmode.org/manual/Advanced-features.html) of naming fields in tables. You have to put the $ in the first column to name these constants. Getting these into your variable is a little verbose, but explicit at least. The org-...


1

Yes, you can do so by using the :post() header argument. I will present two solutions. The first one is simpler but has two disadvantages. I would consider the second solution the way to go. First solution Consider the following Org Mode file. We can call the dash code block after the c++ code block is executed by executing org-babel-execute-src-block, which ...


Only top voted, non community-wiki answers of a minimum length are eligible