288 lines
19 KiB
Plaintext
288 lines
19 KiB
Plaintext
<p>
|
|
Async Babel sessions have landed
|
|
</p>
|
|
|
|
<p>
|
|
Jack Kamm has made a fantastic contribution to Org: <kbd>ob-comint.el</kbd> now supports
|
|
asynchronous output from source blocks <i>with full support for sessions</i> 🎉.
|
|
</p>
|
|
|
|
<p>
|
|
If you haven't used sessions before, you're in for a treat! By simply assigning
|
|
a named session to a source code block, e.g. <kbd>:session foo</kbd>, the same process will
|
|
be reused for any other code blocks that specify the <kbd>foo</kbd> session. To do this for
|
|
a certain language across the entire document, you can set the header argument
|
|
property, i.e.
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-org"><span class="org-org-meta-line"> #+property: header-args:lang :session foo</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Along with the asynchronous process communication in <kbd>ob-comint.el</kbd>, we have an
|
|
implementation for <b>Python</b>, and we should see support for <b>R</b> and <b>Ruby</b> in the
|
|
not-too-distant future 😍.
|
|
</p>
|
|
|
|
<p>
|
|
To use this, just add the <kbd>:async</kbd> parameter to a python block. Instead of Emacs
|
|
freezing until it completes execution, you'll see a placeholder inserted which is
|
|
replaced by the result when it is ready.
|
|
</p>
|
|
|
|
<p>
|
|
<a href="https://github.com/nnicandro/emacs-jupyter">emacs-jupyter</a> allowed for asynchronous code execution (with sessions), but it's
|
|
great to have a solution that doesn't require Jupyter kernels, and is part of
|
|
Org.
|
|
</p>
|
|
|
|
<p>
|
|
Font lock for inline export snippets
|
|
</p>
|
|
|
|
<p>
|
|
Now, this isn't necessarily a significant change, but I don't think many people
|
|
know about this feature so I'll take the opportunity to go over it 🙂.
|
|
</p>
|
|
|
|
<p>
|
|
If you want to include a snippet of HTML/LaTeX etc. when exporting to that
|
|
format, you can use a <kbd>#+begin_export html</kbd> block which simply includes the
|
|
enclosed content verbatim. This doesn't really work for small inline snippets
|
|
though --- but never fear, Org has <i>inline</i> export snippets which simply follow the
|
|
form <code class="src src-org"><span class="org-comment">@@</span><span class="org-org-tag">format:</span>content<span class="org-comment">@@</span></code>. For example:
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-org"> I love using Org to export to <span class="org-comment">@@</span><span class="org-org-tag">html:</span><abbr title="Hyper Text Markup Language">HTML</abbr><span class="org-comment">@@</span> <span class="org-comment">@@</span><span class="org-org-tag">latex:</span><span class="org-org-block"><span class="custom"><span class="org-font-latex-sedate"><span class="org-keyword">\LaTeX</span></span></span></span><span class="org-org-block"><span class="custom">{}</span></span><span class="org-comment">@@</span> documents.
|
|
</pre>
|
|
</div>
|
|
<p>
|
|
which will export to HTML as,
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-html"> I love using Org to export to <<span class="org-function-name">abbr</span> <span class="org-variable-name">title</span>=<span class="org-string">"Hyper Text Markup Language"</span>>HTML</<span class="org-function-name">abbr</span>> documents.
|
|
</pre>
|
|
</div>
|
|
<p>
|
|
and then in LaTeX will be,
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-LaTeX"> I love using Org to export to <span class="org-font-latex-sedate"><span class="org-keyword">\LaTeX</span></span>{} documents.
|
|
</pre>
|
|
</div>
|
|
<p>
|
|
isn't that neat!
|
|
</p>
|
|
|
|
<p>
|
|
Now you'll find the <kbd>@@</kbd> parts using the comment face and the <kbd>format:</kbd> bit using the
|
|
Org tag's face. It's a small change, but it makes it easier to see what's going on.
|
|
</p>
|
|
|
|
<p>
|
|
No mode-specific syntax highlighting yet, but that may come in the future 😉.
|
|
</p>
|
|
|
|
<p>
|
|
<kbd>#+plot</kbd> your <kbd>#+results</kbd>
|
|
</p>
|
|
|
|
<p>
|
|
Org-plot has been getting some more love as of late (see <a href="https://blog.tecosaur.com/tmio/2021-04-30-export-plot.html">last month's post</a>), and
|
|
that hasn't stopped yet. This month there's been a fairly minor change that I'm
|
|
quite a fan of. If you have a source block that produces a table of <kbd>#+results</kbd>, you
|
|
can now put a <kbd>#+plot</kbd> statement immediately above to get a visualisation of those
|
|
results!
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-org"><span class="org-org-block-begin-line"> #+begin_src python</span>
|
|
<span class="org-org-block"> </span><span class="org-org-block"><span class="org-comment-delimiter"># </span></span><span class="org-org-block"><span class="org-comment">pretend this is some profound source of information</span></span>
|
|
<span class="org-org-block"> </span><span class="org-org-block"><span class="org-keyword">return</span></span><span class="org-org-block"> [[i, i^</span><span class="org-org-block"><span class="org-highlight-numbers-number">3</span></span><span class="org-org-block"> - </span><span class="org-org-block"><span class="org-highlight-numbers-number">4</span></span><span class="org-org-block">*i^</span><span class="org-org-block"><span class="org-highlight-numbers-number">2</span></span><span class="org-org-block"> - </span><span class="org-org-block"><span class="org-highlight-numbers-number">2</span></span><span class="org-org-block">*i] </span><span class="org-org-block"><span class="org-keyword">for</span></span><span class="org-org-block"> i </span><span class="org-org-block"><span class="org-keyword">in</span></span><span class="org-org-block"> </span><span class="org-org-block"><span class="org-builtin">range</span></span><span class="org-org-block">(</span><span class="org-org-block"><span class="org-highlight-numbers-number">5</span></span><span class="org-org-block">)]</span>
|
|
<span class="org-org-block-end-line"> #+end_src</span>
|
|
|
|
<span class="org-org-meta-line"> #+plot: ind:1</span>
|
|
<span class="org-org-meta-line"> #+RESULTS:</span>
|
|
<span class="org-org-table">| 0 | 1 |</span>
|
|
<span class="org-org-table">| 1 | -2 |</span>
|
|
<span class="org-org-table">| 2 | 7 |</span>
|
|
<span class="org-org-table">| 3 | 8 |</span>
|
|
<span class="org-org-table">| 4 | 13 |</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
As usual, this relies on <kbd>gnuplot</kbd> being present. You can read more
|
|
about it in the <a href="https://orgmode.org/manual/Org-Plot.html">manual</a>.
|
|
</p>
|
|
|
|
<p>
|
|
Fancier LaTeX verses
|
|
</p>
|
|
|
|
<p>
|
|
With the use of <kbd>verse.sty</kbd> you can now export fancier verses from Org, as verse
|
|
blocks now support four new attributes:
|
|
<kbd>:lines</kbd> for the numbering interval.
|
|
<kbd>:center</kbd> which can be set to <kbd>t</kbd> and works as long as,
|
|
<kbd>:versewidth</kbd>, the longest line in the verse as a text string is set.
|
|
You can also easily add arbitrary LaTeX code to be included with <kbd>:latexcode</kbd>.
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-org"><span class="org-org-meta-line"> #+latex_header: \usepackage{verse}</span>
|
|
|
|
<span class="org-org-meta-line"> #+latex: \poemtitle{A Dream Within a Dream}</span>
|
|
<span class="org-org-meta-line"> #+attr_latex: :lines 3 :center t</span>
|
|
<span class="org-org-meta-line"> #+attr_latex: :versewidth Through my fingers to the deep,</span>
|
|
<span class="org-org-block-begin-line"> #+begin_verse</span>
|
|
<span class="org-org-verse"> Take this kiss upon the brow!</span>
|
|
<span class="org-org-verse"> And, in parting from you now,</span>
|
|
<span class="org-org-verse"> Thus much let me avow —</span>
|
|
<span class="org-org-verse"> You are not wrong, who deem</span>
|
|
<span class="org-org-verse"> That my days have been a dream;</span>
|
|
<span class="org-org-verse"> Yet if hope has flown away</span>
|
|
<span class="org-org-verse"> In a night, or in a day,</span>
|
|
<span class="org-org-verse"> In a vision, or in none,</span>
|
|
<span class="org-org-verse"> Is it therefore the less </span><span class="org-org-verse"><span class="org-italic">gone?</span></span>
|
|
<span class="org-org-verse"> </span><span class="org-org-verse"><span class="org-italic">All</span></span><span class="org-org-verse"> that we see or seem</span>
|
|
<span class="org-org-verse"> Is but a dream within a dream.</span>
|
|
|
|
<span class="org-org-verse"> I stand amid the roar</span>
|
|
<span class="org-org-verse"> Of a surf-tormented shore,</span>
|
|
<span class="org-org-verse"> And I hold within my hand</span>
|
|
<span class="org-org-verse"> Grains of the golden sand —</span>
|
|
<span class="org-org-verse"> How </span><span class="org-org-verse"><span class="org-writegood-weasels">few</span></span><span class="org-org-verse">! yet how they creep</span>
|
|
<span class="org-org-verse"> Through my fingers to the deep,</span>
|
|
<span class="org-org-verse"> While I weep — while I weep!</span>
|
|
<span class="org-org-verse"> O God! Can I not grasp</span>
|
|
<span class="org-org-verse"> Them with a tighter clasp?</span>
|
|
<span class="org-org-verse"> O God! can I not save</span>
|
|
<span class="org-org-verse"> </span><span class="org-org-verse"><span class="org-italic">One</span></span><span class="org-org-verse"> from the pitiless wave?</span>
|
|
<span class="org-org-verse"> Is </span><span class="org-org-verse"><span class="org-italic">all</span></span><span class="org-org-verse"> that we see or seem</span>
|
|
<span class="org-org-verse"> But a dream within a dream?</span>
|
|
<span class="org-org-block-end-line"> #+end_verse</span>
|
|
</pre>
|
|
</div>
|
|
|
|
|
|
<figure id="org0c2b0da">
|
|
<img alt="org-verses-example-poem-dream-within-dream.png" src="https://blog.tecosaur.com/tmio/figures/org-verses-example-poem-dream-within-dream.png" />
|
|
|
|
<span class="figure-number">Figure 4: </span>A short Poe-em
|
|
</figure>
|
|
|
|
<p>
|
|
Easy zero-width spaces with Org
|
|
</p>
|
|
|
|
<p>
|
|
Occasionally you may run into annoyances when you wish to have two different Org
|
|
elements right next to each other (no space) --- for example, <b>emph</b>asising part of
|
|
a word or putting a currency symbol immediately before an inline source block.
|
|
</p>
|
|
|
|
<p>
|
|
The best solution to this in Org is zero-width spaces. As such, I've found it
|
|
rather nice adding insertion of a zero-width space to the <code>org-mode-map</code> in my
|
|
config. Perhaps some of you might find this solution useful too 🙂.
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-emacs-lisp"> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">define-key</span> <span class="org-variable-name">org-mode-map</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">kbd</span> <span class="org-string">"M-SPC M-SPC"</span><span class="org-rainbow-delimiters-depth-2">)</span>
|
|
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">()</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">insert</span> <span class="org-string">"\u200b"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Should you want to keep zero-width spaces out of exports, that's easy enough to
|
|
accomplish with an <a href="https://orgmode.org/manual/Advanced-Export-Configuration.html">export filter</a>.
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-emacs-lisp"> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">+org-export-remove-zero-width-space</span> <span class="org-rainbow-delimiters-depth-2">(</span>text _backend _info<span class="org-rainbow-delimiters-depth-2">)</span>
|
|
<span class="org-doc">"Remove zero width spaces from TEXT."</span>
|
|
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">unless</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-export-derived-backend-p</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org</span><span class="org-rainbow-delimiters-depth-3">)</span>
|
|
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">replace-regexp-in-string</span> <span class="org-string">"\u200b"</span> <span class="org-string">""</span> text<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
|
|
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-export-filter-final-output-functions</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">+org-export-remove-zero-width-space</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
Org's repos have moved
|
|
<kbd>contrib/</kbd> is now at <a href="https://git.sr.ht/~bzg/org-contrib">https://git.sr.ht/~bzg/org-contrib</a> for Org 9.5, and it will
|
|
be available on Non-GNU ELPA.
|
|
Worg is now at <a href="https://git.sr.ht/~bzg/worg">https://git.sr.ht/~bzg/worg</a>
|
|
Org itself is moving to Savannah
|
|
Other improvements
|
|
Add support for <kbd>HHhMM</kbd> date formats (e.g. <kbd>13h20</kbd>) <span class="underline">Gustavo Barros</span>
|
|
Make tangling faster <i>and</i> more robust <span class="underline">Sébastien Miquel</span>
|
|
Allow importing tables from files that <i>don't</i> end in <kbd>.txt</kbd>, <kbd>.tsv</kbd>, or <kbd>.csv</kbd>
|
|
<span class="underline">Utkarsh Singh</span>
|
|
Add an SVG-specific post-export <kbd>ob-plantuml</kbd> step:
|
|
<code>org-babel-plantuml-svg-text-to-path</code> for running Inkscape text-to-path
|
|
replacement <span class="underline">Nick Daly</span>
|
|
Refactor JavaScript in <kbd>ox-html</kbd> <span class="underline">Anthony Carrico</span>
|
|
Set <code>org-html-head-include-scripts</code> to <code>nil</code> by default (was <code>t</code>) <span class="underline">Bastien Guerry</span>
|
|
Remove LaTeX-environment type <kbd>#+results</kbd> <span class="underline">TEC</span>
|
|
New capture templates parameter, <kbd>:refile-targets</kbd> <span class="underline">Richard Garner</span>
|
|
Merge <code>org-speed-commands-default</code> and <code>org-speed-commands-user</code> into a new
|
|
variable, <code>org-speed-commands</code> <span class="underline">Bastien Guerry</span>
|
|
URL recognition regex now handles up to two levels of nested brackets, and is
|
|
tested <span class="underline">Ihor Radchenko</span>
|
|
Cache parent heading positions for faster movement up buffers. Significantly
|
|
improves Org queries involving inheritance (<code>15-50x improvement) _Ihor Radchenko_
|
|
New command ~org-refile-reverse</code> bound to <kbd>C-c C-M-w</kbd> <span class="underline">Adam Spiers</span>
|
|
Allow inline tasks to be dragged up/down <span class="underline">Bastien Guerry</span>
|
|
LaTeX export, allow arbitrary <kbd>:float</kbd> values <span class="underline">Thomas S. Dye</span>
|
|
Org attach git, new option <code>org-attach-git-dir</code> to use the attachment dir as a
|
|
git repository <span class="underline">Juan Manuel Macías</span>
|
|
Use a write-back buffer in Org src <span class="underline">Sébastien Miquel</span>
|
|
Add the <kbd>:environment</kbd> and <kbd>:options</kbd> LaTeX attributes to Quote blocks <span class="underline">Juan Manuel Macias</span>
|
|
Surround LaTeX <kbd>:options</kbd> attribute with curly braces when it contains square
|
|
braces <span class="underline">Markus Huber</span>
|
|
Recognise the specific contributions of Kyle Meyer, Ihor Radchenko, and TEC in
|
|
the manual <span class="underline">Bastien Guerry</span>
|
|
Improve test coverage <span class="underline">Ihor Radchenko, Kévin Le Gouguec</span>
|
|
A bikeshed of new maintainers
|
|
New maintainer for <kbd>ox-html</kbd> --- TEC
|
|
New <kbd>ob-ledger</kbd> maintainer --- Eric S Fraga
|
|
New <kbd>ob-awk</kbd> maintainer --- Tyler Smith
|
|
New <kbd>ob-calc</kbd> maintainer --- Tom Gillespie
|
|
New <kbd>ob-asymptote</kbd> and <kbd>ob-coq</kbd> maintainer --- Luc Pellissier
|
|
General code cleanup <span class="underline">Bastien Guerry</span>
|
|
Documentation improvements <span class="underline">Bastien Guerry, Eric S Fraga, Samim Pezeshki,
|
|
Nicolar Goaziou</span>
|
|
Bugfixes
|
|
Make <kbd>ob-gnuplot</kbd> work on remote systems <span class="underline">Ihor Radchenko</span>
|
|
Stop <kbd>M-x org-toggle-link-display</kbd> from affecting emphasis markers <span class="underline">Bastien Guerry</span>
|
|
Inserting a heading before a headline <span class="underline">Bastien Guerry</span>
|
|
Perform <code>org-entry-put</code> in a read-only buffer <span class="underline">Ihor Radchenko</span>
|
|
Emacs 24 compatibility for <kbd>ob-C</kbd> and <code>org-agenda-show-new-time</code> <span class="underline">Kyle Meyer</span>
|
|
Maintain Org's keybindings when <code>visual-line-mode</code> active <span class="underline">Bastien Guerry</span>
|
|
Keep track of start of region beginning in <code>org-table-wrap-region</code> <span class="underline">Bastien Guerry</span>
|
|
Ensure correct visibility when unfolding subtree <span class="underline">Bastien Guerry</span>
|
|
Corner case in <code>org--backwards-paragaph-once</code> <span class="underline">Bastien Guerry</span>
|
|
Some byte compiler silencing <span class="underline">Kyle Meyer</span>
|
|
Make tags filtering case-sensitive <span class="underline">Bastien Guerry</span>
|
|
<kbd>C-c C-c</kbd> on a <kbd>#+plot</kbd> line can no longer cause an error <span class="underline">Bastien Guerry</span>
|
|
Ensure consistent position-translation in <kbd>org-src</kbd> by using point for position
|
|
instead of column <span class="underline">TEC</span>
|
|
Prevent <kbd>ob-sql</kbd> from getting stuck on an error <span class="underline">Ivan Sokolov</span>
|
|
Make <kbd>org-columns</kbd> respect <code>global-visual-line-mode</code>, and simplify tag scanning
|
|
<span class="underline">Nick Savage</span>
|
|
Don't fontify <kbd>::</kbd> in headlines as description item <span class="underline">Ihor Radchenko</span>
|
|
Handle a few corner-cases in <kbd>ob-R</kbd> <span class="underline">Jeremie Juste</span>
|
|
Many fixes to <code>org-indent-line</code> <span class="underline">Bastien Guerry</span>
|
|
Make headline numbering consistent with TOC <span class="underline">Mingkai Dong</span>
|
|
Allow read-only tangling again, and ensure the correct filename is used <span class="underline">Sébastien Miquel</span>
|
|
Fix edge case when converting durations to minutes <span class="underline">Nicolas Goaziou</span>
|
|
Make org-refile work in non-file-visiting buffers <span class="underline">Bastien Guerry</span>
|
|
Be more rigorous in <code>org-sort-remove-invisible</code> <span class="underline">Nicolas Goaziou</span>
|
|
Don't update checkbox stats when heading has <kbd>todo</kbd> <kbd>COOKIE_DATA</kbd> <span class="underline">Bastien Guerry</span>
|
|
Don't recognise a lone <kbd>:END:</kbd> to be forming a drawer <span class="underline">Nicolas Goaziou</span>
|
|
Allow new footnotes in empty table cells <span class="underline">Nicolas Goaziou</span>
|
|
</p> |