literate-dotfiles/docs/doom.html

4936 lines
595 KiB
HTML
Raw Normal View History

2020-01-11 22:04:45 +01:00
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
2021-10-25 14:37:10 +02:00
<!-- 2021-10-25 lun. 14:33 -->
2020-01-11 22:04:45 +01:00
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Doom Emacs Configuration</title>
<meta name="author" content="Dehaeze Thomas" />
2021-04-25 19:10:57 +02:00
<meta name="generator" content="Org Mode" />
2021-01-01 20:12:34 +01:00
<link rel="stylesheet" type="text/css" href="./dist/style.css"/>
<script type="text/javascript" src="./dist/script.js"></script>
2020-01-11 22:04:45 +01:00
</head>
<body>
2020-01-11 22:22:46 +01:00
<div id="org-div-home-and-up">
<a accesskey="h" href="./index.html"> UP </a>
|
<a accesskey="H" href="./index.html"> HOME </a>
2021-10-25 14:37:10 +02:00
</div><div id="content" class="content">
2020-01-11 22:04:45 +01:00
<h1 class="title">Doom Emacs Configuration</h1>
2021-10-25 14:37:10 +02:00
<div id="table-of-contents" role="doc-toc">
2020-01-11 22:04:45 +01:00
<h2>Table of Contents</h2>
2021-10-25 14:37:10 +02:00
<div id="text-table-of-contents" role="doc-toc">
2020-01-11 22:04:45 +01:00
<ul>
<li><a href="#org1e17e7b">Installation</a></li>
<li><a href="#org7191145">Introduction and Resources</a></li>
2021-01-01 20:12:34 +01:00
<li><a href="#org8889015">Useful Bindings</a>
2020-05-26 08:40:15 +02:00
<ul>
2021-01-01 20:12:34 +01:00
<li><a href="#org7df6a45">General Bindings</a></li>
<li><a href="#orgad10d7d">Org-Babel Bindings</a></li>
<li><a href="#org3f45876">Evil bindings</a></li>
2020-05-26 08:40:15 +02:00
</ul>
</li>
2021-01-01 20:12:34 +01:00
<li><a href="#org3224622">Basic Configuration</a>
2020-05-26 08:40:15 +02:00
<ul>
2021-01-01 20:12:34 +01:00
<li><a href="#org0f6c087">Personal Information</a></li>
<li><a href="#org54b7708">Doom Config</a></li>
<li><a href="#orgb47335d">Evil</a></li>
<li><a href="#org91191b1">Which Key</a></li>
<li><a href="#org984cbff">Visual</a></li>
<li><a href="#org4a815d7">Useful General Functions</a></li>
<li><a href="#org5481666">Change default alert backend</a></li>
2021-04-25 19:10:57 +02:00
<li><a href="#org2b36dfb">Spell Check</a></li>
2021-01-01 20:12:34 +01:00
<li><a href="#orgb4aa789">Lockfiles</a></li>
<li><a href="#org96b05b8">Disable highlight of current line</a></li>
<li><a href="#orgd71ea39">Remap <code>jump-forward</code> key binding</a></li>
<li><a href="#orgd5e9661">Magit</a></li>
<li><a href="#org7bf3713">Dired</a></li>
<li><a href="#org6f4d128">PDF-Tools</a></li>
2021-10-25 14:37:10 +02:00
<li><a href="#orgb8c8c72">Flycheck</a></li>
2021-01-01 20:12:34 +01:00
<li><a href="#orga52aafb">Yassnippets</a></li>
<li><a href="#orgdaacd7b">Ox-Hugo</a></li>
<li><a href="#orgadec3c9">Others</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2021-01-01 20:12:34 +01:00
<li><a href="#org48e26f0">Org Mode</a>
2020-01-11 22:04:45 +01:00
<ul>
2021-01-01 20:12:34 +01:00
<li><a href="#org9a192de">Org General Config</a></li>
<li><a href="#org9c78e0f">Org Inline Images</a></li>
2021-10-25 14:37:10 +02:00
<li><a href="#org42be289">Org Links</a></li>
2021-01-01 20:12:34 +01:00
<li><a href="#org06d5c9f">Org Tagging</a></li>
<li><a href="#org82e8603">Org Refile</a></li>
<li><a href="#org4e35a03">Org TODO</a></li>
<li><a href="#org10bb4ba">Org Archive</a></li>
<li><a href="#orgb18d1ed">Org Agenda</a></li>
2021-02-10 18:02:02 +01:00
<li><a href="#org5b2fa78">Org Agenda HTML</a></li>
2021-01-01 20:12:34 +01:00
<li><a href="#orgfc73fc4">Org Fancy Priority</a></li>
<li><a href="#orge3db067">Org Notification based on calendar event</a>
2020-01-11 22:04:45 +01:00
<ul>
2021-01-01 20:12:34 +01:00
<li><a href="#orgcbb0b10">appt-notification script</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2021-01-01 20:12:34 +01:00
<li><a href="#org2d7850b">Org Structure Template</a></li>
<li><a href="#org96e2697">Org Capture</a></li>
2021-10-25 14:37:10 +02:00
<li><a href="#orgf332c4c"><code>message:</code> link to mutt</a></li>
2021-01-01 20:12:34 +01:00
<li><a href="#org774450b">Org Export</a></li>
2021-10-25 14:37:10 +02:00
<li><a href="#org5df6892">Org Effort</a></li>
2021-01-01 20:12:34 +01:00
<li><a href="#org825b67c">HTML Export</a>
2020-01-11 22:04:45 +01:00
<ul>
2021-01-01 20:12:34 +01:00
<li><a href="#org8b575b5">HTML Defaults</a></li>
<li><a href="#org2d665d8">MathJax</a></li>
<li><a href="#orgfe637f6">MP4 Video - <code>video</code> link</a></li>
<li><a href="#orgcd580b1">Ensuring useful HTML Anchors</a></li>
<li><a href="#orgc58d8a3">Folded Drawers</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2021-04-25 19:10:57 +02:00
<li><a href="#org0a897f6">Org Xournalpp</a></li>
2021-10-25 14:37:10 +02:00
<li><a href="#org6e57ed7">Org Transclusion</a></li>
2021-01-01 20:12:34 +01:00
<li><a href="#orgb6d14e7">Org LaTeX</a>
2020-01-11 22:04:45 +01:00
<ul>
2021-01-01 20:12:34 +01:00
<li><a href="#orge8dbace">LaTeX Fragments</a></li>
<li><a href="#org7b43d97">LaTeX Classes</a></li>
<li><a href="#org37fbc06">Ox Latex Subfigure package</a></li>
<li><a href="#org2262fec">Clear page before heading</a></li>
<li><a href="#org94f5800">Default added packages</a></li>
<li><a href="#org360b4cc">Some configurations</a></li>
<li><a href="#org593e089">Beamer</a></li>
<li><a href="#org6991c47">Custom Export - Add Page and Label for LaTeX export</a></li>
<li><a href="#org9efe418">Number Equations</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2021-04-25 19:10:57 +02:00
<li><a href="#org10dc0d9">Org Media Note</a></li>
2021-01-01 20:12:34 +01:00
<li><a href="#org40182cc">LaTeX macro both for LaTeX and HTML export</a></li>
<li><a href="#org68f0642">Org Projects</a></li>
<li><a href="#org3282b66">Automatically run <code>startblock</code> when opening org-mode files</a></li>
2021-01-08 01:34:53 +01:00
<li><a href="#org02fccbb">Some function</a></li>
2021-01-01 20:12:34 +01:00
<li><a href="#orgeeaa452">Insert ScreenShot or Picture from Phone</a></li>
<li><a href="#org90e8b2b">Render Tables</a></li>
<li><a href="#orgab67420">Org Special Block Extras</a></li>
<li><a href="#org7adfc1c">Org Inline Task</a></li>
2021-10-25 14:37:10 +02:00
<li><a href="#orge396359">Org Links</a>
2020-03-22 23:04:07 +01:00
<ul>
2021-01-01 20:12:34 +01:00
<li><a href="#orgd172897">Youtube Links</a></li>
</ul>
</li>
<li><a href="#orgc487d67">Citeproc-Org</a></li>
<li><a href="#org5907d9d">Org Wild Notifier</a></li>
<li><a href="#org59c6888">Orch</a></li>
<li><a href="#org4e9295a">Custom Keybindings - <code>,</code> leader key and <code>C-c</code></a>
<ul>
<li><a href="#org3174f9c">Insert Elements <code>,i</code></a></li>
<li><a href="#org69583da">LaTeX <code>,l</code></a></li>
<li><a href="#org4cd66c9">Org LaTeX Automatic fragment</a></li>
<li><a href="#org450adc0">Bibtex <code>,r</code></a></li>
<li><a href="#org64d03ee">Open ranger in current directory <code>,o</code></a></li>
<li><a href="#org27f3b70">View in External programs <code>,v</code></a></li>
2020-03-22 23:04:07 +01:00
</ul>
</li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2021-01-01 20:12:34 +01:00
<li><a href="#orgfe0eb1b">Org Babel</a>
2020-01-11 22:04:45 +01:00
<ul>
2021-01-01 20:12:34 +01:00
<li><a href="#orgba33e71">Main configuration</a></li>
<li><a href="#orga4792a7">Appearance of source blocks</a></li>
<li><a href="#orgabce861">Indentation</a></li>
<li><a href="#org7d7e65b">Library of Babel</a></li>
<li><a href="#orge0d9b66">Org-Babel Matlab</a></li>
2021-02-10 18:02:02 +01:00
<li><a href="#org49ad889">Mermaid</a></li>
2021-01-01 20:12:34 +01:00
<li><a href="#org27c33e4">Some functions for using Matlab with Org Babel <code>,m</code></a></li>
<li><a href="#orge649608">Remap <code>ctrl-ret</code> used to execute the src block and go to the next one</a></li>
<li><a href="#orge323144">Remap <code>ctrl-shift-ret</code> used to execute the (matlab) src block in the background and go to the next one</a>
2020-01-11 22:04:45 +01:00
<ul>
2021-01-01 20:12:34 +01:00
<li><a href="#org61914d9"><code>tdh-org-babel-execute-matlab-background</code></a></li>
<li><a href="#org03e95da"><code>tdh-matlab-execute-selected</code></a></li>
<li><a href="#orgaa56d01">Remap <code>ctrl-shift-ref</code></a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2021-01-01 20:12:34 +01:00
<li><a href="#orga08a234">Align Source Blocks</a></li>
<li><a href="#org3096b75">Helping Functions - Tangling <code>,b</code></a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2021-01-01 20:12:34 +01:00
<li><a href="#org8935fa7">Bibliography Management</a>
2020-01-11 22:04:45 +01:00
<ul>
2021-01-01 20:12:34 +01:00
<li><a href="#orgf80673e">Org Ref (link)</a></li>
<li><a href="#org9d0f05b">Org Noter (link)</a></li>
2021-10-25 14:37:10 +02:00
<li><a href="#org7795c91">Capture Templates</a>
<ul>
<li><a href="#orgb9d8d5a">Bibliography</a></li>
<li><a href="#org0625ef3">Default</a></li>
</ul>
</li>
2021-01-01 20:12:34 +01:00
<li><a href="#org750d939">Org Roam (link)</a></li>
<li><a href="#org528a649">Helm-Bibtex (link)</a></li>
2021-10-25 14:37:10 +02:00
<li><a href="#orgd7adc6f">Deft (link)</a></li>
<li><a href="#org2fbe257">Org-Roam-Bibtex (link)</a></li>
2021-01-01 20:12:34 +01:00
<li><a href="#org31992e4">Citeproc-org (link)</a></li>
2021-02-10 18:02:02 +01:00
<li><a href="#orgb692dae">Bibtex-Mode</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2021-01-01 20:12:34 +01:00
<li><a href="#org5722bd7">LaTeX</a>
2020-01-11 22:04:45 +01:00
<ul>
2021-10-25 14:37:10 +02:00
<li><a href="#org8a54304">Basic Config</a></li>
2021-01-01 20:12:34 +01:00
<li><a href="#orge71a16b">Bibtex</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2021-01-01 20:12:34 +01:00
<li><a href="#orgc460c80">Matlab</a>
2020-01-11 22:04:45 +01:00
<ul>
2021-01-01 20:12:34 +01:00
<li><a href="#orga959435">Setup Matlab Mode</a></li>
<li><a href="#org52660ee">Setup Flycheck to work with <code>mlint</code></a></li>
<li><a href="#orgc8534a9">Completion in the Matlab Shell</a></li>
<li><a href="#org5cfeb30">Beautify code</a></li>
<li><a href="#org6529958">Key Bindings</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2021-04-25 19:10:57 +02:00
<li><a href="#orgf8bb7bc">Pandoc</a></li>
2021-01-01 20:12:34 +01:00
<li><a href="#org4d9098f">Mu4e</a>
2020-01-11 22:04:45 +01:00
<ul>
2021-01-01 20:12:34 +01:00
<li><a href="#orgafab721">Resources</a></li>
<li><a href="#org2b8b75f">Cheatsheet</a></li>
<li><a href="#orgebf9129">Helping function</a></li>
2021-10-25 14:37:10 +02:00
<li><a href="#org195a677">Basic Config</a></li>
2021-01-01 20:12:34 +01:00
<li><a href="#org7c3d72b">Additional config</a></li>
<li><a href="#org716f5e2">Provide Information</a></li>
<li><a href="#org48a7840">Receiving emails using mbsync</a></li>
<li><a href="#org6a9fd0f">Contexts</a></li>
<li><a href="#org6833676">Sending mails</a></li>
<li><a href="#org0b1e63d">Bookmarks</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2021-01-01 20:12:34 +01:00
<li><a href="#org40d8b3b">Doom <code>init.el</code></a></li>
<li><a href="#org287a149">Doom <code>packages.el</code></a></li>
2020-01-11 22:04:45 +01:00
</ul>
</div>
</div>
2021-01-08 01:34:53 +01:00
<div id="outline-container-org1e17e7b" class="outline-2">
<h2 id="org1e17e7b">Installation</h2>
<div class="outline-text-2" id="text-org1e17e7b">
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-bash">yay -Ss aspell aspell-fr aspell-en
</pre>
</div>
</div>
</div>
2020-01-11 22:04:45 +01:00
<div id="outline-container-org7191145" class="outline-2">
<h2 id="org7191145">Introduction and Resources</h2>
<div class="outline-text-2" id="text-org7191145">
2020-01-11 22:04:45 +01:00
<p>
<a href="https://medium.com/urbint-engineering/emacs-doom-for-newbies-1f8038604e3b">https://medium.com/urbint-engineering/emacs-doom-for-newbies-1f8038604e3b</a>
<a href="https://noelwelsh.com/posts/2019-01-10-doom-emacs.html">https://noelwelsh.com/posts/2019-01-10-doom-emacs.html</a>
<a href="https://dotdoom.netlify.com/config.html">https://dotdoom.netlify.com/config.html</a>
2020-03-01 22:51:16 +01:00
<a href="https://emacs.christianbaeuerlein.com/">https://emacs.christianbaeuerlein.com/</a>
<a href="https://github.com/nmartin84/.doom.d/blob/master/config.org">https://github.com/nmartin84/.doom.d/blob/master/config.org</a>
2021-01-08 01:34:53 +01:00
<a href="https://tecosaur.github.io/emacs-config/config.html#intro">https://tecosaur.github.io/emacs-config/config.html#intro</a>
2020-01-11 22:04:45 +01:00
</p>
<p>
Documentation:
</p>
<ul class="org-ul">
<li><a href="https://github.com/hlissner/doom-emacs/blob/develop/docs/index.org">https://github.com/hlissner/doom-emacs/blob/develop/docs/index.org</a></li>
</ul>
2020-05-26 08:40:15 +02:00
<p>
When changing <code>init.el</code> or <code>package.el</code>, tangle the files and then run <code>doom sync</code>.
After that, restart Emacs with <code>spc q r</code>.
</p>
</div>
</div>
2020-05-26 08:40:15 +02:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-org8889015" class="outline-2">
<h2 id="org8889015">Useful Bindings</h2>
<div class="outline-text-2" id="text-org8889015">
2020-04-05 11:30:26 +02:00
<ul class="org-ul">
<li><code>align-regexp</code>: equivalent of <a href="https://github.com/junegunn/vim-easy-align">vim-easy-align</a>. Very useful to align tables and stuff</li>
</ul>
2020-05-26 08:40:15 +02:00
</div>
2020-04-05 11:30:26 +02:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-org7df6a45" class="outline-3">
<h3 id="org7df6a45">General Bindings</h3>
<div class="outline-text-3" id="text-org7df6a45">
2020-01-11 22:04:45 +01:00
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
2020-03-19 10:46:47 +01:00
<tbody>
2020-01-11 22:04:45 +01:00
<tr>
2020-03-19 10:46:47 +01:00
<td class="org-left"><code>spc :</code></td>
<td class="org-left">Execute command</td>
2020-01-11 22:04:45 +01:00
</tr>
<tr>
2020-03-19 10:46:47 +01:00
<td class="org-left"><code>spc &lt;</code></td>
<td class="org-left">Switch to buffer</td>
2020-01-11 22:04:45 +01:00
</tr>
<tr>
2020-03-19 10:46:47 +01:00
<td class="org-left"><code>spc X</code></td>
<td class="org-left">org-capture</td>
2020-01-11 22:04:45 +01:00
</tr>
2020-03-19 10:46:47 +01:00
2020-01-11 22:04:45 +01:00
<tr>
<td class="org-left"><code>spc s s</code></td>
<td class="org-left">Search in buffer with swiper</td>
</tr>
<tr>
<td class="org-left"><code>spc s p</code></td>
<td class="org-left">Search in project</td>
</tr>
2020-03-19 10:46:47 +01:00
2020-01-11 22:04:45 +01:00
<tr>
<td class="org-left"><code>spc p p</code></td>
<td class="org-left">Switch project</td>
</tr>
<tr>
<td class="org-left"><code>spc p t</code></td>
<td class="org-left">TODOs in project</td>
</tr>
2020-03-19 10:46:47 +01:00
2020-01-11 22:04:45 +01:00
<tr>
<td class="org-left"><code>spc o f</code></td>
<td class="org-left">Create frame</td>
</tr>
<tr>
<td class="org-left"><code>spc o e</code></td>
<td class="org-left">Toggle Eshell</td>
</tr>
2020-03-19 10:46:47 +01:00
2020-01-11 22:04:45 +01:00
<tr>
<td class="org-left"><code>spc n l</code></td>
<td class="org-left">Store link</td>
</tr>
2020-03-19 10:46:47 +01:00
2020-01-11 22:04:45 +01:00
<tr>
<td class="org-left"><code>spc g g</code></td>
<td class="org-left">Magit status</td>
</tr>
2020-03-19 10:46:47 +01:00
2020-01-11 22:04:45 +01:00
<tr>
<td class="org-left"><code>spc f r</code></td>
<td class="org-left">Open recent file</td>
</tr>
2020-03-19 10:46:47 +01:00
2020-01-11 22:04:45 +01:00
<tr>
<td class="org-left"><code>spc b B</code></td>
<td class="org-left">Switch to buffer</td>
</tr>
<tr>
<td class="org-left"><code>spc b d</code></td>
<td class="org-left">Kill current buffer</td>
</tr>
<tr>
<td class="org-left"><code>spc b i</code></td>
<td class="org-left">ibuffer</td>
</tr>
2020-03-19 10:46:47 +01:00
2020-01-11 22:04:45 +01:00
<tr>
<td class="org-left"><code>spc tab .</code></td>
<td class="org-left">Switch to workspace</td>
</tr>
<tr>
<td class="org-left"><code>spc tab n</code></td>
<td class="org-left">New workspace</td>
</tr>
<tr>
<td class="org-left"><code>spc tab r</code></td>
<td class="org-left">Rename workspace</td>
</tr>
2020-03-19 10:46:47 +01:00
2020-01-11 22:04:45 +01:00
<tr>
<td class="org-left"><code>spc m A</code></td>
<td class="org-left">org-archive-subtree</td>
</tr>
<tr>
<td class="org-left"><code>spc m I</code></td>
<td class="org-left">org-toggle-inline-images</td>
</tr>
<tr>
<td class="org-left"><code>spc m d</code></td>
<td class="org-left">org-deadline</td>
</tr>
<tr>
<td class="org-left"><code>spc m e</code></td>
<td class="org-left">org-export-dispatch</td>
</tr>
<tr>
<td class="org-left"><code>spc m o</code></td>
<td class="org-left">org-set-property</td>
</tr>
<tr>
<td class="org-left"><code>spc m s</code></td>
<td class="org-left">org-schedule</td>
</tr>
<tr>
<td class="org-left"><code>spc m t</code></td>
<td class="org-left">org-todo</td>
</tr>
</tbody>
</table>
2020-05-26 08:40:15 +02:00
</div>
</div>
2020-01-11 22:04:45 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgad10d7d" class="outline-3">
<h3 id="orgad10d7d">Org-Babel Bindings</h3>
<div class="outline-text-3" id="text-orgad10d7d">
2020-01-11 22:04:45 +01:00
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
<tbody>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v p</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-previous-src-block</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v n</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-next-src-block</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v e</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-execute-maybe</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v o</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-open-src-block-result</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v v</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-expand-src-block</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v u</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-goto-src-block-head</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v g</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-goto-named-src-block</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v r</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-goto-named-result</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v b</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-execute-buffer</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v s</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-execute-subtree</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v d</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-demarcate-block</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v t</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-tangle</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v f</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-tangle-file</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v c</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-check-src-block</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v j</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-insert-header-arg</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v l</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-load-in-session</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v i</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-lob-ingest</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v I</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-view-src-block-info</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v z</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-switch-to-session-with-code</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v a</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-sha1-hash</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v h</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-describe-bindings</td>
</tr>
<tr>
2020-05-26 08:40:15 +02:00
<td class="org-left"><code>C-c C-v x</code></td>
2020-01-11 22:04:45 +01:00
<td class="org-left">org-babel-do-key-sequence-in-edit-buffer</td>
</tr>
</tbody>
</table>
2021-04-25 19:10:57 +02:00
<p>
Timers:
</p>
<ul class="org-ul">
<li><code>C-c C-x 0</code>: Start Timer</li>
<li><code>C-c C-x .</code>: Insert timestamp</li>
<li><code>C-c C-x ,</code>: Pause Timer</li>
<li><code>C-c C-x _</code>: Stop Timer</li>
</ul>
<p>
Tables:
</p>
<ul class="org-ul">
<li><code>S-RET</code>: copy and increment the cell at point</li>
</ul>
2020-01-11 22:04:45 +01:00
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org3f45876" class="outline-3">
<h3 id="org3f45876">Evil bindings</h3>
<div class="outline-text-3" id="text-org3f45876">
2020-05-26 08:40:15 +02:00
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
<tbody>
<tr>
<td class="org-left"><code>gv</code></td>
<td class="org-left">Selects the previous visual</td>
</tr>
<tr>
<td class="org-left"><code>o</code> in visual mode</td>
<td class="org-left">go to the `Other` end of the selection</td>
</tr>
<tr>
<td class="org-left"><code>g=</code> and <code>g-</code></td>
<td class="org-left">Increase/decrement number</td>
</tr>
<tr>
<td class="org-left"><code>t</code> followed by any char</td>
<td class="org-left">goes &ldquo;till&rdquo; next character (not included)</td>
</tr>
<tr>
<td class="org-left"><code>f</code> followed by any char</td>
<td class="org-left">&ldquo;find&rdquo; next character (included)</td>
</tr>
<tr>
<td class="org-left"><code>yt.</code></td>
<td class="org-left">yank until next <code>.</code></td>
</tr>
</tbody>
</table>
2020-01-11 22:04:45 +01:00
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org3224622" class="outline-2">
<h2 id="org3224622">Basic Configuration</h2>
<div class="outline-text-2" id="text-org3224622">
2020-05-26 08:40:15 +02:00
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org0f6c087" class="outline-3">
<h3 id="org0f6c087">Personal Information</h3>
<div class="outline-text-3" id="text-org0f6c087">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">These are used for a number of things, particularly for GPG configuration,</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">some email clients, file templates and snippets.</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">user-full-name</span> <span class="org-string">"Dehaeze Thomas"</span>
<span class="org-variable-name">user-mail-address</span> <span class="org-string">"dehaeze.thomas@gmail.com"</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-05-26 08:40:15 +02:00
</div>
</div>
2020-01-11 22:04:45 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-org54b7708" class="outline-3">
<h3 id="org54b7708">Doom Config</h3>
<div class="outline-text-3" id="text-org54b7708">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">doom-font</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">font-spec</span> <span class="org-builtin">:family</span> <span class="org-string">"Hack Nerd Font Mono"</span> <span class="org-builtin">:size</span> <span class="org-highlight-numbers-number">12</span> <span class="org-builtin">:weight</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">semi-light</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-variable-name">doom-variable-pitch-font</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">font-spec</span> <span class="org-builtin">:family</span> <span class="org-string">"Hack Nerd Font Mono"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-variable-name">doom-unicode-font</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">font-spec</span> <span class="org-builtin">:family</span> <span class="org-string">"Hack Nerd Font Mono"</span> <span class="org-builtin">:size</span> <span class="org-highlight-numbers-number">12</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-variable-name">doom-big-font</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">font-spec</span> <span class="org-builtin">:family</span> <span class="org-string">"Hack Nerd Font Mono"</span> <span class="org-builtin">:size</span> <span class="org-highlight-numbers-number">19</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">doom-theme</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">leuven</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">display-line-numbers-type</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
2020-11-03 16:27:09 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package</span> doom-modeline
<span class="org-builtin">:hook</span> <span class="org-rainbow-delimiters-depth-2">(</span>after-init . <span class="org-variable-name">doom-modeline-mode</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:custom</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-height</span> <span class="org-highlight-numbers-number">25</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-bar-width</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-icon</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-major-mode-icon</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-major-mode-color-icon</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-buffer-file-name-style</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">truncate-upto-project</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-buffer-state-icon</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-buffer-modification-icon</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-minor-modes</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-enable-word-count</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-buffer-encoding</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-indent-info</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-checker-simple-format</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-vcs-max-length</span> <span class="org-highlight-numbers-number">12</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-env-version</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-irc-stylize</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">identity</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">doom-modeline-github-timer</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">doom-modeline-gnus-timer</span> nil<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-05-26 08:40:15 +02:00
</div>
</div>
2020-01-11 22:04:45 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgb47335d" class="outline-3">
<h3 id="orgb47335d">Evil</h3>
<div class="outline-text-3" id="text-orgb47335d">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> evil
2021-05-02 11:27:39 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:m</span> <span class="org-string">"-"</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">dired-jump</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">evil-respect-visual-line-mode</span> nil<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-03-22 23:04:07 +01:00
<p>
Make movement keys work like they should
</p>
2020-03-01 22:51:16 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">evil-normal-state-map</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">kbd</span> <span class="org-string">"&lt;remap&gt; &lt;evil-next-line&gt;"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">evil-next-visual-line</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">define-key</span> <span class="org-variable-name">evil-normal-state-map</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">kbd</span> <span class="org-string">"&lt;remap&gt; &lt;evil-previous-line&gt;"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">evil-previous-visual-line</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">define-key</span> <span class="org-variable-name">evil-motion-state-map</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">kbd</span> <span class="org-string">"&lt;remap&gt; &lt;evil-next-line&gt;"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">evil-next-visual-line</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">define-key</span> <span class="org-variable-name">evil-motion-state-map</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">kbd</span> <span class="org-string">"&lt;remap&gt; &lt;evil-previous-line&gt;"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">evil-previous-visual-line</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-01 22:51:16 +01:00
</pre>
</div>
2020-03-22 23:04:07 +01:00
<p>
Make horizontal movement cross lines
</p>
2020-03-01 22:51:16 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq-default</span> <span class="org-variable-name">evil-cross-lines</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-01 22:51:16 +01:00
</pre>
</div>
2021-01-01 20:12:34 +01:00
2021-05-02 11:27:39 +02:00
<p>
;; In org-mode, $ does not go to the real end of line, it jumps to the end of <i>visual</i> line
;; Create a real end of line by APPENDING and then going back to normal state
</p>
2021-01-01 20:12:34 +01:00
<p>
Evil Surround (not working):
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">this macro was copied from here: https://stackoverflow.com/a/22418983/4921402</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defmacro</span> <span class="org-function-name">define-and-bind-quoted-text-object</span> <span class="org-rainbow-delimiters-depth-2">(</span>name key start-regex end-regex<span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>inner-name <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">make-symbol</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-string">"evil-inner-"</span> name<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>outer-name <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">make-symbol</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-string">"evil-a-"</span> name<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">progn</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">evil-define-text-object</span> ,inner-name <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">count</span> <span class="org-type">&amp;optional</span> beg end type<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">evil-select-paren</span> ,start-regex ,end-regex beg end type count nil<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">evil-define-text-object</span> ,outer-name <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">count</span> <span class="org-type">&amp;optional</span> beg end type<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">evil-select-paren</span> ,start-regex ,end-regex beg end type count t<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">define-key</span> <span class="org-variable-name">evil-inner-text-objects-map</span> ,key <span class="org-highlight-quoted-quote">#'</span>,inner-name<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">define-key</span> <span class="org-variable-name">evil-outer-text-objects-map</span> ,key <span class="org-highlight-quoted-quote">#'</span>,outer-name<span class="org-rainbow-delimiters-depth-4">)</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>
2021-01-01 20:12:34 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Add dollar as a surround object</span>
<span class="org-rainbow-delimiters-depth-1">(</span>define-and-bind-quoted-text-object <span class="org-string">"dollar"</span> <span class="org-string">"$"</span> <span class="org-string">"\\$"</span> <span class="org-string">"\\$"</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
2020-03-01 22:51:16 +01:00
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org91191b1" class="outline-3">
<h3 id="org91191b1">Which Key</h3>
<div class="outline-text-3" id="text-org91191b1">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> which-key
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">which-key-idle-delay</span> <span class="org-highlight-numbers-number">0.5</span>
<span class="org-variable-name">which-key-idle-secondary-delay</span> <span class="org-highlight-numbers-number">0.01</span>
<span class="org-variable-name">which-key-sort-order</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">which-key-key-order-alpha</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org984cbff" class="outline-3">
<h3 id="org984cbff">Visual</h3>
<div class="outline-text-3" id="text-org984cbff">
2020-01-11 22:04:45 +01:00
<p>
Automatic line wrap.
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">global-visual-line-mode</span> nil<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<p>
Turn off auto-fill mode that add line breaks.
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">auto-fill-mode</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">remove-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">text-mode-hook</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">turn-on-auto-fill</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-comment-delimiter">;; </span><span class="org-comment">turn off auto-fill for org-mode</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">turn-off-auto-fill</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-keyword">after!</span> auctex
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">latex-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">turn-off-auto-fill</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-11-03 16:27:09 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org4a815d7" class="outline-3">
<h3 id="org4a815d7">Useful General Functions</h3>
<div class="outline-text-3" id="text-org4a815d7">
2020-11-03 16:27:09 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-matlab-work</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Setup Matlab Work Windows"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">delete-other-windows</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">evil-window-vsplit</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">evil-window-right</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">switch-to-buffer</span> <span class="org-string">"*MATLAB*"</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-04-25 19:10:57 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">evil-normal-state</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">evil-goto-line</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">evil-window-left</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org5481666" class="outline-3">
<h3 id="org5481666">Change default alert backend</h3>
<div class="outline-text-3" id="text-org5481666">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">alert-default-style</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">libnotify</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-04-25 19:10:57 +02:00
<div id="outline-container-org2b36dfb" class="outline-3">
<h3 id="org2b36dfb">Spell Check</h3>
<div class="outline-text-3" id="text-org2b36dfb">
<p>
Switch from one language to an other (<a href="https://stackoverflow.com/questions/42159012/emacs-spell-check-on-fly-for-2-languages">link</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">setq</span> <span class="org-variable-name">ispell-dictionary</span> <span class="org-string">"en_US"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">ispell-program-name</span> <span class="org-string">"aspell"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
2021-10-25 14:37:10 +02:00
<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">tdh-correct-last-word</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">+spell/previous-error</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">+spell/correct</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>
<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">evil-insert-state-map</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">kbd</span> <span class="org-string">"C-l"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-correct-last-word</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
2021-04-25 19:10:57 +02:00
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgb4aa789" class="outline-3">
<h3 id="orgb4aa789">Lockfiles</h3>
<div class="outline-text-3" id="text-orgb4aa789">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">create-lockfiles</span> nil<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-01-28 21:32:38 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-org96b05b8" class="outline-3">
<h3 id="org96b05b8">Disable highlight of current line</h3>
<div class="outline-text-3" id="text-org96b05b8">
2020-01-28 21:32:38 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">global-hl-line-mode</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-mode-hook</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span><span class="org-rainbow-delimiters-depth-4">()</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-variable-name">hl-line-mode</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-variable-name">global-hl-line-mode</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">t</span>
<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-28 21:32:38 +01:00
</pre>
</div>
</div>
</div>
2020-03-22 23:04:07 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgd71ea39" class="outline-3">
<h3 id="orgd71ea39">Remap <code>jump-forward</code> key binding</h3>
<div class="outline-text-3" id="text-orgd71ea39">
2020-03-22 23:04:07 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">with-eval-after-load</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">better-jumper</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span>
<span class="org-builtin">:desc</span> <span class="org-string">"Jump Forward"</span>
<span class="org-string">"C-i"</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">better-jumper-jump-forward</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgd5e9661" class="outline-3">
<h3 id="orgd5e9661">Magit</h3>
<div class="outline-text-3" id="text-orgd5e9661">
2020-05-26 08:40:15 +02:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">setenv</span> <span class="org-string">"GIT_ASKPASS"</span> <span class="org-string">"git-gui--askpass"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> magit
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">magit-diff-refine-hunk</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">all</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">magit-repository-directories</span> <span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"~/Cloud/thesis/matlab/"</span> . <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"~/Cloud/thesis/papers/"</span> . <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">magit-repolist-columns</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"Name"</span> <span class="org-highlight-numbers-number">25</span> magit-repolist-column-ident nil<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"Status"</span> <span class="org-highlight-numbers-number">7</span> magit-repolist-column-flag<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"B&lt;U"</span> <span class="org-highlight-numbers-number">3</span> magit-repolist-column-unpulled-from-upstream
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:right-align</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:help-echo</span> <span class="org-string">"Upstream changes not in branch"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"B&gt;U"</span> <span class="org-highlight-numbers-number">3</span> magit-repolist-column-unpushed-to-upstream
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:right-align</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:help-echo</span> <span class="org-string">"Local changes not in upstream"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"Path"</span> <span class="org-highlight-numbers-number">99</span> magit-repolist-column-path nil<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org7bf3713" class="outline-3">
<h3 id="org7bf3713">Dired</h3>
<div class="outline-text-3" id="text-org7bf3713">
2020-05-26 08:40:15 +02:00
<ul class="org-ul">
2021-01-08 01:34:53 +01:00
<li><code>C-c C-e</code> Writable Dired mode, when changes are done <code>C-c C-c</code>.</li>
</ul>
<p>
This works also with <code>C-x C-q</code>
</p>
<ul class="org-ul">
2020-05-26 08:40:15 +02:00
<li><code>C-c C-r</code> use <code>rsync</code> to copy file in the background</li>
<li><code>+</code> Create a directory</li>
<li><code>R</code> Rename / move</li>
<li><code>C</code> Copy</li>
<li><code>d</code> Delete</li>
<li><code>m</code> Mark</li>
<li><code>U</code> unmark all marked</li>
<li><code>t</code> invert the selection</li>
<li><code>u</code> unmark / undelete</li>
<li><code>x</code> actually delete files/directories marked for deletion</li>
<li><code>!</code> Execute shell command on this file, or currently marked files</li>
<li><code>%m</code> mark by pattern</li>
<li><code>o</code> sort by time/name</li>
<li><code>(</code> Hide details</li>
<li><code>)</code> Show git infos</li>
</ul>
2021-10-25 14:37:10 +02:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> magit
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">dired-listing-switches</span> <span class="org-string">"-lAGh1v --group-directories-first"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">dired-mode-hook</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-4">()</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-variable-name">dired-hide-details-mode</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">dired-sort-toggle-or-edit</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-05-26 08:40:15 +02:00
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org6f4d128" class="outline-3">
<h3 id="org6f4d128">PDF-Tools</h3>
<div class="outline-text-3" id="text-org6f4d128">
2020-05-26 08:40:15 +02:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> pdf-tools
<span class="org-builtin">:config</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">pdf-view-mode-hook</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span><span class="org-rainbow-delimiters-depth-4">()</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">linum-mode</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-22 23:04:07 +01:00
</pre>
</div>
2021-02-10 18:02:02 +01:00
<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">tdh-screenshot-page</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Open current page as an SVG file with Inkscape"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">string-match</span> <span class="org-string">"_"</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">file-name-base</span> <span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> filename <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">read-string</span> <span class="org-string">"Enter file name:"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">car</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">split-string</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">file-name-base</span> <span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-string">"_"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> filename <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">read-string</span> <span class="org-string">"Enter file name:"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-02-10 18:02:02 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> filepath <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"/tmp/"</span> filename <span class="org-string">".svg"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">shell-command</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"pdftk "</span> <span class="org-variable-name">buffer-file-name</span> <span class="org-string">" cat "</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">number-to-string</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">pdf-view-current-page</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-string">" output /tmp/pdf_page.pdf"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-02-10 18:02:02 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">shell-command</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"pdf2svg /tmp/pdf_page.pdf "</span> filepath<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">start-process</span> <span class="org-string">""</span> nil <span class="org-string">"inkscape"</span> filepath<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> pdf-tools
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">pdf-view-mode-map</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Screenshot"</span>
<span class="org-builtin">:ni</span> <span class="org-string">"C-c s"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-screenshot-page</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>
2020-03-22 23:04:07 +01:00
</div>
</div>
2020-05-26 08:40:15 +02:00
2021-10-25 14:37:10 +02:00
<div id="outline-container-orgb8c8c72" class="outline-3">
<h3 id="orgb8c8c72">Flycheck</h3>
<div class="outline-text-3" id="text-orgb8c8c72">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">flycheck-define-checker</span> proselint
<span class="org-doc">"A linter for prose."</span>
<span class="org-builtin">:command</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"proselint"</span> source-inplace<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:error-patterns</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>warning line-start <span class="org-rainbow-delimiters-depth-4">(</span>file-name<span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-string">":"</span> line <span class="org-string">":"</span> column <span class="org-string">": "</span>
<span class="org-rainbow-delimiters-depth-4">(</span>id <span class="org-rainbow-delimiters-depth-1">(</span>one-or-more <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-3">(</span>any <span class="org-string">" "</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><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">message</span> <span class="org-rainbow-delimiters-depth-1">(</span>one-or-more not-newline<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>zero-or-more <span class="org-string">"\n"</span> <span class="org-rainbow-delimiters-depth-2">(</span>any <span class="org-string">" "</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span>one-or-more not-newline<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
line-end<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:modes</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">text-mode</span> markdown-mode gfm-mode org-mode<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-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">flycheck-checkers</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">proselint</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<p>
Disable flycheck for now with orgmode buffers:
</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">disable-flycheck-mode</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">flycheck-mode</span> <span class="org-highlight-numbers-number">-1</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-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">disable-flycheck-mode</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orga52aafb" class="outline-3">
<h3 id="orga52aafb">Yassnippets</h3>
<div class="outline-text-3" id="text-orga52aafb">
2020-05-26 08:40:15 +02:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">push</span> <span class="org-string">"~/.config/doom/snippets"</span> <span class="org-variable-name">yas-snippet-dirs</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">yas-global-mode</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
2020-01-11 22:04:45 +01:00
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgdaacd7b" class="outline-3">
<h3 id="orgdaacd7b">Ox-Hugo</h3>
<div class="outline-text-3" id="text-orgdaacd7b">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-export-everything-to-hugo</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Export all the .org files in the specified directory to markdown using Hugo"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> org-files <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">directory-files</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">read-directory-name</span> <span class="org-string">"Directory:"</span> <span class="org-string">"/home/thomas/Cloud/brain/"</span><span class="org-rainbow-delimiters-depth-4">)</span> t <span class="org-string">"org$"</span> t<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">while</span> org-files
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> current-org-file <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">car</span> org-files<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">message</span> <span class="org-string">"Exporting %s"</span> current-org-file<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">find-file</span> current-org-file<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-hugo-export-to-md</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> org-files <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">cdr</span> org-files<span class="org-rainbow-delimiters-depth-4">)</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgadec3c9" class="outline-3">
<h3 id="orgadec3c9">Others</h3>
<div class="outline-text-3" id="text-orgadec3c9">
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">auto-save-default</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
</div>
</div>
2020-05-26 08:40:15 +02:00
</div>
2020-01-11 22:04:45 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-org48e26f0" class="outline-2">
<h2 id="org48e26f0">Org Mode</h2>
<div class="outline-text-2" id="text-org48e26f0">
2020-01-11 22:04:45 +01:00
<ul class="org-ul">
<li><a href="http://cachestocaches.com/2016/9/my-workflow-org-agenda/">http://cachestocaches.com/2016/9/my-workflow-org-agenda/</a></li>
<li><a href="http://doc.norang.ca/org-mode.html#TodoKeywords">http://doc.norang.ca/org-mode.html#TodoKeywords</a></li>
<li><a href="https://emacs.cafe/emacs/orgmode/gtd/2017/06/30/orgmode-gtd.html">https://emacs.cafe/emacs/orgmode/gtd/2017/06/30/orgmode-gtd.html</a></li>
</ul>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org9a192de" class="outline-3">
<h3 id="org9a192de">Org General Config</h3>
<div class="outline-text-3" id="text-org9a192de">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-directory</span> <span class="org-string">"~/Cloud/org/"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-directory</span> <span class="org-string">"~/Cloud/org/"</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-03-01 22:51:16 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Replace the content marker, &#8220;&#8943;&#8221;, with a nice unicode arrow.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-ellipsis</span> <span class="org-string">" &#10549;"</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-03-01 22:51:16 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-default-notes-file</span> <span class="org-string">"~/Cloud/org/refile.org"</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Avoid accidentally editing folded regions, say by adding text after an Org &#8220;&#8943;&#8221;.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-catch-invisible-edits</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">show</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">The following setting hides blank lines between headings which keeps folded view nice and compact.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-cycle-separator-lines</span> <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Indent according to the outline structure</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-startup-indented</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-startup-folded</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Record the information of when the task was marked as DONE</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-log-done</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">time</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-03-01 22:51:16 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">begining of line on heading behavior</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-special-ctrl-a/e</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<p>
TAB was changed to toggle only the visibility state of the current subtree, rather than cycle through it recursively. This can be reversed with:
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> evil-org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">remove-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-tab-first-hook</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">+org-cycle-only-current-subtree-h</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org9c78e0f" class="outline-3">
<h3 id="org9c78e0f">Org Inline Images</h3>
<div class="outline-text-3" id="text-org9c78e0f">
2020-03-19 10:42:30 +01:00
<p>
Display the real size of images and not the one set with <code>attr_latex: :width \linewidth</code> for instance.
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-image-actual-width</span> t<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-19 10:42:30 +01:00
</pre>
</div>
</div>
</div>
2021-10-25 14:37:10 +02:00
<div id="outline-container-org42be289" class="outline-3">
<h3 id="org42be289">Org Links</h3>
<div class="outline-text-3" id="text-org42be289">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-link-abbrev-alist</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"bib"</span> . <span class="org-string">"~/Cloud/brain/biblio/references.bib::%s"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"notes"</span> . <span class="org-string">"~/Cloud/brain/%s.org"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"papers"</span> . <span class="org-string">"~/Cloud/pdfs/%s.pdf"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2021-01-01 20:12:34 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh/pdf-link</span> <span class="org-rainbow-delimiters-depth-2">(</span>filename<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">start-process</span> <span class="org-string">""</span> nil <span class="org-string">"zathura"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"~/Cloud/pdfs/"</span> filename <span class="org-string">".pdf"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-string">""</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-link-set-parameters</span> <span class="org-string">"pdf"</span> <span class="org-builtin">:follow</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">tdh/pdf-link</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
2020-01-11 22:04:45 +01:00
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org06d5c9f" class="outline-3">
<h3 id="org06d5c9f">Org Tagging</h3>
<div class="outline-text-3" id="text-org06d5c9f">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-comment-delimiter">;; </span><span class="org-comment">Align Tags and flush right</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-tags-column</span> <span class="org-highlight-numbers-number">-78</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Tags with fast selection keys</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-tag-alist</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">quote</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"@home"</span> . ?h<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"@work"</span> . ?w<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"@christophe"</span> . ?c<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"@veijo"</span> . ?v<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org82e8603" class="outline-3">
<h3 id="org82e8603">Org Refile</h3>
<div class="outline-text-3" id="text-org82e8603">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-refile-targets</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-variable-name">org-agenda-files</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:maxlevel</span> . <span class="org-highlight-numbers-number">6</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org4e35a03" class="outline-3">
<h3 id="org4e35a03">Org TODO</h3>
<div class="outline-text-3" id="text-org4e35a03">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-comment-delimiter">;; </span><span class="org-comment">Tags with fast selection keys</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-todo-keywords</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span>sequence <span class="org-string">"</span><span class="org-string"><span class="org-bold"><span class="org-warning">TODO</span></span></span><span class="org-string">(t)"</span> <span class="org-string">"NEXT(n)"</span> <span class="org-string">"MAIL(m)"</span> <span class="org-string">"|"</span> <span class="org-string">"DONE(d)"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>sequence <span class="org-string">"READ(r)"</span> <span class="org-string">"BKMK(b)"</span> <span class="org-string">"EXER(x)"</span> <span class="org-string">"|"</span> <span class="org-string">"DONE(d)"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>sequence <span class="org-string">"WAIT(w@/!)"</span> <span class="org-string">"SDAY(s)"</span> <span class="org-string">"|"</span> <span class="org-string">"CANC(c@/!)"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>sequence <span class="org-string">"QUES(q)"</span> <span class="org-string">"|"</span> <span class="org-string">"ANSW(a)"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>sequence <span class="org-string">"EXAM(e)"</span> <span class="org-string">"IDEA(i)"</span> <span class="org-string">"|"</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Display of the keywords</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-todo-keyword-faces</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"</span><span class="org-string"><span class="org-bold"><span class="org-warning">TODO</span></span></span><span class="org-string">"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"EXER"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"NEXT"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"MAIL"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"READ"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"ANSW"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#689d6a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">aqua</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"DONE"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#689d6a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">aqua</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"WAIT"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#d65d0e"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">orange</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"QUES"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#d79921"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">yellow</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"CANC"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#a89984"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">grey</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"SDAY"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#98971a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">green</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"BKMK"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#98971a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">green</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"IDEA"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#98971a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">green</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"EXAM"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#98971a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">green</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org10bb4ba" class="outline-3">
<h3 id="org10bb4ba">Org Archive</h3>
<div class="outline-text-3" id="text-org10bb4ba">
2020-01-11 22:04:45 +01:00
<p>
<a href="https://gist.github.com/Fuco1/e86fb5e0a5bb71ceafccedb5ca22fcfb">https://gist.github.com/Fuco1/e86fb5e0a5bb71ceafccedb5ca22fcfb</a>
2020-05-26 08:40:15 +02:00
Archive subtrees under the same hierarchy as original in the archive files
2020-01-11 22:04:45 +01:00
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defadvice</span> <span class="org-function-name">org-archive-subtree</span> <span class="org-rainbow-delimiters-depth-3">(</span>around fix-hierarchy activate<span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span>fix-archive-p <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">not</span> <span class="org-variable-name">current-prefix-arg</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">use-region-p</span><span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-rainbow-delimiters-depth-1">(</span>location <span class="org-rainbow-delimiters-depth-2">(</span>org-archive--compute-location <span class="org-variable-name">org-archive-location</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>afile <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> location<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>offset <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">=</span> <span class="org-highlight-numbers-number">0</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">length</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cdr</span> location<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-highlight-numbers-number">1</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">1+</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">string-match</span> <span class="org-string">"[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">*]"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cdr</span> location<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-rainbow-delimiters-depth-1">(</span>buffer <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">or</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">find-buffer-visiting</span> afile<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">find-file-noselect</span> afile<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-4">)</span>
2021-01-08 01:34:53 +01:00
ad-do-it
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">when</span> fix-archive-p
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">with-current-buffer</span> buffer
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">point-max</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">&gt;</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-current-level</span><span class="org-rainbow-delimiters-depth-4">)</span> offset<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-up-heading-safe</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>olpath <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-entry-get</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-string">"ARCHIVE_OLPATH"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>path <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> olpath <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">split-string</span> olpath <span class="org-string">"/"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>level offset<span class="org-rainbow-delimiters-depth-4">)</span>
tree-text<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> olpath
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-mark-subtree</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">setq</span> tree-text <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">buffer-substring</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">region-beginning</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">region-end</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">this-command</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-cut-subtree</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point-min</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">save-restriction</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">widen</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">-each</span> path
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">(</span>heading<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">re-search-forward</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">rx-to-string</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-2">(</span>: bol <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">repeat</span> ,level <span class="org-string">"*"</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">1+</span> <span class="org-string">" "</span><span class="org-rainbow-delimiters-depth-3">)</span> ,heading<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-warning">nil t</span><span class="org-warning"><span class="org-rainbow-delimiters-depth-4">)</span></span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-narrow-to-subtree</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point-max</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">unless</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">looking-at</span> <span class="org-string">"^"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">insert</span> <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">make-string</span> level ?*<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-string">" "</span>
heading
2021-10-25 14:37:10 +02:00
<span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">cl-incf</span> level<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">widen</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-end-of-subtree</span> t t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-paste-subtree</span> level tree-text<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgb18d1ed" class="outline-3">
<h3 id="orgb18d1ed">Org Agenda</h3>
<div class="outline-text-3" id="text-orgb18d1ed">
2020-05-26 08:40:15 +02:00
<p>
General configuration
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-comment-delimiter">;; </span><span class="org-comment">File to save todo items</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-files</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">list</span> <span class="org-string">"~/Cloud/org/"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Include archived files</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-archives-mode</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Set priority range from A to C with default A</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-highest-priority</span> ?A<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-lowest-priority</span> ?C<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-default-priority</span> ?C<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Set colours for priorities</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-priority-faces</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>?A . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#FB4934"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>?B . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#FABD2F"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>?C . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#98971A"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Open agenda in current window</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-window-setup</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">current-window</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Set default first day of agenda</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-start-day</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-start-on-weekday</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-span</span> <span class="org-highlight-numbers-number">7</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-prefix-format</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>agenda . <span class="org-string">" %?-12t% s"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>todo . <span class="org-string">""</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">Don't show the filename for reading agenda</span>
<span class="org-rainbow-delimiters-depth-4">(</span>tags . <span class="org-string">" %-12:c"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">search</span> . <span class="org-string">" %-12:c"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<p>
2020-05-26 08:40:15 +02:00
Org Agenda Custom Views
2020-01-11 22:04:45 +01:00
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org-agenda
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-org-agenda-skip-scheduled</span> <span class="org-rainbow-delimiters-depth-3">()</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-agenda-skip-entry-if</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">scheduled</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">deadline</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">regexp</span> <span class="org-string">"\n]+&gt;"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-custom-commands</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"w"</span> <span class="org-string">"Work"</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>tags <span class="org-string">"@work"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"</span><span class="org-string"><span class="org-bold"><span class="org-warning">TODO</span></span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>priority <span class="org-string">"A"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Important TODOs"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>tags <span class="org-string">"@work"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"</span><span class="org-string"><span class="org-bold"><span class="org-warning">TODO</span></span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>priority <span class="org-string">"B"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"TODOs"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>tags <span class="org-string">"@work"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"</span><span class="org-string"><span class="org-bold"><span class="org-warning">TODO</span></span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>priority <span class="org-string">"C"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Not important TODOs"</span><span class="org-rainbow-delimiters-depth-4">)</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><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"h"</span> <span class="org-string">"Home"</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>tags <span class="org-string">"@home"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"</span><span class="org-string"><span class="org-bold"><span class="org-warning">TODO</span></span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>priority <span class="org-string">"A"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Things to do"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>tags <span class="org-string">"@home"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"</span><span class="org-string"><span class="org-bold"><span class="org-warning">TODO</span></span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>priority <span class="org-string">"B"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Things to do"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>tags <span class="org-string">"@home"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"</span><span class="org-string"><span class="org-bold"><span class="org-warning">TODO</span></span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>priority <span class="org-string">"C"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Things to do"</span><span class="org-rainbow-delimiters-depth-4">)</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><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"q"</span> <span class="org-string">"Questions to ask"</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"QUES"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>tags <span class="org-string">"@christophe"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Questions to Christophe"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"QUES"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>tags <span class="org-string">"@veijo"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Questions to Veijo"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"QUES"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-1">(</span>tags <span class="org-string">"@veijo"</span> <span class="org-string">"@christophe"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Other Questions"</span><span class="org-rainbow-delimiters-depth-4">)</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><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"R"</span> <span class="org-string">"Already read Articles and Books"</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"DONE"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>level <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>tags <span class="org-string">"article"</span> <span class="org-string">"inproceedings"</span> <span class="org-string">"techreport"</span> <span class="org-string">"inbook"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Articles"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"DONE"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>level <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>tags <span class="org-string">"book"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Books"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"DONE"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>level <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>tags <span class="org-string">"phdthesis"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Phd Thesis"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"DONE"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>level <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-1">(</span>tags <span class="org-string">"article"</span> <span class="org-string">"inproceedings"</span> <span class="org-string">"techreport"</span> <span class="org-string">"inbook"</span> <span class="org-string">"book"</span> <span class="org-string">"phdthesis"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Other Things"</span><span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-files</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"~/Cloud/brain/"</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><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"r"</span> <span class="org-string">"Articles and Books to read"</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"READ"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>level <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>tags <span class="org-string">"article"</span> <span class="org-string">"inproceedings"</span> <span class="org-string">"techreport"</span> <span class="org-string">"inbook"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Article to Read"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"READ"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>level <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>tags <span class="org-string">"book"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Books to Read"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"READ"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>level <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>tags <span class="org-string">"phdthesis"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Phd Thesis to Read"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span>todo <span class="org-string">"READ"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>level <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-1">(</span>tags <span class="org-string">"article"</span> <span class="org-string">"inproceedings"</span> <span class="org-string">"techreport"</span> <span class="org-string">"inbook"</span> <span class="org-string">"book"</span> <span class="org-string">"phdthesis"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>org-ql-block-header <span class="org-string">"Other Things to Read"</span><span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-files</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"~/Cloud/brain/"</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><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-02-10 18:02:02 +01:00
<div id="outline-container-org5b2fa78" class="outline-3">
<h3 id="org5b2fa78">Org Agenda HTML</h3>
<div class="outline-text-3" id="text-org5b2fa78">
<p>
This function can be used to export the week calendar to html.
This html page can be used as a starting page for the browser.
This idea comes from <a href="https://blog.lambda.cx/posts/org-agenda-new-tab/">here</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">tdh-org-agenda-to-html</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-agenda-list</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-agenda-write</span> <span class="org-string">"/ssh:thomas@homelab:~/docker/config/calendar/www/index.html"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-02-10 18:02:02 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgfc73fc4" class="outline-3">
<h3 id="orgfc73fc4">Org Fancy Priority</h3>
<div class="outline-text-3" id="text-orgfc73fc4">
2020-03-01 22:51:16 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> org-fancy-priorities <span class="org-comment-delimiter">; </span><span class="org-comment">priority icons</span>
<span class="org-builtin">:hook</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-mode</span> . <span class="org-variable-name">org-fancy-priorities-mode</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:config</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-fancy-priorities-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"&#9632;"</span> <span class="org-string">"&#9632;"</span> <span class="org-string">"&#9632;"</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>
2020-03-01 22:51:16 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orge3db067" class="outline-3">
<h3 id="orge3db067">Org Notification based on calendar event</h3>
<div class="outline-text-3" id="text-orge3db067">
2020-01-11 22:04:45 +01:00
<p>
<a href="https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarms-audio-visual-triggered-by-org-mode-events">https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarms-audio-visual-triggered-by-org-mode-events</a>
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org-agenda
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">appt-message-warning-time</span> <span class="org-highlight-numbers-number">5</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-org-agenda-to-appt</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>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">appt-time-msg-list</span> nil<span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-agenda-to-appt</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">tdh-org-agenda-to-appt</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">; </span><span class="org-comment">Display appointments as a window manager notification</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">appt-disp-window-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-appt-display</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">appt-delete-window-function</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-4">()</span> t<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> tdh-appt-notification-app <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">getenv</span> <span class="org-string">"HOME"</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-string">"/bin/appt-notification"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-appt-display</span> <span class="org-rainbow-delimiters-depth-3">(</span>min-to-app new-time msg<span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">atom</span> min-to-app<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">start-process</span> <span class="org-string">"tdh-appt-notification-app"</span> nil tdh-appt-notification-app min-to-app msg<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">dolist</span> <span class="org-rainbow-delimiters-depth-1">(</span>i <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">number-sequence</span> <span class="org-highlight-numbers-number">0</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">1-</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">length</span> min-to-app<span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">start-process</span> <span class="org-string">"tdh-appt-notification-app"</span> nil tdh-appt-notification-app <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> i min-to-app<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> i msg<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgcbb0b10" class="outline-4">
<h4 id="orgcbb0b10">appt-notification script</h4>
<div class="outline-text-4" id="text-orgcbb0b10">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-bash"><span class="org-variable-name">TIME</span>=<span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">1</span></span><span class="org-string">"</span>TODO
<span class="org-variable-name">MSG</span>=<span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">2</span></span><span class="org-string">"</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
dunstify --replace=<span class="org-highlight-numbers-number">85401</span> <span class="org-string">"Event in </span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">TIME</span></span><span class="org-string"> minutes"</span> <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">MSG</span></span><span class="org-string">"</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org2d7850b" class="outline-3">
<h3 id="org2d7850b">Org Structure Template</h3>
<div class="outline-text-3" id="text-org2d7850b">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">org-tempo</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-structure-template-alist</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"c"</span> . <span class="org-string">"center"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"C"</span> . <span class="org-string">"comment"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"mm"</span> . <span class="org-string">"src matlab"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"mf"</span> . <span class="org-string">"src matlab :exports none"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"mv"</span> . <span class="org-string">"src matlab :results value replace :exports results :tangle no"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"l"</span> . <span class="org-string">"src emacs-lisp"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"q"</span> . <span class="org-string">"quote"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"s"</span> . <span class="org-string">"src"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"ba"</span> . <span class="org-string">"answer"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"bd"</span> . <span class="org-string">"definition"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"be"</span> . <span class="org-string">"exampl"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"bx"</span> . <span class="org-string">"exercice"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"bq"</span> . <span class="org-string">"question"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"bs"</span> . <span class="org-string">"summary"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"bS"</span> . <span class="org-string">"seealso"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"bh"</span> . <span class="org-string">"hint"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"bn"</span> . <span class="org-string">"note"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"bi"</span> . <span class="org-string">"important"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"bc"</span> . <span class="org-string">"caution"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"bw"</span> . <span class="org-string">"warning"</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org96e2697" class="outline-3">
<h3 id="org96e2697">Org Capture</h3>
<div class="outline-text-3" id="text-org96e2697">
2020-01-11 22:04:45 +01:00
<p>
Documentation:
</p>
<ul class="org-ul">
<li>Template elements: <a href="https://orgmode.org/manual/Template-elements.html#Template-elements">https://orgmode.org/manual/Template-elements.html#Template-elements</a></li>
<li>Template expansion: <a href="https://orgmode.org/manual/Template-expansion.html#Template-expansion">https://orgmode.org/manual/Template-expansion.html#Template-expansion</a></li>
<li>Capture protocol: <a href="https://orgmode.org/manual/capture-protocol.html">https://orgmode.org/manual/capture-protocol.html</a></li>
</ul>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-capture-templates</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">quote</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"t"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">key</span>
2021-01-08 01:34:53 +01:00
<span class="org-string">"Todo"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">name</span>
entry <span class="org-comment-delimiter">; </span><span class="org-comment">type</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Inbox"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">target</span>
<span class="org-string">"** </span><span class="org-string"><span class="org-bold"><span class="org-warning">TODO</span></span></span><span class="org-string"> %?\n%U\n"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">template</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"M"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">key</span>
2021-01-08 01:34:53 +01:00
<span class="org-string">"Meeting"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">name</span>
entry <span class="org-comment-delimiter">; </span><span class="org-comment">type</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Meetings"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">target</span>
2021-01-08 01:34:53 +01:00
<span class="org-string">"** %?\n%(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">template</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"m"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">key</span>
2021-01-08 01:34:53 +01:00
<span class="org-string">"Mail"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">name</span>
entry <span class="org-comment-delimiter">; </span><span class="org-comment">type</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Mails"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">target</span>
<span class="org-string">"** </span><span class="org-string"><span class="org-bold"><span class="org-warning">TODO</span></span></span><span class="org-string"> [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%a\n"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">template</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"r"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">key</span>
2021-01-08 01:34:53 +01:00
<span class="org-string">"Reference"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">name</span>
entry <span class="org-comment-delimiter">; </span><span class="org-comment">type</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/inbox-ereader.org"</span> <span class="org-string">"Things to Read"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">target</span>
<span class="org-string">"** </span><span class="org-string"><span class="org-bold"><span class="org-warning">TODO</span></span></span><span class="org-string"> [#B] %?\n"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">template</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pm"</span>
2021-01-08 01:34:53 +01:00
<span class="org-string">"Org-Protocol Mail"</span>
entry
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Mails"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-string">"* MAIL %:description [[message:%:link][link]]\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%i\n"</span>
<span class="org-builtin">:immediate-finish</span> t
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"ps"</span>
<span class="org-string">"Org-Protocol Sent Mail"</span>
entry
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Mails"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-string">"* WAIT %:description [[message:%:link][link]]\n%(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n- to: %i\n\n\n\n"</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:immediate-finish</span> t
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pu"</span>
2021-01-08 01:34:53 +01:00
<span class="org-string">"Org-Protocol Url"</span>
entry
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Inbox"</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-string">"* [[%:link][%:description]]\nCaptured On: %U\n\n"</span>
<span class="org-builtin">:immediate-finish</span> t
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pt"</span>
2021-01-08 01:34:53 +01:00
<span class="org-string">"Org-Protocol text"</span>
entry
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Inbox"</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-string">"* %:description\nSource: %:link\nCaptured On: %U\n\n#+begin_quote\n%i\n#+end_quote\n\n"</span>
<span class="org-builtin">:immediate-finish</span> t
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-10-25 14:37:10 +02:00
<div id="outline-container-orgf332c4c" class="outline-3">
<h3 id="orgf332c4c"><code>message:</code> link to mutt</h3>
<div class="outline-text-3" id="text-orgf332c4c">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">org-protocol</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">stefanv/mutt-open-message</span> <span class="org-rainbow-delimiters-depth-2">(</span>message-id<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"In neomutt, open the email with the the given Message-ID"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let*</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>message-id <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">"^/*"</span> <span class="org-string">""</span> message-id<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>mail-file
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">replace-regexp-in-string</span>
<span class="org-string">"\n$"</span> <span class="org-string">""</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">shell-command-to-string</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"mu find -f l i:%s | head -n 1"</span> message-id<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-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>mail-dir <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">"/</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">cur</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">new</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">tmp</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">/$"</span> <span class="org-string">""</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">file-name-directory</span> mail-file<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">process-id</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"neomutt-"</span> message-id<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>message-id-escaped <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">regexp-quote</span> message-id<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>mutt-keystrokes
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"L~i %s\n\nLall\n\nl"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">shell-quote-argument</span> message-id-escaped<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>mutt-command <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">list</span> <span class="org-string">"neomutt"</span> <span class="org-string">"-R"</span> <span class="org-string">"-f"</span> mail-dir
<span class="org-string">"-e"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> <span class="org-string">"push '%s'"</span> mutt-keystrokes<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">message</span> <span class="org-string">"Launching neomutt for message %s"</span> message-id<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">call-process</span> <span class="org-string">"setsid"</span> nil nil
<span class="org-string">"-f"</span> <span class="org-string">"alacritty"</span> <span class="org-string">"-e"</span>
<span class="org-string">"neomutt"</span> <span class="org-string">"-R"</span> <span class="org-string">"-f"</span> mail-dir
<span class="org-string">"-e"</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">format</span> <span class="org-string">"push '%s'"</span> mutt-keystrokes<span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-comment-delimiter">; </span><span class="org-comment">Whenever org-mode sees a link starting with `message://`, it</span>
<span class="org-comment-delimiter">; </span><span class="org-comment">calls our `mutt-open-message` function</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-add-link-type</span> <span class="org-string">"message"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">stefanv/mutt-open-message</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org774450b" class="outline-3">
<h3 id="org774450b">Org Export</h3>
<div class="outline-text-3" id="text-org774450b">
2020-05-26 08:40:15 +02:00
<p>
Basic configuration:
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-comment-delimiter">;; </span><span class="org-comment">How many levels of headline to export</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-export-headline-levels</span> <span class="org-highlight-numbers-number">4</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Authorize BIND to set local variables</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-export-allow-bind-keywords</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use doc instead of odt</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-odt-preferred-output-format</span> <span class="org-string">"doc"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-05-26 08:40:15 +02:00
<p>
Some defaults:
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-export-with-author</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-export-with-creator</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-export-with-date</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-export-with-toc</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-export-with-drawers</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-export-with-sub-superscripts</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-export-with-todo-keywords</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<p>
2020-05-26 08:40:15 +02:00
Do not export headline with the <code>:ignore:</code> tag:
2020-01-11 22:04:45 +01:00
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Used to not export headings with :ignore: tag</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">ox-extra</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">ox-extras-activate</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span>ignore-headlines<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-10-25 14:37:10 +02:00
<div id="outline-container-org5df6892" class="outline-3">
<h3 id="org5df6892">Org Effort</h3>
<div class="outline-text-3" id="text-org5df6892">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-global-properties</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"Effort_ALL"</span>. <span class="org-string">"0 0:10 0:30 1:00 2:00 3:00 4:00"</span><span class="org-rainbow-delimiters-depth-4">)</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>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org825b67c" class="outline-3">
<h3 id="org825b67c">HTML Export</h3>
<div class="outline-text-3" id="text-org825b67c">
2020-01-11 22:04:45 +01:00
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org8b575b5" class="outline-4">
<h4 id="org8b575b5">HTML Defaults</h4>
<div class="outline-text-4" id="text-org8b575b5">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-head</span> <span class="org-string">"&lt;meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\"&gt;"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-head-extra</span> <span class="org-string">""</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-01 20:12:34 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-head-include-default-style</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-head-include-scripts</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-viewport</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-html5-fancy</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-doctype</span> <span class="org-string">"xhtml-strict"</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-wrap-src-lines</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Export with css class instead of inline css</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-htmlize-output-type</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">css</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org2d665d8" class="outline-4">
<h4 id="org2d665d8">MathJax</h4>
<div class="outline-text-4" id="text-org2d665d8">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-mathjax-template</span>
<span class="org-string">"&lt;script&gt;</span>
<span class="org-string"> MathJax = {</span>
<span class="org-string"> svg: {</span>
<span class="org-string"> scale: %SCALE,</span>
<span class="org-string"> fontCache: \"global\"</span>
<span class="org-string"> },</span>
<span class="org-string"> tex: {</span>
<span class="org-string"> tags: \"%AUTONUMBER\",</span>
<span class="org-string"> multlineWidth: \"%MULTLINEWIDTH\",</span>
<span class="org-string"> tagSide: \"%TAGSIDE\",</span>
<span class="org-string"> macros: {bm: [\"\\\\boldsymbol{#1}\",1],},</span>
<span class="org-string"> tagIndent: \"%TAGINDENT\"</span>
<span class="org-string"> }</span>
<span class="org-string"> };</span>
<span class="org-string"> &lt;/script&gt;</span>
<span class="org-string"> &lt;script id=\"MathJax-script\" async</span>
<span class="org-string"> src=\"%PATH\"&gt;&lt;/script&gt;"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-mathjax-options</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>path <span class="org-string">"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"</span> <span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>scale <span class="org-string">"1"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>autonumber <span class="org-string">"ams"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>tagindent <span class="org-string">".8em"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>tagside <span class="org-string">"right"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgfe637f6" class="outline-4">
<h4 id="orgfe637f6">MP4 Video - <code>video</code> link</h4>
<div class="outline-text-4" id="text-orgfe637f6">
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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-video-link-export</span> <span class="org-rainbow-delimiters-depth-2">(</span>path desc backend<span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>ext <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">file-name-extension</span> path<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">cond</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">eq</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">html</span> backend<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"&lt;video preload='metadata' controls='controls'&gt;&lt;source type='video/%s' src='%s' /&gt;&lt;/video&gt;"</span> ext path<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">fall-through case for everything else</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span>t
path<span class="org-rainbow-delimiters-depth-4">)</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>
2021-01-01 20:12:34 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-link-set-parameters</span> <span class="org-string">"video"</span> <span class="org-builtin">:export</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-video-link-export</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-01 20:12:34 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-export-string-as</span> <span class="org-string">"video:xxx.mp4"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">html</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
</div>
</div>
<div id="outline-container-orgcd580b1" class="outline-4">
<h4 id="orgcd580b1">Ensuring useful HTML Anchors</h4>
<div class="outline-text-4" id="text-orgcd580b1">
2020-03-01 22:51:16 +01:00
<ul class="org-ul">
<li class="off"><code>[&#xa0;]</code> <a href="https://github.com/alhassy/emacs.d">https://github.com/alhassy/emacs.d</a></li>
<li class="off"><code>[&#xa0;]</code> <a href="https://github.com/alphapapa/unpackaged.el#export-to-html-with-useful-anchors">https://github.com/alphapapa/unpackaged.el#export-to-html-with-useful-anchors</a></li>
</ul>
<p>
This is not working
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">define-minor-mode</span> <span class="org-function-name">unpackaged/org-export-html-with-useful-ids-mode</span>
<span class="org-doc">"Attempt to export Org as HTML with useful link IDs.</span>
<span class="org-doc">Instead of random IDs like \"#orga1b2c3\", use heading titles,</span>
<span class="org-doc">made unique when necessary."</span>
<span class="org-builtin">:global</span> t
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> unpackaged/org-export-html-with-useful-ids-mode
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">advice-add</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">org-export-get-reference</span> <span class="org-builtin">:override</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">unpackaged/org-export-get-reference</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">advice-remove</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">org-export-get-reference</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">unpackaged/org-export-get-reference</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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">unpackaged/org-export-get-reference</span> <span class="org-rainbow-delimiters-depth-2">(</span>datum info<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Like `</span><span class="org-doc"><span class="org-constant">org-export-get-reference</span></span><span class="org-doc">', except uses heading titles instead of random numbers."</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>cache <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">plist-get</span> info <span class="org-builtin">:internal-references</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">or</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">car</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">rassq</span> datum cache<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>crossrefs <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">plist-get</span> info <span class="org-builtin">:crossrefs</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>cells <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-export-search-cells</span> datum<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Preserve any pre-existing association between</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">a search cell and a reference, i.e., when some</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">previously published document referenced a location</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">within current file (see</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">`</span><span class="org-comment"><span class="org-constant">org-publish-resolve-external-link</span></span><span class="org-comment">').</span>
<span class="org-comment-delimiter">;;</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">However, there is no guarantee that search cells are</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">unique, e.g., there might be duplicate custom ID or</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">two headings with the same title in the file.</span>
<span class="org-comment-delimiter">;;</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">As a consequence, before re-using any reference to</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">an element or object, we check that it doesn't refer</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">to a previous element or object.</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>new <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">or</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">cl-some</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">(</span>cell<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>stored <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">assoc</span> cell crossrefs<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> stored
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>old <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-export-format-reference</span> stored<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-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">assoc</span> old cache<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span> stored<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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>
cells<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:raw-value</span> datum<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Heading with a title</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-1">(</span>unpackaged/org-export-new-named-reference datum cache<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">member</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> datum<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>src-block table example fixed-width property-drawer<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Nameable elements</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-1">(</span>unpackaged/org-export-new-named-reference datum cache<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment"><span class="org-bold"><span class="org-success">NOTE:</span></span></span><span class="org-comment"> This probably breaks some Org Export</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">feature, but if it does what I need, fine.</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-export-format-reference</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-export-new-reference</span> cache<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>reference-string new<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Cache contains both data already associated to</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">a reference and in-use internal references, so as to make</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">unique references.</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">dolist</span> <span class="org-rainbow-delimiters-depth-2">(</span>cell cells<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">push</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">cons</span> cell new<span class="org-rainbow-delimiters-depth-3">)</span> cache<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Retain a direct association between reference string and</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">DATUM since (1) not every object or element can be given</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">a search cell (2) it permits quick lookup.</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">push</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cons</span> reference-string datum<span class="org-rainbow-delimiters-depth-2">)</span> cache<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">plist-put</span> info <span class="org-builtin">:internal-references</span> cache<span class="org-rainbow-delimiters-depth-1">)</span>
reference-string<span class="org-rainbow-delimiters-depth-4">)</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>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">unpackaged/org-export-new-named-reference</span> <span class="org-rainbow-delimiters-depth-2">(</span>datum cache<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Return new reference for DATUM that is unique in CACHE."</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">cl-macrolet</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>inc-suffixf <span class="org-rainbow-delimiters-depth-1">(</span>place<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">progn</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">string-match</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">rx</span> bos
<span class="org-rainbow-delimiters-depth-4">(</span>minimal-match <span class="org-rainbow-delimiters-depth-1">(</span>group <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">1+</span> anything<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>optional <span class="org-string">"--"</span> <span class="org-rainbow-delimiters-depth-1">(</span>group <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">1+</span> digit<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
eos<span class="org-rainbow-delimiters-depth-3">)</span>
,place<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment"><span class="org-bold"><span class="org-constant">HACK:</span></span></span><span class="org-comment"> `</span><span class="org-comment"><span class="org-constant">s1</span></span><span class="org-comment">' instead of a gensym.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">-let*</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span>s1 suffix<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">list</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">match-string</span> <span class="org-highlight-numbers-number">1</span> ,place<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">match-string</span> <span class="org-highlight-numbers-number">2</span> ,place<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>suffix <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">if</span> suffix
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">string-to-number</span> suffix<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setf</span> ,place <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">format</span> <span class="org-string">"%s--%s"</span> s1 <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">cl-incf</span> suffix<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span>headline-p <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">eq</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">car</span> datum<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">headline</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>title <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> headline-p
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:raw-value</span> datum<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">or</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:name</span> datum<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">concat</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:raw-value</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:parent</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:parent</span> datum<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-4">)</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>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">get ascii-only form of title without needing percent-encoding</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-1">(</span>ref <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-rainbow-delimiters-depth-3">(</span>org-reference-contraction <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">substring-no-properties</span> title<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">unless</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">or</span> headline-p <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:name</span> datum<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">concat</span> <span class="org-string">","</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">pcase</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> datum<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">src-block</span> <span class="org-string">"code"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">example</span> <span class="org-string">"example"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">fixed-width</span> <span class="org-string">"mono"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">property-drawer</span> <span class="org-string">"properties"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>_ <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">symbol-name</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">car</span> datum<span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-string">"--1"</span><span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-rainbow-delimiters-depth-1">(</span>parent <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> headline-p <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:parent</span> datum<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-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">--any</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">equal</span> ref <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">car</span> it<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
cache<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Title not unique: make it so.</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">if</span> parent
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Append ancestor title.</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setf</span> title <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:raw-value</span> parent<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-string">"--"</span> title<span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">get ascii-only form of title without needing percent-encoding</span>
2021-10-25 14:37:10 +02:00
ref <span class="org-rainbow-delimiters-depth-3">(</span>org-reference-contraction <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">substring-no-properties</span> title<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
parent <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> headline-p <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:parent</span> parent<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">No more ancestors: add and increment a number.</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>inc-suffixf ref<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
ref<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-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-load-hook</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">unpackaged/org-export-html-with-useful-ids-mode</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgc58d8a3" class="outline-4">
<h4 id="orgc58d8a3">Folded Drawers</h4>
<div class="outline-text-4" id="text-orgc58d8a3">
2020-01-11 22:04:45 +01:00
<p>
2020-03-01 22:51:16 +01:00
Adapt this from <a href="https://github.com/alhassy/emacs.d">https://github.com/alhassy/emacs.d</a> to do something similar for source blocks.
2020-01-11 22:04:45 +01:00
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">my/org-drawer-format</span> <span class="org-rainbow-delimiters-depth-2">(</span>name contents<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Export to HTML the drawers named with prefix &#8216;</span><span class="org-doc"><span class="org-constant">fold_</span></span><span class="org-doc">&#8217;, ignoring case.</span>
2020-03-01 22:51:16 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-doc">The resulting drawer is a &#8216;</span><span class="org-doc"><span class="org-constant">code-details</span></span><span class="org-doc">&#8217; and so appears folded;</span>
<span class="org-doc">the user clicks it to see the information therein.</span>
<span class="org-doc">Henceforth, these are called &#8216;fold drawers&#8217;.</span>
2020-03-01 22:51:16 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-doc">Drawers without such a prefix may be nonetheless exported if their</span>
<span class="org-doc">body contains &#8216;:export: t&#8217; ---this switch does not appear in the output.</span>
<span class="org-doc">Thus, we are biased to generally not exporting non-fold drawers.</span>
2020-03-01 22:51:16 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-doc">One may suspend export of fold drawers by having &#8216;:export: nil&#8217;</span>
<span class="org-doc">in their body definition.</span>
2020-03-01 22:51:16 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-doc">Fold drawers naturally come with a title.</span>
<span class="org-doc">Either it is specfied in the drawer body by &#8216;:title: &#8943;&#8217;,</span>
<span class="org-doc">or otherwise the drawer's name is used with all underscores replaced</span>
<span class="org-doc">by spaces.</span>
<span class="org-doc">"</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>contents&#8242; <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">":export:.*\n?"</span> <span class="org-string">""</span> contents<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>fold? <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">s-prefix?</span> <span class="org-string">"fold_"</span> name <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">ignore-case</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>export? <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">string-match</span> <span class="org-string">":export:\s+t"</span> contents<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>not-export? <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">string-match</span> <span class="org-string">":export:\s+nil"</span> contents<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>title&#8242; <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">string-match</span> <span class="org-string">":title:</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">.*</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">\n"</span> contents<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">match-string</span> <span class="org-highlight-numbers-number">1</span> contents<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2020-03-01 22:51:16 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Ensure we have a title.</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">unless</span> title&#8242; <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">setq</span> title&#8242; <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">s-join</span> <span class="org-string">" "</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">s-split</span> <span class="org-string">"_"</span> name<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-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2020-03-01 22:51:16 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Output</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">cond</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> export? <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">not</span> fold?<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> contents&#8242;<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>not-export? nil<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>fold?
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">thread-last</span> contents&#8242;
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">":title:.*\n"</span> <span class="org-string">""</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> <span class="org-string">"&lt;details class=\"code-details\"&gt; &lt;summary&gt; &lt;strong&gt;</span>
2021-01-08 01:34:53 +01:00
<span class="org-string"> &lt;font face=\"Courier\" size=\"3\" color=\"green\"&gt; %s</span>
2021-10-25 14:37:10 +02:00
<span class="org-string"> &lt;/font&gt; &lt;/strong&gt; &lt;/summary&gt; %s &lt;/details&gt;"</span> title&#8242;<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-03-01 22:51:16 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-format-drawer-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">my/org-drawer-format</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-03-01 22:51:16 +01:00
</div>
2020-01-11 22:04:45 +01:00
2021-04-25 19:10:57 +02:00
<div id="outline-container-org0a897f6" class="outline-3">
<h3 id="org0a897f6">Org Xournalpp</h3>
<div class="outline-text-3" id="text-org0a897f6">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> org-xournalpp
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-xournalpp-mode</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-xournalpp-template-getter</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-doc">"/home/thomas/Downloads/template_test.xopp"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2021-10-25 14:37:10 +02:00
<div id="outline-container-org6e57ed7" class="outline-3">
<h3 id="org6e57ed7">Org Transclusion</h3>
<div class="outline-text-3" id="text-org6e57ed7">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> org-transclusion
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgb6d14e7" class="outline-3">
<h3 id="orgb6d14e7">Org LaTeX</h3>
<div class="outline-text-3" id="text-orgb6d14e7">
2020-03-01 22:51:16 +01:00
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orge8dbace" class="outline-4">
<h4 id="orge8dbace">LaTeX Fragments</h4>
<div class="outline-text-4" id="text-orge8dbace">
2020-03-22 23:04:07 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-comment-delimiter">;; </span><span class="org-comment">Highligh latex parts in org mode</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-highlight-latex-and-related</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span>latex script entities<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use F9 to globally generate all the latex fragments</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span>
<span class="org-builtin">:n</span> <span class="org-string">"&lt;f9&gt;"</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-4">()</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-preview-latex-fragment</span> <span class="org-highlight-numbers-number">16</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Put all the preview images in some directory</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-preview-latex-image-directory</span> <span class="org-string">"~/.ltximg/"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Define backends to preview LaTeX fragments</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-preview-latex-process-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>imagemagick
<span class="org-builtin">:programs</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pdflatex"</span> <span class="org-string">"convert"</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:description</span> <span class="org-string">"pdf &gt; png"</span>
<span class="org-builtin">:message</span> <span class="org-string">"you need to install the programs: pdflatex and imagemagick."</span>
<span class="org-builtin">:image-input-type</span> <span class="org-string">"pdf"</span>
<span class="org-builtin">:image-output-type</span> <span class="org-string">"png"</span>
2021-10-25 14:37:10 +02:00
<span class="org-builtin">:image-size-adjust</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-numbers-number">1.0</span> . <span class="org-highlight-numbers-number">1.0</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:latex-compiler</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pdflatex -interaction nonstopmode -output-directory %o %f"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:image-converter</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"convert -density 100 -trim -antialias %f -quality 100 %O"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>dvipng
<span class="org-builtin">:programs</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"latex"</span> <span class="org-string">"dvipng"</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:description</span> <span class="org-string">"dvi &gt; png"</span>
<span class="org-builtin">:message</span> <span class="org-string">"you need to install the programs: latex and dvipng."</span>
<span class="org-builtin">:image-input-type</span> <span class="org-string">"dvi"</span>
<span class="org-builtin">:image-output-type</span> <span class="org-string">"png"</span>
2021-10-25 14:37:10 +02:00
<span class="org-builtin">:image-size-adjust</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-numbers-number">0.4</span> . <span class="org-highlight-numbers-number">0.4</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:latex-compiler</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"latex -interaction nonstopmode -output-directory %o %f"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:image-converter</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"dvipng -D %D -T tight -o %O %f"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>pdf2svg
<span class="org-builtin">:programs</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pdflatex"</span> <span class="org-string">"pdftocairo"</span> <span class="org-string">"pdfcrop"</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-05-02 11:27:39 +02:00
<span class="org-builtin">:description</span> <span class="org-string">"pdf &gt; png"</span>
<span class="org-builtin">:message</span> <span class="org-string">"you need to install the programs: pdflatex, pdftocairo and pdfcrop."</span>
<span class="org-builtin">:image-input-type</span> <span class="org-string">"pdf"</span>
<span class="org-builtin">:image-output-type</span> <span class="org-string">"svg"</span>
2021-10-25 14:37:10 +02:00
<span class="org-builtin">:image-size-adjust</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-numbers-number">1.0</span> . <span class="org-highlight-numbers-number">1.0</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:latex-compiler</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pdflatex -interaction nonstopmode -output-directory %o %f"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:image-converter</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pdfcrop %f %f &amp;&amp; pdf2svg %f %O"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>pdf2dvi
<span class="org-builtin">:programs</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pdflatex"</span> <span class="org-string">"dvipng"</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-05-02 11:27:39 +02:00
<span class="org-builtin">:description</span> <span class="org-string">"pdf &gt; png"</span>
<span class="org-builtin">:message</span> <span class="org-string">"you need to install the programs: pdflatex, pdftocairo and pdfcrop."</span>
<span class="org-builtin">:image-input-type</span> <span class="org-string">"dvi"</span>
<span class="org-builtin">:image-output-type</span> <span class="org-string">"png"</span>
2021-10-25 14:37:10 +02:00
<span class="org-builtin">:image-size-adjust</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-numbers-number">0.4</span> . <span class="org-highlight-numbers-number">0.4</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:latex-compiler</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pdflatex -output-format dvi -interaction nonstopmode -output-directory %o %f"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:image-converter</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"dvipng -D %D -T tight -o %O %f"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>dvisvgm
<span class="org-builtin">:programs</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"xetex"</span> <span class="org-string">"dvisvgm"</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-02-10 18:02:02 +01:00
<span class="org-builtin">:description</span> <span class="org-string">"xdv &gt; svg"</span>
<span class="org-builtin">:message</span> <span class="org-string">"you need to install the programs: xetex and dvisvgm."</span>
<span class="org-builtin">:image-input-type</span> <span class="org-string">"xdv"</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:image-output-type</span> <span class="org-string">"svg"</span>
2021-10-25 14:37:10 +02:00
<span class="org-builtin">:image-size-adjust</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-numbers-number">0.6</span> . <span class="org-highlight-numbers-number">0.6</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:latex-compiler</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"xelatex -no-pdf -output-directory %o %f"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:image-converter</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"dvisvgm %f -n -b min -c %S -o %O"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use imagemagick/dvisvgm to generate png from pdf</span>
2021-05-02 11:27:39 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-preview-latex-default-process</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">pdf2svg</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Don't change the font size for subscripts and superscripts in latex fragments.</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">This cause the orgmode tables not to be well aligned.</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">font-latex-fontify-script</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Colors of latex fragments</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-format-latex-options</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">plist-put</span> <span class="org-variable-name">org-format-latex-options</span> <span class="org-builtin">:foreground</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">default</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-format-latex-options</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">plist-put</span> <span class="org-variable-name">org-format-latex-options</span> <span class="org-builtin">:background</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">default</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>
2020-03-22 23:04:07 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org7b43d97" class="outline-4">
<h4 id="org7b43d97">LaTeX Classes</h4>
<div class="outline-text-4" id="text-org7b43d97">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-comment-delimiter">;; </span><span class="org-comment">Custom classes to use when exporting to latex</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-classes</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"beamer"</span>
2021-10-25 14:37:10 +02:00
,<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">concat</span> <span class="org-string">"\\documentclass[presentation]{beamer}\n"</span>
2021-01-08 01:34:53 +01:00
<span class="org-string">"[DEFAULT-PACKAGES]"</span>
<span class="org-string">"[PACKAGES]"</span>
2021-10-25 14:37:10 +02:00
<span class="org-string">"[EXTRA]\n"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-classes</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"clean-cheatsheet"</span>
<span class="org-string">"\\documentclass{clean-cheatsheet}"</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-classes</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"clean-beamer"</span>
<span class="org-string">"\\documentclass{clean-beamer}"</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-classes</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"cleanreport"</span>
<span class="org-string">"\\documentclass{cleanreport}"</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-classes</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"scrartcl"</span>
<span class="org-string">"\\documentclass{scrartcl}"</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-classes</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"scrreprt"</span>
<span class="org-string">"\\documentclass[a4paper, 10pt, DIV=12, parskip=full]{scrreprt}"</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\chapter{%s}"</span> . <span class="org-string">"\\chapter*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-classes</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"biblioreport"</span>
<span class="org-string">"\\documentclass{biblioreport}"</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-classes</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"moderncv"</span>
<span class="org-string">"\\documentclass{moderncv}"</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org37fbc06" class="outline-4">
<h4 id="org37fbc06">Ox Latex Subfigure package</h4>
<div class="outline-text-4" id="text-org37fbc06">
2020-05-26 08:40:15 +02:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">(use-package! ox-latex-subfigure</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">:after org</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">:config (require 'ox-latex-subfigure))</span>
2020-11-03 16:27:09 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> ox-latex-subfigure
<span class="org-builtin">:load-path</span> <span class="org-string">"~/.config/doom/packages/ox-latex-subfigure/"</span>
<span class="org-builtin">:config</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">ox-latex-subfigure</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org2262fec" class="outline-4">
<h4 id="org2262fec">Clear page before heading</h4>
<div class="outline-text-4" id="text-org2262fec">
2020-05-26 08:40:15 +02:00
<p>
<a href="https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-heading/30892">https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-heading/30892</a>
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-get-headline-string-element</span> <span class="org-rainbow-delimiters-depth-3">(</span>headline backend info<span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span>prop-point <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">next-property-change</span> <span class="org-highlight-numbers-number">0</span> headline<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">if</span> prop-point <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">plist-get</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">text-properties-at</span> prop-point headline<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-builtin">:parent</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-ensure-latex-clearpage</span> <span class="org-rainbow-delimiters-depth-3">(</span>headline backend info<span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-export-derived-backend-p</span> backend <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">latex</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>elmnt <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">tdh-get-headline-string-element</span> headline backend info<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-keyword">when</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">and</span> elmnt <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:CLEARPAGE</span> elmnt<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-string">"\\clearpage\n"</span> headline<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-export-filter-headline-functions</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-ensure-latex-clearpage</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org94f5800" class="outline-4">
<h4 id="org94f5800">Default added packages</h4>
<div class="outline-text-4" id="text-org94f5800">
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-default-packages-alist</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"AUTO"</span> <span class="org-string">"inputenc"</span> t <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pdflatex"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">for basic font and character selection</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"T1"</span> <span class="org-string">"fontenc"</span> t <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pdflatex"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">for basic font and character selection</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">""</span> <span class="org-string">"graphicx"</span> t<span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">for including images</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">""</span> <span class="org-string">"grffile"</span> t<span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">allow periods and spaces in graphics file names</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">""</span> <span class="org-string">"longtable"</span> nil<span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">For multipage tables</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">""</span> <span class="org-string">"wrapfig"</span> nil<span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">for figure placement</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">""</span> <span class="org-string">"rotating"</span> nil<span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">for sideways figures and tables</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"normalem"</span> <span class="org-string">"ulem"</span> t<span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">for underline and strike-through</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">""</span> <span class="org-string">"amsmath"</span> t<span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">for subscript and superscript and math environments</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">""</span> <span class="org-string">"textcomp"</span> t<span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">for various symbols</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">""</span> <span class="org-string">"amssymb"</span> t<span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">for various symbols</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">""</span> <span class="org-string">"capt-of"</span> nil<span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">for captions outside of floats</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">""</span> <span class="org-string">"hyperref"</span> nil<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">for cross references</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">""</span> <span class="org-string">"siunitx"</span> t<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">""</span> <span class="org-string">"array"</span> t<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">""</span> <span class="org-string">"tabularx"</span> t<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">""</span> <span class="org-string">"booktabs"</span> t<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">""</span> <span class="org-string">"bm"</span> t<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"most"</span> <span class="org-string">"tcolorbox"</span> t<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-01 22:51:16 +01:00
</pre>
</div>
</div>
</div>
2020-01-11 22:04:45 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-org360b4cc" class="outline-4">
<h4 id="org360b4cc">Some configurations</h4>
<div class="outline-text-4" id="text-org360b4cc">
2020-03-01 22:51:16 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-comment-delimiter">;; </span><span class="org-comment">Setup default option for image size when exporting to LaTeX</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-image-default-scale</span> <span class="org-string">""</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-image-default-width</span> <span class="org-string">""</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-image-default-height</span> <span class="org-string">""</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-image-default-option</span> <span class="org-string">"scale=1"</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use define labels instead of automatic generated ones</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-prefer-user-labels</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Captions above the table</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-caption-above</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span>table<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Settings to export code with `</span><span class="org-comment"><span class="org-constant">minted</span></span><span class="org-comment">' instead of `</span><span class="org-comment"><span class="org-constant">verbatim</span></span><span class="org-comment">'.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-listings</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">minted</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Set the following as images</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-inline-image-rules</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"file"</span> . <span class="org-string">"\\.</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">pdf</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">jpeg</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">jpg</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">png</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">ps</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">eps</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">tikz</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">pgf</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">svg</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">gif</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">\\'"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Command used when exporting to pdf</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-pdf-process</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"latexmk -cd -pdflatex=\"pdflatex -synctex=1 -shell-escape -interaction nonstopmode -output-directory %o\" -pdf -bibtex -f %f"</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org593e089" class="outline-4">
<h4 id="org593e089">Beamer</h4>
<div class="outline-text-4" id="text-org593e089">
2020-01-11 22:04:45 +01:00
<p>
Bold Text
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-my-beamer-bold</span> <span class="org-rainbow-delimiters-depth-3">(</span>contents backend info<span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">eq</span> backend <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">beamer</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">replace-regexp-in-string</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"\\`\\\\"</span> <span class="org-string">"[A-Za-z0-9]+"</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">If not, orgmode is crazy...</span>
2021-01-08 01:34:53 +01:00
<span class="org-string">"\\\\textbf"</span>
2021-10-25 14:37:10 +02:00
contents<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-export-filter-bold-functions</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-my-beamer-bold</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<p>
Special Environments
</p>
<ul class="org-ul">
<li class="off"><code>[&#xa0;]</code> Make some comment those special environments</li>
</ul>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-beamer-environments-extra</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"cbox"</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">Name of environment</span>
<span class="org-string">"m"</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">Selection key</span>
<span class="org-string">"\\onslide%a{\\begin{cbox}[%h]%O"</span>
<span class="org-string">"\\end{cbox}}\\vspace{0.5em}"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-beamer-environments-extra</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"csubbox"</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">Name of environment</span>
<span class="org-string">"M"</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">Selection key</span>
<span class="org-string">"\\onslide%a{\\tcbsubtitle{%h}"</span>
<span class="org-string">"}"</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org6991c47" class="outline-4">
<h4 id="org6991c47">Custom Export - Add Page and Label for LaTeX export</h4>
<div class="outline-text-4" id="text-org6991c47">
2020-01-11 22:04:45 +01:00
<p>
<a href="https://emacs.stackexchange.com/questions/156/emacs-function-to-convert-an-arbitrary-org-property-into-an-arbitrary-string-na?rq=1">https://emacs.stackexchange.com/questions/156/emacs-function-to-convert-an-arbitrary-org-property-into-an-arbitrary-string-na?rq=1</a>
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defcustom</span> <span class="org-variable-name">tdh-org-property-mapping</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>latex <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"CUSTOM_PAGE"</span> . tdh-insert-org-page-latex<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"CUSTOM_LABEL"</span> . tdh-insert-org-label-latex<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-doc">"List of mappings from org property to arbitrary strings.</span>
<span class="org-doc">Each element is a list:</span>
<span class="org-doc"> (BACKEND (PROPERTY1 . FUNCTION1) (PROPERTY2 . FUNCTION2) ...)</span>
<span class="org-doc">FUNCTION are functions which get called with a single</span>
<span class="org-doc">argument (the value of PROPERTY) and are responsible for doing</span>
<span class="org-doc">whatever should be done."</span>
2021-10-25 14:37:10 +02:00
<span class="org-builtin">:type</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>repeat <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">cons</span> symbol <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">repeat</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cons</span> string string<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-replace-org-property</span> <span class="org-rainbow-delimiters-depth-2">(</span>backend<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Convert org properties using `</span><span class="org-doc"><span class="org-constant">tdh-org-property-mapping</span></span><span class="org-doc">'.</span>
<span class="org-doc">Lookup BACKEND in `</span><span class="org-doc"><span class="org-constant">tdh-org-property-mapping</span></span><span class="org-doc">' for a list of</span>
<span class="org-doc">(PROPERTY REPLACEMENT). For each healine being exported, if it has a</span>
<span class="org-doc">PROPERTY listed insert a string immediately after the healine given by</span>
<span class="org-doc"> (format REPLACEMENT PROPERTY-VALUE)"</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">map</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">assoc</span> backend tdh-org-property-mapping<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
value replacement<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> map
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-map-entries</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">dolist</span> <span class="org-rainbow-delimiters-depth-3">(</span>it map<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> value <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-entry-get</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">car</span> it<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">funcall</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> it<span class="org-rainbow-delimiters-depth-2">)</span> value<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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><span class="org-rainbow-delimiters-depth-4">)</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>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-export-before-processing-hook</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">tdh-replace-org-property</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-insert-org-label-latex</span> <span class="org-rainbow-delimiters-depth-2">(</span>label<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Insert \"\\\\label{LABEL}\\n\" after the :PROPERTY: drawer."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">search-forward-regexp</span> <span class="org-variable-name">org-property-end-re</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">forward-char</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"\\label{%s}\n"</span> label<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-keyword">defun</span> <span class="org-function-name">tdh-insert-org-page-latex</span> <span class="org-rainbow-delimiters-depth-2">(</span>page<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Insert \"\\\\page{PAGE}\\n\" after the :PROPERTY: drawer."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">search-forward-regexp</span> <span class="org-variable-name">org-property-end-re</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">forward-char</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"\\page{%s}\n"</span> page<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org9efe418" class="outline-4">
<h4 id="org9efe418">Number Equations</h4>
<div class="outline-text-4" id="text-org9efe418">
2020-05-26 08:40:15 +02:00
<p>
<a href="https://kitchingroup.cheme.cmu.edu/blog/2016/11/07/Better-equation-numbering-in-LaTeX-fragments-in-org-mode/">https://kitchingroup.cheme.cmu.edu/blog/2016/11/07/Better-equation-numbering-in-LaTeX-fragments-in-org-mode/</a>
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-org-renumber-environment</span> <span class="org-rainbow-delimiters-depth-3">(</span>orig-func <span class="org-type">&amp;rest</span> args<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-doc">"A function to inject numbers in LaTeX fragment previews."</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span>results <span class="org-highlight-quoted-quote">'</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>counter <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">numberp</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">setq</span> results <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">loop</span> for <span class="org-rainbow-delimiters-depth-2">(</span>begin . env<span class="org-rainbow-delimiters-depth-2">)</span> in
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-map</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-parse-buffer</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">latex-environment</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-4">(</span>env<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">cons</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:begin</span> env<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:value</span> env<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
collect
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">cond</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">string-match</span> <span class="org-string">"\\\\begin{equation}"</span> env<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">string-match</span> <span class="org-string">"\\\\tag{"</span> env<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">incf</span> counter<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">cons</span> begin counter<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">string-match</span> <span class="org-string">"\\\\begin{align}"</span> env<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">prog2</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">incf</span> counter<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cons</span> begin counter<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">with-temp-buffer</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">insert</span> env<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">point-min</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">\\ is used for a new line. Each one leads to a number</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">incf</span> counter <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">count-matches</span> <span class="org-string">"\\\\$"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">unless there are nonumbers.</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">point-min</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">decf</span> counter <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">count-matches</span> <span class="org-string">"\\nonumber"</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><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>t
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">cons</span> begin nil<span class="org-rainbow-delimiters-depth-4">)</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><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> numberp <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">assoc</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-4">)</span> results<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-keyword">setf</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> args<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"\\setcounter{equation}{%s}\n"</span> numberp<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">car</span> args<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-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">apply</span> orig-func args<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">advice-add</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-create-formula-image</span> <span class="org-builtin">:around</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">tdh-org-renumber-environment</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
</div>
2021-04-25 19:10:57 +02:00
<div id="outline-container-org10dc0d9" class="outline-3">
<h3 id="org10dc0d9">Org Media Note</h3>
<div class="outline-text-3" id="text-org10dc0d9">
2021-02-10 18:02:02 +01:00
<div class="org-src-container">
2021-04-25 19:10:57 +02:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> org-media-note
<span class="org-builtin">:hook</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-mode</span> . org-media-note-setup-org-ref<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:bind</span> <span class="org-rainbow-delimiters-depth-2">(</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"H-v"</span> . org-media-note-hydra/body<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">Main entrance</span>
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> org-media-note-screenshot-image-dir <span class="org-string">"~/Pictures/"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">Folder to save screencast</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> org-media-note-use-refcite-first t<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">use videocite link instead of video link if possible</span>
2021-02-10 18:02:02 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org40182cc" class="outline-3">
<h3 id="org40182cc">LaTeX macro both for LaTeX and HTML export</h3>
<div class="outline-text-3" id="text-org40182cc">
2020-03-19 10:42:30 +01:00
<p>
<a href="https://www.reddit.com/r/orgmode/comments/7u2n0h/tip_for_defining_latex_macros_for_use_in_both/">https://www.reddit.com/r/orgmode/comments/7u2n0h/tip_for_defining_latex_macros_for_use_in_both/</a>
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-src-lang-modes</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"latex-macros"</span> . latex<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-03-19 10:42:30 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defvar</span> <span class="org-variable-name">org-babel-default-header-args:latex-macros</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-builtin">:results</span> . <span class="org-string">"raw"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-builtin">:exports</span> . <span class="org-string">"results"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-03-19 10:42:30 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">prefix-all-lines</span> <span class="org-rainbow-delimiters-depth-3">(</span>pre body<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">with-temp-buffer</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">insert</span> body<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">string-insert-rectangle</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point-min</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point-max</span><span class="org-rainbow-delimiters-depth-1">)</span> pre<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">buffer-string</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">org-babel-execute:latex-macros</span> <span class="org-rainbow-delimiters-depth-3">(</span>body _params<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span>
<span class="org-string">"\n#+begin_export html\n&lt;div style=\"display: none\"&gt; </span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">\n"</span>
body
<span class="org-string">"\n</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">&lt;/div&gt;\n#+end_export\n"</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-05-26 08:40:15 +02:00
</div>
</div>
2020-01-11 22:04:45 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-org68f0642" class="outline-3">
<h3 id="org68f0642">Org Projects</h3>
<div class="outline-text-3" id="text-org68f0642">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-publish-project-alist</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"config"</span>
<span class="org-builtin">:base-directory</span> <span class="org-string">"~/.config/literate-dotfiles/"</span>
<span class="org-builtin">:publishing-directory</span> <span class="org-string">"~/.config/literate-dotfiles/docs/"</span>
<span class="org-builtin">:recursive</span> nil
<span class="org-builtin">:publishing-function</span> org-html-publish-to-html
<span class="org-builtin">:auto-sitemap</span> nil
<span class="org-builtin">:section-numbers</span> nil
<span class="org-builtin">:table-of-contents</span> nil<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"stewart-simscape"</span>
<span class="org-builtin">:base-directory</span> <span class="org-string">"~/Cloud/thesis/matlab/stewart-simscape/org/"</span>
<span class="org-builtin">:base-extension</span> <span class="org-string">"org"</span>
<span class="org-builtin">:publishing-directory</span> <span class="org-string">"~/Cloud/thesis/matlab/stewart-simscape/docs/"</span>
<span class="org-builtin">:author</span> <span class="org-string">"Dehaeze Thomas"</span>
<span class="org-builtin">:email</span> <span class="org-string">"dehaeze.thomas@gmail.com/"</span>
<span class="org-builtin">:recursive</span> nil
<span class="org-builtin">:publishing-function</span> org-html-publish-to-html
<span class="org-builtin">:auto-preamble</span> t
<span class="org-builtin">:auto-sitemap</span> nil
<span class="org-builtin">:html-link-up</span> <span class="org-string">"index.html"</span>
<span class="org-builtin">:html-link-home</span> <span class="org-string">"index.html"</span>
<span class="org-builtin">:with-todo-keywords</span> nil
<span class="org-builtin">:html-wrap-src-lines</span> nil
<span class="org-builtin">:table-of-contents</span> nil<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"nass-simscape"</span>
<span class="org-builtin">:base-directory</span> <span class="org-string">"~/Cloud/thesis/matlab/nass-simscape/org/"</span>
<span class="org-builtin">:base-extension</span> <span class="org-string">"org"</span>
<span class="org-builtin">:publishing-directory</span> <span class="org-string">"~/Cloud/thesis/matlab/nass-simscape/docs/"</span>
<span class="org-builtin">:author</span> <span class="org-string">"Dehaeze Thomas"</span>
<span class="org-builtin">:email</span> <span class="org-string">"dehaeze.thomas@gmail.com/"</span>
<span class="org-builtin">:recursive</span> nil
2021-10-25 14:37:10 +02:00
<span class="org-builtin">:publishing-function</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">list</span> org-html-publish-to-html org-latex-publish-to-pdf<span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:auto-preamble</span> t
<span class="org-builtin">:auto-sitemap</span> nil
<span class="org-builtin">:html-link-up</span> <span class="org-string">"index.html"</span>
<span class="org-builtin">:html-link-home</span> <span class="org-string">"index.html"</span>
<span class="org-builtin">:with-todo-keywords</span> nil
<span class="org-builtin">:html-wrap-src-lines</span> nil
<span class="org-builtin">:table-of-contents</span> nil<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"tikz-maker"</span>
<span class="org-builtin">:base-directory</span> <span class="org-string">"~/Cloud/tikz/org/"</span>
<span class="org-builtin">:base-extension</span> <span class="org-string">"org"</span>
<span class="org-builtin">:publishing-directory</span> <span class="org-string">"~/Cloud/tikz/docs/"</span>
<span class="org-builtin">:author</span> <span class="org-string">"Dehaeze Thomas"</span>
<span class="org-builtin">:email</span> <span class="org-string">"dehaeze.thomas@gmail.com/"</span>
<span class="org-builtin">:recursive</span> nil
<span class="org-builtin">:publishing-function</span> org-html-publish-to-html
<span class="org-builtin">:auto-preamble</span> t
<span class="org-builtin">:auto-sitemap</span> nil
<span class="org-builtin">:html-link-up</span> <span class="org-string">"index.html"</span>
<span class="org-builtin">:html-link-home</span> <span class="org-string">"index.html"</span>
<span class="org-builtin">:with-todo-keywords</span> nil
<span class="org-builtin">:html-wrap-src-lines</span> nil
<span class="org-builtin">:table-of-contents</span> nil<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org3282b66" class="outline-3">
<h3 id="org3282b66">Automatically run <code>startblock</code> when opening org-mode files</h3>
<div class="outline-text-3" id="text-org3282b66">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-eval-startblock</span> <span class="org-rainbow-delimiters-depth-3">()</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">member</span> <span class="org-string">"startblock"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-src-block-names</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-goto-named-src-block</span> <span class="org-string">"startblock"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-execute-src-block</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
nil
<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-eval-startblock</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2021-01-03 22:52:53 +01:00
2021-01-08 01:34:53 +01:00
<div id="outline-container-org02fccbb" class="outline-3">
<h3 id="org02fccbb">Some function</h3>
<div class="outline-text-3" id="text-org02fccbb">
<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-syntax-convert-case-to-lower</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Convert all #+keywords to #+keywords."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">save-excursion</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">point-min</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">count</span> <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">case-fold-search</span> nil<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">re-search-forward</span> <span class="org-string">"#\\+[A-Z_]+"</span> nil t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">replace-match</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">downcase</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">match-string</span> <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> count <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">1+</span> count<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">message</span> <span class="org-string">"Replaced %d occurances"</span> count<span class="org-rainbow-delimiters-depth-4">)</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgeeaa452" class="outline-3">
<h3 id="orgeeaa452">Insert ScreenShot or Picture from Phone</h3>
<div class="outline-text-3" id="text-orgeeaa452">
2020-01-11 22:04:45 +01:00
<p>
2020-05-26 08:40:15 +02:00
<a href="http://pragmaticemacs.com/emacs/a-workflow-to-quickly-add-photos-to-org-mode-notes/">http://pragmaticemacs.com/emacs/a-workflow-to-quickly-add-photos-to-org-mode-notes/</a>
2020-01-11 22:04:45 +01:00
</p>
2020-03-19 10:42:30 +01:00
<ul class="org-ul">
2020-05-26 08:40:15 +02:00
<li class="off"><code>[&#xa0;]</code> One function to move file from <code>~/Picture/</code> folder (where the screenshots are taken) to current directory and then insert and org link to the picture. Maybe ask if it should be copied in a sub directory (figs folder for instance).</li>
<li class="off"><code>[&#xa0;]</code> One function to copy file from <code>~/Cloud/Photos/</code> folder (where the pictures from phone are taken) to current directory (and ask for the new name of the picture) and insert org link.</li>
2020-03-19 10:42:30 +01:00
</ul>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">required libraries</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">dash</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(require 'swiper)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">s</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-01 22:51:16 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">start directory</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defvar</span> <span class="org-variable-name">tdh-image-dir</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">expand-file-name</span> <span class="org-string">"/home/thomas/Pictures"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-01 22:51:16 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-insert-conference-image</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Insert image from conference directory, rename and add link in current file.</span>
2020-03-01 22:51:16 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-doc">The file is taken from a start directory set by `</span><span class="org-doc"><span class="org-constant">tdh-image-dir</span></span><span class="org-doc">' and moved to the current directory, renamed and embedded at the point as an org-mode link. The user is presented with a list of files in the start directory, from which to select the file to move, sorted by most recent first."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span>file-list target-dir file-list-sorted start-file start-file-full file-ext end-file end-file-base end-file-full file-number<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Clean directories from list but keep times</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> file-list
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">-remove</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">(</span>x<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">1</span> x<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">directory-files-and-attributes</span> tdh-image-dir<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2020-03-01 22:51:16 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Get target directory</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> target-dir <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">file-name-directory</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2020-03-19 10:42:30 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Sort list by most recent</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> file-list-sorted
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">mapcar</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">car</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">sort</span> file-list
<span class="org-highlight-quoted-quote">#'</span><span class="org-rainbow-delimiters-depth-2">(</span>lambda <span class="org-rainbow-delimiters-depth-3">(</span>x y<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">time-less-p</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">6</span> y<span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">6</span> x<span class="org-rainbow-delimiters-depth-4">)</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><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2020-03-19 10:42:30 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use ivy to select start-file</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> start-file <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">ivy-read</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"Move selected file to "</span> target-dir <span class="org-string">":"</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-08 01:34:53 +01:00
file-list-sorted
<span class="org-builtin">:re-builder</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">ivy--regex</span>
<span class="org-builtin">:sort</span> nil
2021-10-25 14:37:10 +02:00
<span class="org-builtin">:initial-input</span> nil<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2020-03-19 10:42:30 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">add full path to start file and end-file</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> start-file-full
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">expand-file-name</span> start-file tdh-image-dir<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2020-03-19 10:42:30 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">final file name including path</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> end-file-full
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">expand-file-name</span> start-file target-dir<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">rename file</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">rename-file</span> start-file-full end-file-full<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">message</span> <span class="org-string">"moved %s to %s"</span> start-file-full start-file<span class="org-rainbow-delimiters-depth-3">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">insert link</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-make-link-string</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"file:%s"</span> start-file<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">display image</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-display-inline-images</span> t t<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org90e8b2b" class="outline-3">
<h3 id="org90e8b2b">Render Tables</h3>
<div class="outline-text-3" id="text-org90e8b2b">
2020-05-26 08:40:15 +02:00
<p>
<a href="https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_chapter_2_it/">https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_chapter_2_it/</a>
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-render-org-table-at-point</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-keyword">save-excursion</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">beginning-of-line</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">removes the overlay is already there</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlays-at</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">point</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">delete-overlay</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">overlays-at</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-4">)</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>
2021-01-08 01:34:53 +01:00
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>element-type <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-element-type</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-at-point</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">eq</span> element-type <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">table</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">eq</span> element-type <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">table-row</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">error</span> <span class="org-string">"not at an org table"</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">eq</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">table</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-type</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-at-point</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><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">forward-line</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">tdh-render-org-table</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-element-at-point</span><span class="org-rainbow-delimiters-depth-4">)</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><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-render-org-table</span> <span class="org-rainbow-delimiters-depth-3">(</span>table<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>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span>begin <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:begin</span> table<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>end <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>pos <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:end</span> table<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">goto-char</span> pos<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">beginning-of-line</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">skip possible space after table</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">looking-at</span> <span class="org-string">" *[|#]"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">setq</span> pos <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">forward-line</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
pos<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>tabletxt <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">buffer-substring-no-properties</span> begin end<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>img <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">with-temp-buffer</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">insert</span> tabletxt<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">mark-whole-buffer</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-latex-convert-region-to-latex</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-latex-preview</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">point-min</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">overlay-get</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">car</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlays-at</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">display</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>
<span class="org-rainbow-delimiters-depth-1">(</span>overlay <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">make-overlay</span> begin end<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">overlay-put</span> overlay <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">display</span> img<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">forward-line</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-render-org-tables-in-buffer</span> <span class="org-rainbow-delimiters-depth-3">()</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">save-excursion</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-element-map</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-parse-buffer</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">table</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-render-org-table</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use F9 to globally generate tables</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">"&lt;f8&gt;"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-4">()</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">tdh-render-org-table-at-point</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgab67420" class="outline-3">
<h3 id="orgab67420">Org Special Block Extras</h3>
<div class="outline-text-3" id="text-orgab67420">
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">org-special-block-extras</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
</div>
</div>
<div id="outline-container-org7adfc1c" class="outline-3">
<h3 id="org7adfc1c">Org Inline Task</h3>
<div class="outline-text-3" id="text-org7adfc1c">
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">org-inlinetask</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
</div>
</div>
2021-10-25 14:37:10 +02:00
<div id="outline-container-orge396359" class="outline-3">
<h3 id="orge396359">Org Links</h3>
<div class="outline-text-3" id="text-orge396359">
2021-01-01 20:12:34 +01:00
</div>
<div id="outline-container-orgd172897" class="outline-4">
<h4 id="orgd172897">Youtube Links</h4>
<div class="outline-text-4" id="text-orgd172897">
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> yt-iframe-format
<span class="org-comment-delimiter">;; </span><span class="org-comment">You may want to change your width and height.</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"&lt;div class=\"yt\"&gt;&lt;iframe width=\"100%%\""</span>
<span class="org-string">" height=\"100%%\""</span>
<span class="org-string">" src=\"https://www.youtube.com/embed/%s\""</span>
<span class="org-string">" frameborder=\"0\""</span>
<span class="org-string">" allowfullscreen&gt;%s&lt;/iframe&gt;&lt;/div&gt;"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-add-link-type</span>
<span class="org-string">"yt"</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-4">(</span>handle<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">browse-url</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"https://www.youtube.com/embed/"</span>
handle<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-4">(</span>path desc backend<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">cl-case</span> backend
<span class="org-rainbow-delimiters-depth-1">(</span>html <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> yt-iframe-format
path <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">or</span> desc <span class="org-string">""</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>
<span class="org-rainbow-delimiters-depth-1">(</span>md <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> <span class="org-string">"{{&lt; youtube %s &gt;}}"</span>
path<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>latex <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> <span class="org-string">"\\href{%s}{%s}"</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"https://www.youtube.com/embed/"</span>
path<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">or</span> desc <span class="org-string">"video"</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><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgc487d67" class="outline-3">
<h3 id="orgc487d67">Citeproc-Org</h3>
<div class="outline-text-3" id="text-orgc487d67">
2020-11-03 16:27:09 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> citeproc-org
<span class="org-builtin">:after</span> ox-hugo
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">citeproc-org-setup</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org5907d9d" class="outline-3">
<h3 id="org5907d9d">Org Wild Notifier</h3>
<div class="outline-text-3" id="text-org5907d9d">
2020-11-03 16:27:09 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> org-wild-notifier
<span class="org-builtin">:after</span> org
<span class="org-builtin">:init</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">alert-default-style</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">libnotify</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-wild-notifier-alert-time</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">10</span> <span class="org-highlight-numbers-number">5</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-wild-notifier-notification-title</span> <span class="org-string">"Org Agenda"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-wild-notifier-mode</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-11-03 16:27:09 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org59c6888" class="outline-3">
<h3 id="org59c6888">Orch</h3>
<div class="outline-text-3" id="text-org59c6888">
2020-11-03 16:27:09 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> web-server
<span class="org-builtin">:init</span>
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-11-03 16:27:09 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">load-path</span> <span class="org-string">"~/.config/doom/packages/orch/"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">autoload</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">orch-toggle</span> <span class="org-string">"orch"</span> nil t<span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-01 22:51:16 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org4e9295a" class="outline-3">
<h3 id="org4e9295a">Custom Keybindings - <code>,</code> leader key and <code>C-c</code></h3>
<div class="outline-text-3" id="text-org4e9295a">
2020-05-26 08:40:15 +02:00
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
2020-03-22 23:04:07 +01:00
2020-05-26 08:40:15 +02:00
<colgroup>
<col class="org-left" />
2020-03-22 23:04:07 +01:00
2020-05-26 08:40:15 +02:00
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">&#xa0;</th>
<th scope="col" class="org-left">&#xa0;</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left"><code>C-c a</code></td>
<td class="org-left">Org Agenda</td>
</tr>
2020-03-22 23:04:07 +01:00
2020-05-26 08:40:15 +02:00
<tr>
<td class="org-left"><code>C-c n</code></td>
<td class="org-left">Narrow to Subtree</td>
</tr>
2020-03-22 23:04:07 +01:00
2020-05-26 08:40:15 +02:00
<tr>
<td class="org-left"><code>C-c l</code></td>
<td class="org-left">Org Link</td>
</tr>
</tbody>
</table>
2020-03-22 23:04:07 +01:00
2020-05-26 08:40:15 +02:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Org Agenda"</span>
<span class="org-builtin">:ni</span> <span class="org-string">"C-c a"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-agenda</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Archive"</span>
<span class="org-builtin">:n</span> <span class="org-string">"C-c A"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-archive-subtree</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Org Capture"</span>
<span class="org-builtin">:ni</span> <span class="org-string">"C-c c"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-capture</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Store Link"</span>
<span class="org-builtin">:ni</span> <span class="org-string">"C-c l"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-store-link</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Narrow Subtree"</span>
<span class="org-builtin">:ni</span> <span class="org-string">"C-c n"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-toggle-narrow-to-subtree</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Org Noter"</span>
<span class="org-builtin">:ni</span> <span class="org-string">"C-c N"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-noter</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Align Block"</span>
<span class="org-builtin">:ni</span> <span class="org-string">"C-c ="</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-align-src-block</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Insert Reference"</span>
<span class="org-builtin">:ni</span> <span class="org-string">"C-c r"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-ref-insert-ref-link</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Insert Image"</span>
<span class="org-builtin">:ni</span> <span class="org-string">"C-c i"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-insert-image-org-link</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Insert Image SXIV"</span>
<span class="org-builtin">:ni</span> <span class="org-string">"C-c I"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-insert-image-org-link-sxiv</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Link to next Figure"</span>
<span class="org-builtin">:ni</span> <span class="org-string">"C-c f"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-insert-link-to-next-figure</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Link to previous Figure"</span>
<span class="org-builtin">:ni</span> <span class="org-string">"C-c F"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-insert-link-to-previous-figure</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Insert Screenshot"</span>
<span class="org-builtin">:ni</span> <span class="org-string">"C-c s"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-insert-screenshot-org-link</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Find Roam"</span>
<span class="org-builtin">:ni</span> <span class="org-string">"C-c r"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">orb-find-non-ref-file</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Insert Roam"</span>
<span class="org-builtin">:ni</span> <span class="org-string">"C-c R"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">orb-insert-non-ref</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-03-01 22:51:16 +01:00
</div>
2020-01-11 22:04:45 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-org3174f9c" class="outline-4">
<h4 id="org3174f9c">Insert Elements <code>,i</code></h4>
<div class="outline-text-4" id="text-org3174f9c">
2020-03-22 23:04:07 +01:00
<p>
2020-05-26 08:40:15 +02:00
Insert Link to paper
2020-03-22 23:04:07 +01:00
</p>
2020-03-01 22:51:16 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-insert-paper-org-link</span> <span class="org-rainbow-delimiters-depth-2">(</span>paper<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Insert an org link to some paper, choosing the file with completion"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">list</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">read-file-name</span> <span class="org-string">"Paper: "</span> <span class="org-string">"~/Cloud/pdfs/"</span> nil t<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"[[papers:%s]]"</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">file-name-base</span> paper<span class="org-rainbow-delimiters-depth-4">)</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>
2020-03-01 22:51:16 +01:00
</pre>
</div>
2020-05-26 08:40:15 +02:00
<p>
Insert Link to notes
</p>
2020-03-01 22:51:16 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-insert-note-org-link</span> <span class="org-rainbow-delimiters-depth-2">(</span>note<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Insert an org link to some note, choosing the file with completion"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">list</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">read-file-name</span> <span class="org-string">"Note: "</span> <span class="org-string">"~/Cloud/pdfs/"</span> nil t<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"[[notes:%s]]"</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">file-name-base</span> note<span class="org-rainbow-delimiters-depth-4">)</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>
2020-03-01 22:51:16 +01:00
</pre>
</div>
2020-03-22 23:04:07 +01:00
2020-05-26 08:40:15 +02:00
<p>
Insert Image that is in the figs folder
</p>
2020-03-01 22:51:16 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-insert-image-org-link</span> <span class="org-rainbow-delimiters-depth-2">(</span>img<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Insert an org image link, choosing the file with completion</span>
<span class="org-doc">and starting from `</span><span class="org-doc"><span class="org-constant">my-default-image-directory</span></span><span class="org-doc">'."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">list</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">file-relative-name</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">read-file-name</span> <span class="org-string">"Image: "</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-variable-name">default-directory</span> <span class="org-string">"figs/"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-variable-name">default-directory</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"[[file:%s]]"</span> img<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-01 22:51:16 +01:00
</pre>
</div>
2020-03-22 23:04:07 +01:00
<p>
2020-05-26 08:40:15 +02:00
Insert Image that is in the <code>figs</code> folder using SXIV
2020-03-22 23:04:07 +01:00
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-insert-image-org-link-sxiv</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Insert an org image link, choosing the file with completion</span>
<span class="org-doc">and starting from `</span><span class="org-doc"><span class="org-constant">my-default-image-directory</span></span><span class="org-doc">'."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> img <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">shell-command-to-string</span> <span class="org-string">"ls figs/*.{jpg,jpeg,bmp,png,gif} 2&gt; /dev/null | sxiv -i -t -o | tail -1 | tr -d '\n'"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</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-constant">equal</span> <span class="org-string">""</span> img<span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">format</span> <span class="org-string">"[[file:%s]]"</span> img<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-03-22 23:04:07 +01:00
<p>
2020-05-26 08:40:15 +02:00
Copy picture from phone folder using SXIV and insert it
2020-03-22 23:04:07 +01:00
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-insert-phone-picture</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> img <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">shell-command-to-string</span> <span class="org-string">"~/.config/doom/bin/copy-phone-picture.sh"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</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-constant">equal</span> <span class="org-string">""</span> img<span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">format</span> <span class="org-string">"[[file:%s]]"</span> img<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-03-22 23:04:07 +01:00
<p>
2020-05-26 08:40:15 +02:00
Bash script for copying pictures taken by phone.
2020-03-01 22:51:16 +01:00
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-bash"><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span> -z <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">1</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
<span class="org-variable-name">oldpath</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">ls</span> -t ~/Cloud/photos/phone/*.jpg | sxiv -i -t -o | tail -1<span class="org-rainbow-delimiters-depth-1">)</span>;
<span class="org-keyword">else</span>
<span class="org-variable-name">oldpath</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">ls</span> -t $<span class="org-highlight-numbers-number">1</span> | sxiv -i -t -o | tail -1<span class="org-rainbow-delimiters-depth-1">)</span>;
<span class="org-keyword">fi</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span> -n <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">oldpath</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
<span class="org-variable-name">newfilename</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">basename</span> $<span class="org-variable-name">oldpath</span> .jpg | rofi -i -dmenu -p <span class="org-string">"Filename"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span> -n <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">newfilename</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
<span class="org-type">cp</span> $<span class="org-variable-name">oldpath</span> <span class="org-string">"figs/</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">newfilename</span></span><span class="org-string">.jpg"</span>
<span class="org-builtin">printf</span> <span class="org-string">"figs/</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">newfilename</span></span><span class="org-string">.jpg"</span>
<span class="org-keyword">fi</span>
<span class="org-keyword">fi</span>
2020-01-11 22:04:45 +01:00
</pre>
2020-03-22 23:04:07 +01:00
</div>
2020-03-01 22:51:16 +01:00
<p>
2020-03-22 23:04:07 +01:00
Take Screenshot and insert a link:
2020-03-01 22:51:16 +01:00
</p>
2020-03-22 23:04:07 +01:00
<ul class="org-ul">
<li>Ask for a name <code>screenshot_name</code></li>
<li>use <code>maim -s figs/screenshot_name.png</code> to take a screenshot with selection</li>
<li>Then insert the following to the buffer</li>
</ul>
2020-03-01 22:51:16 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-insert-screenshot-org-link</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Capture screenshot and insert the resulting file.</span>
<span class="org-doc">The screenshot tool is determined by `</span><span class="org-doc"><span class="org-constant">org-download-screenshot-method</span></span><span class="org-doc">'."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">string-match</span> <span class="org-string">"_"</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">file-name-base</span> <span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> filename <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">read-string</span> <span class="org-string">"Enter file name:"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">car</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">split-string</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">file-name-base</span> <span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-string">"_"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> filename <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">read-string</span> <span class="org-string">"Enter file name:"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> filepath <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"./figs/"</span> filename <span class="org-string">".png"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">shell-command</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"maim -u -s "</span> filepath<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"#+name: fig:%s\n#+caption:\n[[file:%s]]"</span> filename filepath<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">search-backward</span> <span class="org-string">"caption"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">end-of-line</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
<p>
Insert link to next figure:
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-insert-link-to-next-figure</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">re-search-forward</span> <span class="org-string">"^#\\+name:\s*</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">fig:.*</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">"</span> nil t <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"[["</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">match-string</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-string">"]]"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
<p>
Insert link to previous figure:
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-insert-link-to-previous-figure</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">re-search-backward</span> <span class="org-string">"^#\\+name:\s*</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">fig:.*</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">"</span> nil t <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"[["</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">match-string</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-string">"]]"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-22 23:04:07 +01:00
</pre>
</div>
2020-03-01 22:51:16 +01:00
2020-03-22 23:04:07 +01:00
<p>
Map Keys
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:prefix</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">",i"</span> . <span class="org-string">"Insert"</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:n</span> <span class="org-string">"p"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-insert-paper-org-link</span>
<span class="org-builtin">:n</span> <span class="org-string">"n"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-insert-note-org-link</span>
<span class="org-builtin">:n</span> <span class="org-string">"f"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-insert-image-org-link</span>
<span class="org-builtin">:n</span> <span class="org-string">"F"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-insert-image-org-link-sxiv</span>
<span class="org-builtin">:n</span> <span class="org-string">"i"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-insert-phone-picture</span>
<span class="org-builtin">:n</span> <span class="org-string">"l"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-insert-link-to-next-figure</span>
<span class="org-builtin">:n</span> <span class="org-string">"L"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-insert-link-to-previous-figure</span>
<span class="org-builtin">:n</span> <span class="org-string">"s"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-insert-screenshot-org-link</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>
2020-03-01 22:51:16 +01:00
</pre>
</div>
2020-01-11 22:04:45 +01:00
</div>
</div>
2020-03-22 23:04:07 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-org69583da" class="outline-4">
<h4 id="org69583da">LaTeX <code>,l</code></h4>
<div class="outline-text-4" id="text-org69583da">
2020-03-22 23:04:07 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-latex-watch</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Watch LaTeX file using latexmk"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">start-process-shell-command</span> <span class="org-string">"latexmk-watch"</span> <span class="org-string">"*latexmk-watch-output*"</span>
2021-10-25 14:37:10 +02:00
<span class="org-string">"latexmk"</span> <span class="org-string">"-pvc"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-22 23:04:07 +01:00
</pre>
2020-01-11 22:04:45 +01:00
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-latex-watch-kill</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Kill the currently running TeX job."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">delete-process</span> <span class="org-string">"latexmk-watch"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-22 23:04:07 +01:00
</pre>
</div>
2020-03-01 22:51:16 +01:00
2020-03-22 23:04:07 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:prefix</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">",l"</span> . <span class="org-string">"LaTeX"</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:n</span> <span class="org-string">"w"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-latex-watch</span>
<span class="org-builtin">:n</span> <span class="org-string">"k"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-latex-watch-kill</span>
<span class="org-builtin">:n</span> <span class="org-string">"l"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-latex-export-to-latex</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org4cd66c9" class="outline-4">
<h4 id="org4cd66c9">Org LaTeX Automatic fragment</h4>
<div class="outline-text-4" id="text-org4cd66c9">
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> org-fragtog
<span class="org-builtin">:after</span> org
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-fragtog-mode</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-automatic-latex-fragment-activate</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-fragtog-mode</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-automatic-latex-fragment-deactivate</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">remove-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-fragtog-mode</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-22 23:04:07 +01:00
</pre>
</div>
2020-01-11 22:04:45 +01:00
2020-03-22 23:04:07 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:prefix</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">",l"</span> . <span class="org-string">"LaTeX"</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:n</span> <span class="org-string">"f"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-automatic-latex-fragment-activate</span>
<span class="org-builtin">:n</span> <span class="org-string">"F"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-automatic-latex-fragment-deactivate</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>
2020-03-22 23:04:07 +01:00
</pre>
</div>
</div>
</div>
2020-01-11 22:04:45 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-org450adc0" class="outline-4">
<h4 id="org450adc0">Bibtex <code>,r</code></h4>
<div class="outline-text-4" id="text-org450adc0">
2020-03-22 23:04:07 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:prefix</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">",r"</span> . <span class="org-string">"References"</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:n</span> <span class="org-string">"b"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">helm-bibtex</span>
<span class="org-builtin">:n</span> <span class="org-string">"B"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">helm-bibtex-with-local-bibliography</span>
<span class="org-builtin">:n</span> <span class="org-string">"f"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-helm-bibtex-favorites</span>
<span class="org-builtin">:n</span> <span class="org-string">"r"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">helm-resume</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>
2020-03-22 23:04:07 +01:00
</pre>
</div>
</div>
</div>
2020-01-11 22:04:45 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-org64d03ee" class="outline-4">
<h4 id="org64d03ee">Open ranger in current directory <code>,o</code></h4>
<div class="outline-text-4" id="text-org64d03ee">
2020-03-22 23:04:07 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-open-ranger-in-workdir</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">call-process-shell-command</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"alacritty -e ranger "</span> <span class="org-variable-name">default-directory</span><span class="org-rainbow-delimiters-depth-3">)</span> nil <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-22 23:04:07 +01:00
</pre>
</div>
2020-01-11 22:04:45 +01:00
2020-03-22 23:04:07 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span>
<span class="org-builtin">:n</span> <span class="org-string">",o"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-open-ranger-in-workdir</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org27f3b70" class="outline-4">
<h4 id="org27f3b70">View in External programs <code>,v</code></h4>
<div class="outline-text-4" id="text-org27f3b70">
2020-01-11 22:04:45 +01:00
<p>
2020-03-22 23:04:07 +01:00
Open PDF output with <code>zathura</code>
2020-01-11 22:04:45 +01:00
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-open-org-pdf-externally</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">call-process</span> <span class="org-string">"zathura"</span> nil <span class="org-highlight-numbers-number">0</span> nil <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">file-name-sans-extension</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-string">".pdf"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-01 22:51:16 +01:00
</pre>
</div>
2020-03-22 23:04:07 +01:00
<p>
Open HTML output externally
</p>
2020-03-01 22:51:16 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-open-org-html-externally</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">call-process</span> <span class="org-string">"xdg-open"</span> nil <span class="org-highlight-numbers-number">0</span> nil <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">file-name-sans-extension</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-string">".html"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:prefix</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">",v"</span> . <span class="org-string">"View"</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:n</span> <span class="org-string">"p"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-open-org-pdf-externally</span>
<span class="org-builtin">:n</span> <span class="org-string">"h"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-open-org-html-externally</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
</div>
2020-03-22 23:04:07 +01:00
</div>
2020-01-11 22:04:45 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgfe0eb1b" class="outline-2">
<h2 id="orgfe0eb1b">Org Babel</h2>
<div class="outline-text-2" id="text-orgfe0eb1b">
2020-01-11 22:04:45 +01:00
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgba33e71" class="outline-3">
<h3 id="orgba33e71">Main configuration</h3>
<div class="outline-text-3" id="text-orgba33e71">
2020-03-01 22:51:16 +01:00
<p>
Don&rsquo;t ask for confirmation when evaluating following blocs
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-org-confirm-babel-evaluate</span> <span class="org-rainbow-delimiters-depth-2">(</span>lang body<span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">member</span> lang <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"emacs-lisp"</span> <span class="org-string">"latex"</span> <span class="org-string">"matlab"</span> <span class="org-string">"sh"</span> <span class="org-string">"latex-macros"</span> <span class="org-string">"python"</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-confirm-babel-evaluate</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-org-confirm-babel-evaluate</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
2020-03-01 22:51:16 +01:00
2020-05-26 08:40:15 +02:00
<p>
Default header arguments.
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-babel-default-header-args</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-builtin">:eval</span> . <span class="org-string">"no-export"</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-03-01 22:51:16 +01:00
<p>
Use the current window for C-c &rsquo; source editing
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-src-window-setup</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">current-window</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orga4792a7" class="outline-3">
<h3 id="orga4792a7">Appearance of source blocks</h3>
<div class="outline-text-3" id="text-orga4792a7">
2020-03-01 22:51:16 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-org-prettify-symbols</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">mapc</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">apply-partially</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">prettify-symbols-alist</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">cl-reduce</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">append</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">mapcar</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">(</span>x<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> x <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">cons</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">upcase</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">car</span> x<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">cdr</span> x<span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"#+begin_src"</span> . ?&#9998;<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"#+end_src"</span> . ?&#9633;<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"#+begin_quote"</span> . ?&#171;<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"#+end_quote"</span> . ?&#187;<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">turn-on-prettify-symbols-mode</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-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-mode-hook</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">tdh-org-prettify-symbols</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-22 23:04:07 +01:00
</pre>
</div>
</div>
</div>
2020-03-01 22:51:16 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgabce861" class="outline-3">
<h3 id="orgabce861">Indentation</h3>
<div class="outline-text-3" id="text-orgabce861">
2020-03-01 22:51:16 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-comment-delimiter">;; </span><span class="org-comment">Don't change indentation when toggling</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-src-preserve-indentation</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-01 22:51:16 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org7d7e65b" class="outline-3">
<h3 id="org7d7e65b">Library of Babel</h3>
<div class="outline-text-3" id="text-org7d7e65b">
2020-01-11 22:04:45 +01:00
<p>
2020-05-26 08:40:15 +02:00
Add all named source blocks to <code>org-babel-library-of-babel</code> (<a href="emacs-library-babel.html">link</a>).
2020-01-11 22:04:45 +01:00
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-lob-ingest</span> <span class="org-string">"~/.config/literate-dotfiles/emacs-library-babel.org"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-28 21:32:38 +01:00
</pre>
</div>
2020-01-11 22:04:45 +01:00
</div>
</div>
2020-03-22 23:04:07 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-orge0d9b66" class="outline-3">
<h3 id="orge0d9b66">Org-Babel Matlab</h3>
<div class="outline-text-3" id="text-orge0d9b66">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
2021-04-25 19:10:57 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> org-babel-matlab-shell-command <span class="org-string">"/home/thomas/.local/bin/matlab -softwareopengl -nodesktop -nosplash"</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-03-22 23:04:07 +01:00
<p>
Default options for Matlab code
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
2021-04-25 19:10:57 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> org-babel-default-header-args:matlab
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-builtin">:results</span> . <span class="org-string">"none"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-builtin">:session</span> . <span class="org-string">"*MATLAB*"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-builtin">:comments</span> . <span class="org-string">"org"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-builtin">:exports</span> . <span class="org-string">"both"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-builtin">:cache</span> . <span class="org-string">"no"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-builtin">:noweb</span> . <span class="org-string">"no"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-builtin">:hlines</span> . <span class="org-string">"no"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-builtin">:tangle</span> . <span class="org-string">"yes"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-builtin">:mkdir</span> . <span class="org-string">"yes"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-builtin">:eval</span> . <span class="org-string">"no-export"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-11-03 16:27:09 +01:00
</pre>
</div>
<p>
Better format the output results for Matlab (<a href="https://www.reddit.com/r/emacs/comments/fy98bs/orgbabels_matlab_session_output_is_malformed/?utm_source=share&amp;utm_medium=web2x">link</a>).
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">org-babel-octave-evaluate-session</span>
<span class="org-rainbow-delimiters-depth-3">(</span>session body result-type <span class="org-type">&amp;optional</span> matlabp<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-doc">"Evaluate BODY in SESSION."</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span>tmp-file <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-temp-file</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> matlabp <span class="org-string">"matlab-"</span> <span class="org-string">"octave-"</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>
<span class="org-rainbow-delimiters-depth-1">(</span>wait-file <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-temp-file</span> <span class="org-string">"matlab-emacs-link-wait-signal-"</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>full-body
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">pcase</span> result-type
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-quoted-quote">`</span><span class="org-highlight-quoted-symbol">output</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">mapconcat</span>
2021-01-08 01:34:53 +01:00
<span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">org-babel-chomp</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">list</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> matlabp
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">multi-replace-regexp-in-string</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"%.*$"</span> . <span class="org-string">""</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;</span><span class="org-comment">Remove comments</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">";\\s-*\n+"</span> . <span class="org-string">"; "</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;</span><span class="org-comment">Concatenate lines</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">\\.</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">\\{3\\}\\s-*\n+"</span> . <span class="org-string">" "</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;</span><span class="org-comment">Handle continuations</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">",*\\s-*\n+"</span> . <span class="org-string">", "</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-comment-delimiter">;</span><span class="org-comment">Concatenate lines</span>
body<span class="org-rainbow-delimiters-depth-3">)</span>
body<span class="org-rainbow-delimiters-depth-2">)</span>
org-babel-octave-eoe-indicator<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-quoted-quote">`</span><span class="org-highlight-quoted-symbol">value</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> matlabp org-babel-matlab-with-emacs-link<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> org-babel-matlab-emacs-link-wrapper-method
2021-01-08 01:34:53 +01:00
body
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-babel-process-file-name</span> tmp-file <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">noquote</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-babel-process-file-name</span> tmp-file <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">noquote</span><span class="org-rainbow-delimiters-depth-3">)</span> wait-file<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">mapconcat</span>
2020-11-03 16:27:09 +01:00
<span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">org-babel-chomp</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> org-babel-octave-wrapper-method
2021-01-08 01:34:53 +01:00
body
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-babel-process-file-name</span> tmp-file <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">noquote</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-babel-process-file-name</span> tmp-file <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">noquote</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
org-babel-octave-eoe-indicator<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-rainbow-delimiters-depth-1">(</span>raw <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> matlabp org-babel-matlab-with-emacs-link<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">save-window-excursion</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">with-temp-buffer</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">insert</span> full-body<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">write-region</span> <span class="org-string">""</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">ignored</span> wait-file nil nil nil <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">excl</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>matlab-shell-run-region <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">point-min</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">point-max</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">message</span> <span class="org-string">"Waiting for Matlab Emacs Link"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">file-exists-p</span> wait-file<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">sit-for</span> <span class="org-highlight-numbers-number">0.01</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-string">""</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">matlab-shell-run-region doesn't seem to</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">make *matlab* buffer contents easily</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">available, so :results output currently</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">won't work</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">org-babel-comint-with-output</span>
<span class="org-rainbow-delimiters-depth-4">(</span>session
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">if</span> matlabp
2021-04-25 19:10:57 +02:00
org-babel-octave-eoe-indicator
2021-10-25 14:37:10 +02:00
org-babel-octave-eoe-output<span class="org-rainbow-delimiters-depth-1">)</span>
t full-body<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">insert</span> full-body<span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">comint-send-input</span> nil t<span class="org-rainbow-delimiters-depth-4">)</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> <span class="org-warning">results</span><span class="org-warning"><span class="org-rainbow-delimiters-depth-4">)</span></span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">pcase</span> result-type
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-quoted-quote">`</span><span class="org-highlight-quoted-symbol">value</span>
<span class="org-rainbow-delimiters-depth-2">(</span>org-babel-octave-import-elisp-from-file tmp-file<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-highlight-quoted-quote">`</span><span class="org-highlight-quoted-symbol">output</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> results
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> matlabp
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">reverse</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">delete</span> <span class="org-string">""</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">mapcar</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">org-strip-quotes</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">mapcar</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">org-trim</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">remove-car-upto-newline</span> raw<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">member</span> org-babel-octave-eoe-output
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">reverse</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">mapcar</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">org-strip-quotes</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">mapcar</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">org-trim</span> raw<span class="org-rainbow-delimiters-depth-4">)</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><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">mapconcat</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">identity</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">reverse</span> results<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">remove-car-upto-newline</span> <span class="org-rainbow-delimiters-depth-3">(</span>raw<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-doc">"Truncate each string in a list of strings up to the first newline"</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">cons</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">mapconcat</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">identity</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">split-string-and-unquote</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">car</span> raw<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">cdr</span> raw<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">multi-replace-regexp-in-string</span> <span class="org-rainbow-delimiters-depth-3">(</span>replacements-list string <span class="org-type">&amp;optional</span> rest<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-string">"Replace multiple regexps in a string. Order matters."</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">null</span> replacements-list<span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
string
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>regex <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">caar</span> replacements-list<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>replacement <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">cdar</span> replacements-list<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-function-name">multi-replace-regexp-in-string</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> replacements-list<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">replace-regexp-in-string</span> regex replacement
string rest<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-02-10 18:02:02 +01:00
<div id="outline-container-org49ad889" class="outline-3">
<h3 id="org49ad889">Mermaid</h3>
<div class="outline-text-3" id="text-org49ad889">
<div class="org-src-container">
<pre class="src src-bash">yay -S mermaid-cli
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> ob-mermaid
<span class="org-builtin">:after</span> org
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">ob-mermaid-cli-path</span> <span class="org-string">"/usr/bin/mmdc"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-mermaid">gantt
dateFormat YYYY-MM-DD
title Adding GANTT diagram to mermaid
excludes weekdays 2014-01-10
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
</pre>
</div>
2021-10-25 14:37:10 +02:00
<div id="org857e511" class="figure">
2021-02-10 18:02:02 +01:00
<p><img src="figs/mermaid.png" alt="mermaid.png" />
</p>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org27c33e4" class="outline-3">
<h3 id="org27c33e4">Some functions for using Matlab with Org Babel <code>,m</code></h3>
<div class="outline-text-3" id="text-org27c33e4">
2020-03-22 23:04:07 +01:00
<p>
<code>whos</code> matlab function
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-matlab-whos</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">&amp;optional</span> start end<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Get what is in the Matlab workspace"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">use-region-p</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span>regionp <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">buffer-substring</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">region-beginning</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">region-end</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><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"whosEmacs "</span> regionp <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">concat</span> <span class="org-string">"whosEmacs"</span> <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-03-22 23:04:07 +01:00
<p>
<code>help</code> matlab function
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-matlab-help</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">&amp;optional</span> start end<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Get help on the selected function"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">use-region-p</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span>regionp <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">buffer-substring</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">region-beginning</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">region-end</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><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"help "</span> regionp <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">concat</span> <span class="org-string">"help "</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">read-string</span> <span class="org-string">"Matlab help:"</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-03-22 23:04:07 +01:00
<p>
Specify a Matlab command to run
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<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">tdh-matlab-run-command</span> <span class="org-rainbow-delimiters-depth-2">()</span>
2021-01-08 01:34:53 +01:00
<span class="org-doc">"Prompt user to enter a matlab command"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">read-string</span> <span class="org-string">"Matlab Command: "</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-string">"\n"</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-03-22 23:04:07 +01:00
<p>
Specify a Matlab command to run and show output in mini-buffer
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-matlab-run-command-show-output</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Prompt user to enter a matlab command"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"evalEmacs('"</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">read-string</span> <span class="org-string">"Matlab Command: "</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-string">"')\n"</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-03-22 23:04:07 +01:00
<p>
Org-Babel Tangle File and Execute with Matlab
</p>
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<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">tdh-matlab-tangle-and-execute</span> <span class="org-rainbow-delimiters-depth-2">()</span>
2021-01-08 01:34:53 +01:00
<span class="org-doc">"Jump to tangle file for the source block at point."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span>file <span class="org-variable-name">org-babel-pre-tangle-hook</span> <span class="org-variable-name">org-babel-post-tangle-hook</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">cl-letf</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">symbol-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">write-region</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>start end filename <span class="org-type">&amp;rest</span> _ignore<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> file filename<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-rainbow-delimiters-depth-2">(</span><span class="org-constant">symbol-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">delete-file</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">ignore</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-babel-tangle</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-numbers-number">4</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> file
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">setq</span> file <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">expand-file-name</span> file<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-readable-p</span> file<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-string">"run "</span> file <span class="org-string">"\n"</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-function-name">error</span> <span class="org-string">"Cannot open tangle file %S"</span> file<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-03-22 23:04:07 +01:00
</pre>
2020-01-11 22:04:45 +01:00
</div>
2020-03-22 23:04:07 +01:00
<p>
Map Functions
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:prefix</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">",m"</span> . <span class="org-string">"Matlab"</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:n</span> <span class="org-string">"e"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-matlab-run-command</span>
<span class="org-builtin">:n</span> <span class="org-string">"E"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-matlab-run-command-show-output</span>
<span class="org-builtin">:n</span> <span class="org-string">"T"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-matlab-tangle-and-execute</span>
<span class="org-builtin">:nv</span> <span class="org-string">"h"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-matlab-help</span>
<span class="org-builtin">:nv</span> <span class="org-string">"w"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-matlab-whos</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orge649608" class="outline-3">
<h3 id="orge649608">Remap <code>ctrl-ret</code> used to execute the src block and go to the next one</h3>
<div class="outline-text-3" id="text-orge649608">
2020-03-22 23:04:07 +01:00
<p>
<a href="https://emacs.stackexchange.com/questions/13869/how-to-toggle-org-mode-source-code-block-eval-no-status">https://emacs.stackexchange.com/questions/13869/how-to-toggle-org-mode-source-code-block-eval-no-status</a>
</p>
<p>
Remap <code>ctrl-ret</code> to execute the source block and go to the next source block
when inside a source block. Otherwise, keep the normal behavior for <code>ctrl-ret</code>.
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-ctrl-ret</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-in-src-block-p</span> <span class="org-rainbow-delimiters-depth-3">()</span>
<span class="org-doc">"Returns t when the point is inside a source code block"</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">string=</span> <span class="org-string">"src"</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-in-block-p</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"src"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-03-22 23:04:07 +01:00
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">tdh-in-src-block-p</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">progn</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-babel-execute-src-block</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-babel-next-src-block</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">+org--insert-item</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">below</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>
2020-03-22 23:04:07 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:after</span> evil-org
<span class="org-builtin">:map</span> <span class="org-variable-name">evil-org-mode-map</span>
<span class="org-builtin">:n</span> <span class="org-string">"&lt;C-return&gt;"</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">tdh-ctrl-ret</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orge323144" class="outline-3">
<h3 id="orge323144">Remap <code>ctrl-shift-ret</code> used to execute the (matlab) src block in the background and go to the next one</h3>
<div class="outline-text-3" id="text-orge323144">
2020-03-22 23:04:07 +01:00
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org61914d9" class="outline-4">
<h4 id="org61914d9"><code>tdh-org-babel-execute-matlab-background</code></h4>
<div class="outline-text-4" id="text-org61914d9">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-org-babel-execute-matlab-background</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">&amp;optional</span> arg info params<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-variable-name">org-babel-current-src-block-location</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">or</span> <span class="org-variable-name">org-babel-current-src-block-location</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">5</span> info<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-where-is-src-block-head</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">info</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">if</span> info <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">copy-tree</span> info<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-get-src-block-info</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Merge PARAMS with INFO before considering source block</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">evaluation since both could disagree.</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">cl-callf</span> org-babel-merge-params <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">2</span> info<span class="org-rainbow-delimiters-depth-4">)</span> params<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-babel-check-evaluate</span> info<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">cl-callf</span> org-babel-process-params <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">2</span> info<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>params <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">2</span> info<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>cache <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span>c <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">assq</span> <span class="org-builtin">:cache</span> params<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-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">not</span> arg<span class="org-rainbow-delimiters-depth-1">)</span> c <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">string=</span> <span class="org-string">"yes"</span> c<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>new-hash <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> cache <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-babel-sha1-hash</span> info <span class="org-builtin">:eval</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>old-hash <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> cache <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-babel-current-result-hash</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>current-cache <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> new-hash <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">equal</span> new-hash old-hash<span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">cond</span>
<span class="org-rainbow-delimiters-depth-2">(</span>current-cache
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">save-excursion</span> <span class="org-comment-delimiter">;</span><span class="org-comment">Return cached result.</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-where-is-src-block-result</span> nil info<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">forward-line</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">skip-chars-forward</span> <span class="org-string">" \t"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>result <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-babel-read-result</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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">message</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">"%"</span> <span class="org-string">"%%"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"%S"</span> result<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
result<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-babel-confirm-evaluate</span> info<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span>lang <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">0</span> info<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>result-params <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">assq</span> <span class="org-builtin">:result-params</span> params<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Expand noweb references in BODY and remove any</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">coderef.</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-1">(</span>body
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>coderef <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">6</span> info<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>expand
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-noweb-p</span> params <span class="org-builtin">:eval</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-expand-noweb-references</span> info<span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">1</span> info<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">not</span> coderef<span class="org-rainbow-delimiters-depth-4">)</span> expand
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">replace-regexp-in-string</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-src-coderef-regexp</span> coderef<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">""</span> expand nil nil <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-rainbow-delimiters-depth-1">(</span>dir <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">assq</span> <span class="org-builtin">:dir</span> params<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>mkdirp <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">assq</span> <span class="org-builtin">:mkdirp</span> params<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-variable-name">default-directory</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">cond</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">not</span> dir<span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-variable-name">default-directory</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">member</span> mkdirp <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"no"</span> <span class="org-string">"nil"</span> nil<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">file-name-as-directory</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">expand-file-name</span> dir<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>t
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>d <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">file-name-as-directory</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">expand-file-name</span> dir<span class="org-rainbow-delimiters-depth-4">)</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>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">make-directory</span> d <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">parents</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-10-25 14:37:10 +02:00
d<span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-rainbow-delimiters-depth-1">(</span>cmd <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">intern</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"org-babel-execute:"</span> lang<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
result<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> body <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
result<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-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org03e95da" class="outline-4">
<h4 id="org03e95da"><code>tdh-matlab-execute-selected</code></h4>
<div class="outline-text-4" id="text-org03e95da">
2020-03-22 23:04:07 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-matlab-execute-selected</span> <span class="org-rainbow-delimiters-depth-2">(</span>start end<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Execute selected text in the *MATLAB* buffer"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span> <span class="org-string">"r"</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>regionp <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">buffer-substring</span> start end<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">concat</span> regionp <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-03-22 23:04:07 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgaa56d01" class="outline-4">
<h4 id="orgaa56d01">Remap <code>ctrl-shift-ref</code></h4>
<div class="outline-text-4" id="text-orgaa56d01">
2020-03-22 23:04:07 +01:00
<p>
This function:
</p>
<ul class="org-ul">
<li>first check if inside a source block, if not does nothing</li>
<li>when check if the language is <code>matlab</code>
<ul class="org-ul">
<li>if it is not, it just runs the code and go to the next source block</li>
<li>if it is in a <code>matlab</code> block, it first check if a region if selected, if so it just runs the selected region.
if no region is selected, it runs all the code blocks and goes to the next block</li>
</ul></li>
</ul>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-ctrl-shift-ret</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-in-src-block-p</span> <span class="org-rainbow-delimiters-depth-3">()</span>
<span class="org-doc">"Returns t when the point is inside a source code block"</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">string=</span> <span class="org-string">"src"</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-in-block-p</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"src"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">tdh-in-src-block-p</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span>lang <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">0</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-babel-get-src-block-info</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><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">string=</span> lang <span class="org-string">"matlab"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">region-active-p</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">tdh-matlab-execute-selected</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">region-beginning</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">region-end</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">progn</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">tdh-org-babel-execute-matlab-background</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-babel-next-src-block</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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-next-src-block</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">)</span>
2021-02-10 18:02:02 +01:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-babel-next-src-block</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-03-22 23:04:07 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:after</span> evil-org
<span class="org-builtin">:map</span> <span class="org-variable-name">evil-org-mode-map</span>
<span class="org-builtin">:n</span> <span class="org-string">"&lt;C-S-return&gt;"</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">tdh-ctrl-shift-ret</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-22 23:04:07 +01:00
</pre>
</div>
</div>
2020-01-11 22:04:45 +01:00
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orga08a234" class="outline-3">
<h3 id="orga08a234">Align Source Blocks</h3>
<div class="outline-text-3" id="text-orga08a234">
2020-05-26 08:40:15 +02:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-align-src-block</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-in-src-block-p</span> <span class="org-rainbow-delimiters-depth-3">()</span>
<span class="org-doc">"Returns t when the point is inside a source code block"</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">string=</span> <span class="org-string">"src"</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-in-block-p</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"src"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">tdh-in-src-block-p</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">progn</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-edit-special</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">indent-region</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point-min</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point-max</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-edit-src-exit</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-table-eval-formula</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>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org3096b75" class="outline-3">
<h3 id="org3096b75">Helping Functions - Tangling <code>,b</code></h3>
<div class="outline-text-3" id="text-org3096b75">
2020-03-22 23:04:07 +01:00
<p>
Org-Babel Tangle Sub-tree
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-org-babel-tangle-subtree</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Tangle the current subtree"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">progn</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-narrow-to-subtree</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-babel-tangle</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">widen</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<p>
2020-03-22 23:04:07 +01:00
Org-Tangle and Org-Babel Jump to Tangle File
2020-01-11 22:04:45 +01:00
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-org-babel-jump-to-tangle-file</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Jump to tangle file for the source block at point."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span>file <span class="org-variable-name">org-babel-pre-tangle-hook</span> <span class="org-variable-name">org-babel-post-tangle-hook</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">cl-letf</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">symbol-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">write-region</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>start end filename <span class="org-type">&amp;rest</span> _ignore<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> file filename<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-rainbow-delimiters-depth-2">(</span><span class="org-constant">symbol-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">delete-file</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">ignore</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-babel-tangle</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-numbers-number">4</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> file
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">setq</span> file <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">expand-file-name</span> file<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-readable-p</span> file<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">find-file</span> file<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">error</span> <span class="org-string">"Cannot open tangle file %S"</span> file<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-03-22 23:04:07 +01:00
<p>
Map Functions
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:prefix</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">",b"</span> . <span class="org-string">"Tangle"</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:n</span> <span class="org-string">"F"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-org-babel-jump-to-tangle-file</span>
<span class="org-builtin">:n</span> <span class="org-string">"T"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-org-babel-tangle-subtree</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org8935fa7" class="outline-2">
<h2 id="org8935fa7">Bibliography Management</h2>
<div class="outline-text-2" id="text-org8935fa7">
2020-05-26 08:40:15 +02:00
<p>
My bibliography management is mainly based on the following packages:
</p>
2020-01-11 22:04:45 +01:00
<ul class="org-ul">
2020-05-26 08:40:15 +02:00
<li><code>org-ref</code> for nice citations</li>
<li><code>org-noter</code> to annotate documents</li>
<li><code>org-roam</code> to manage and links all my notes</li>
<li><code>helm-bibtex</code> as an interface to easily find references</li>
<li><code>org-roam-bibtex</code> that connects all the above packages</li>
2020-01-11 22:04:45 +01:00
</ul>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgf80673e" class="outline-3">
<h3 id="orgf80673e">Org Ref (<a href="https://github.com/jkitchin/org-ref">link</a>)</h3>
<div class="outline-text-3" id="text-orgf80673e">
2020-05-26 08:40:15 +02:00
<p>
Nice Functions:
</p>
<ul class="org-ul">
<li><code>org-ref-insert-ref-link</code></li>
<li><code>org-ref-helm-insert-cite-link</code></li>
<li><code>org-ref-list-of-figures</code></li>
<li><code>org-ref-find-bad-citations</code></li>
<li><code>org-ref-clean-bibtex-entry</code></li>
</ul>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> org-ref
<span class="org-builtin">:after</span> org
<span class="org-builtin">:init</span>
<span class="org-builtin">:config</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Folder where the notes files are located (or file if just one Note file)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-ref-notes-directory</span> <span class="org-string">"~/Cloud/brain"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-ref-bibliography-notes</span> <span class="org-string">"~/Cloud/brain"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Bibliography File</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">reftex-default-bibliography</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"~/Cloud/brain/biblio/references.bib"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-ref-default-bibliography</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"~/Cloud/brain/biblio/references.bib"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Folder where all the pdf are located</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-ref-pdf-directory</span> <span class="org-string">"~/Cloud/pdfs"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-ref-bibliography-entry-format</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"article"</span> . <span class="org-string">"%a, %t, %j, v(%n), %p (%y)."</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"book"</span> . <span class="org-string">"%a, %t, %u (%y)."</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"techreport"</span> . <span class="org-string">"%a, %t, %i, %u (%y)."</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"phdthesis"</span> . <span class="org-string">"%a, %t (%y)."</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"proceedings"</span> . <span class="org-string">"%e, %t in %S, %u (%y)."</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"inproceedings"</span> . <span class="org-string">"%a, %t, %p, in %b, edited by %e, %u (%y)"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Tell org-ref to let helm-bibtex find notes for it</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-ref-notes-function</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-4">(</span>thekey<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">bibtex-completion-bibliography</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ref-find-bibliography</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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">bibtex-completion-edit-notes</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">car</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-ref-get-bibtex-key-and-file</span> thekey<span class="org-rainbow-delimiters-depth-4">)</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><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Problem with speed: don't display broken links</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-ref-show-broken-links</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Display information on the citation</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-ref-show-citation-on-enter</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-ref-helm-user-candidates</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"Open pdf in Zathura"</span> . <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">()</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">call-process</span> <span class="org-string">"zathura"</span> nil <span class="org-highlight-numbers-number">0</span> nil <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">file-name-as-directory</span> <span class="org-variable-name">org-ref-pdf-directory</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">car</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-ref-get-bibtex-key-and-file</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-string">".pdf"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-ref-helm-user-candidates</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"Drag and Drop"</span> . <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">()</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">call-process</span> <span class="org-string">"/bin/bash"</span> nil <span class="org-highlight-numbers-number">0</span> nil <span class="org-string">"-c"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span>
2021-01-08 01:34:53 +01:00
<span class="org-string">"dragon-drag-and-drop "</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">file-name-as-directory</span> <span class="org-variable-name">org-ref-pdf-directory</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">car</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">org-ref-get-bibtex-key-and-file</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-string">".pdf"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Let Mathjax deals with equation reference</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">org-ref-eqref-export</span> <span class="org-rainbow-delimiters-depth-3">(</span>keyword desc format<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">cond</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">eq</span> format <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">latex</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"\\eqref{%s}"</span> keyword<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">eq</span> format <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">html</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"\\eqref{%s}"</span> keyword<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">eq</span> format <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">md</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"\\eqref{%s}"</span> keyword<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-org-ref-open-pdf-at-point</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Open the pdf in external program for bibtex key under point if it exists."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>results <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-ref-get-bibtex-key-and-file</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>key <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">car</span> results<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>pdf-file <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">funcall</span> <span class="org-variable-name">org-ref-get-pdf-filename-function</span> key<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">file-exists-p</span> pdf-file<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">call-process</span> <span class="org-string">"zathura"</span> nil <span class="org-highlight-numbers-number">0</span> nil pdf-file<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">message</span> <span class="org-string">"no pdf found for %s"</span> key<span class="org-rainbow-delimiters-depth-4">)</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>
2021-04-25 19:10:57 +02:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Open with Zathura by default</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-ref-open-pdf-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-org-ref-open-pdf-at-point</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org9d0f05b" class="outline-3">
<h3 id="org9d0f05b">Org Noter (<a href="https://github.com/weirdNox/org-noter">link</a>)</h3>
<div class="outline-text-3" id="text-org9d0f05b">
2020-03-22 23:04:07 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> org-noter
<span class="org-builtin">:defer</span> t
<span class="org-builtin">:after</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:any</span> org pdf-view<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-noter-always-create-frame</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-noter-kill-frame-at-session-end</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Fraction of the frame that the document window will occupy when split</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-noter-doc-split-fraction</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-highlight-numbers-number">0.6</span> . <span class="org-highlight-numbers-number">0.6</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Save the last visited location automatically; when starting a new session, go to that location</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-noter-auto-save-last-location</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Add an empty line between each note's heading and content</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-noter-separate-notes-from-heading</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">List of paths to check (non recursively) when searching for a notes file</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-noter-notes-search-path</span> <span class="org-string">"~/Cloud/brain"</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">org-noter-init-pdf-view</span> <span class="org-rainbow-delimiters-depth-3">()</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">pdf-view-fit-page-to-window</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">pdf-view-auto-slice-minor-mode</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">run-at-time</span> <span class="org-string">"0.5 sec"</span> nil <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">org-noter</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">pdf-view-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-noter-init-pdf-view</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span>
<span class="org-builtin">:map</span> <span class="org-variable-name">pdf-view-mode-map</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:desc</span> <span class="org-string">"Insert Note"</span>
<span class="org-builtin">:n</span> <span class="org-string">"i"</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">org-noter-insert-note</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>
2020-03-22 23:04:07 +01:00
</pre>
</div>
</div>
</div>
2021-10-25 14:37:10 +02:00
<div id="outline-container-org7795c91" class="outline-3">
<h3 id="org7795c91">Capture Templates</h3>
<div class="outline-text-3" id="text-org7795c91">
</div>
<div id="outline-container-orgb9d8d5a" class="outline-4">
<h4 id="orgb9d8d5a">Bibliography</h4>
<div class="outline-text-4" id="text-orgb9d8d5a">
<div class="org-src-container">
<pre class="src src-org">- <span class="org-org-list-dt">Tags ::</span> %?
- <span class="org-org-list-dt">Reference ::</span> ${ref}
- <span class="org-org-list-dt">Author(s) ::</span> %<span class="org-org-latex-and-related">^{author}</span>
- <span class="org-org-list-dt">Year ::</span> %<span class="org-org-latex-and-related">^{year}</span>
<span class="org-org-level-1">* %</span><span class="org-org-level-1"><span class="org-org-latex-and-related">^{author-abbrev}</span></span><span class="org-org-level-1"> (%</span><span class="org-org-level-1"><span class="org-org-latex-and-related">^{year}</span></span><span class="org-org-level-1">): %</span><span class="org-org-level-1"><span class="org-org-latex-and-related">^{title}</span></span><span class="org-org-level-1"> :%</span><span class="org-org-level-1"><span class="org-org-latex-and-related">^{entry-type}</span></span><span class="org-org-level-1">:ignore:</span>
<span class="org-org-drawer">:PROPERTIES:</span>
<span class="org-org-special-keyword">:NOTER_DOCUMENT:</span> <span class="org-org-property-value">../pdfs/%</span><span class="org-org-property-value"><span class="org-org-latex-and-related">^{citekey}</span></span><span class="org-org-property-value">.pdf</span>
<span class="org-org-drawer">:END:</span>
<span class="org-org-level-1">* Bibliography </span><span class="org-org-level-1"><span class="org-org-tag">:ignore:</span></span>
<span class="org-org-meta-line">#+BIBLIOGRAPHY: here</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org0625ef3" class="outline-4">
<h4 id="org0625ef3">Default</h4>
<div class="outline-text-4" id="text-org0625ef3">
<div class="org-src-container">
<pre class="src src-org">- <span class="org-org-list-dt">Tags ::</span>
%?
<span class="org-org-level-1">* Bibliography </span><span class="org-org-level-1"><span class="org-org-tag">:ignore:</span></span>
<span class="org-org-meta-line">#+BIBLIOGRAPHY: here</span>
</pre>
</div>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org750d939" class="outline-3">
<h3 id="org750d939">Org Roam (<a href="https://github.com/jethrokuan/org-roam/">link</a>)</h3>
<div class="outline-text-3" id="text-org750d939">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> org-roam
<span class="org-builtin">:custom-face</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>org-roam-link <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>t <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:inherit</span> org-link <span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:config</span>
2021-02-10 18:02:02 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-roam-directory</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">file-truename</span> <span class="org-string">"~/Cloud/brain/"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">make-directory</span> <span class="org-variable-name">org-roam-directory</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">parents</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> org-roam-completion-system <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">helm</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> org-roam-tag-sources <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span>prop last-directory<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-roam-capture-templates</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"d"</span> <span class="org-string">"default"</span> plain <span class="org-rainbow-delimiters-depth-1">(</span>file <span class="org-string">"~/.config/doom/capture-templates/default.org"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:if-new</span> <span class="org-rainbow-delimiters-depth-1">(</span>file+head <span class="org-string">"${slug}.org"</span> <span class="org-string">"#+title: ${title}\n#+setupfile: ./setup/org-setup-file.org\n#+hugo_section: zettels\n\n"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:unnarrowed</span> t<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"r"</span> <span class="org-string">"bibliography reference"</span> plain <span class="org-rainbow-delimiters-depth-1">(</span>file <span class="org-string">"~/.config/doom/capture-templates/ref.org"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:if-new</span> <span class="org-rainbow-delimiters-depth-1">(</span>file+head <span class="org-string">"${citekey}.org"</span> <span class="org-string">"#+title: ${title}\n#+setupfile: ./setup/org-setup-file.org\n#+hugo_section: ${entry-type}\n\n"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:unnarrowed</span> t<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-11-03 16:27:09 +01:00
</pre>
</div>
<p>
Automatic export of backlinks
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> <span class="org-rainbow-delimiters-depth-2">(</span>org org-roam<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-org-roam--backlinks-list</span> <span class="org-rainbow-delimiters-depth-3">(</span>file<span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-4">(</span>org-roam--org-roam-file-p file<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">mapcar</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">car</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-roam-db-query</span> <span class="org-rainbow-delimiters-depth-2">[</span><span class="org-builtin">:select</span> <span class="org-builtin">:distinct</span> <span class="org-rainbow-delimiters-depth-3">[</span>from<span class="org-rainbow-delimiters-depth-3">]</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:from</span> links
2021-10-25 14:37:10 +02:00
<span class="org-builtin">:where</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">=</span> to $s1<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-builtin">:and</span> from <span class="org-builtin">:not</span> <span class="org-builtin">:like</span> $s2<span class="org-rainbow-delimiters-depth-2">]</span> file <span class="org-string">"%private%"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-org-export-preprocessor</span> <span class="org-rainbow-delimiters-depth-3">(</span>_backend<span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when-let</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span>links <span class="org-rainbow-delimiters-depth-2">(</span>tdh-org-roam--backlinks-list <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">buffer-file-name</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><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">insert</span> <span class="org-string">"\nBacklinks:\n"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">dolist</span> <span class="org-rainbow-delimiters-depth-1">(</span>link links<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> <span class="org-string">"- [[file:%s][%s]]\n"</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">file-relative-name</span> link <span class="org-variable-name">org-roam-directory</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>org-roam--get-title-or-slug link<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-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
2021-02-10 18:02:02 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-export-before-processing-hook</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">tdh-org-export-preprocessor</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2021-01-01 20:12:34 +01:00
2021-02-10 18:02:02 +01:00
<p>
Re-Export all roam files.
</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">tdh-org-roam-export-all</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Re-exports all Org-roam files to Hugo markdown."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">dolist</span> <span class="org-rainbow-delimiters-depth-3">(</span>f <span class="org-rainbow-delimiters-depth-4">(</span>org-roam--list-all-files<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">with-current-buffer</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">find-file</span> f<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">s-contains?</span> <span class="org-string">"SETUPFILE"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">buffer-string</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-function-name">org-hugo-export-wim-to-md</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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>
2021-01-01 20:12:34 +01:00
</pre>
</div>
2020-01-11 22:04:45 +01:00
</div>
</div>
2020-03-01 22:51:16 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-org528a649" class="outline-3">
<h3 id="org528a649">Helm-Bibtex (<a href="https://github.com/tmalsburg/helm-bibtex">link</a>)</h3>
<div class="outline-text-3" id="text-org528a649">
2020-03-01 22:51:16 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> helm-bibtex
<span class="org-builtin">:after-call</span> helm-bibtex
<span class="org-builtin">:init</span>
<span class="org-builtin">:config</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Bibliography file</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">bibtex-completion-bibliography</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"~/Cloud/brain/biblio/references.bib"</span>
<span class="org-string">"~/Cloud/acoustic/resources/acoustics.bib"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Directory with all the pdfs</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">bibtex-completion-library-path</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"~/Cloud/pdfs/"</span>
<span class="org-string">"~/Cloud/acoustic/resources/pdfs/"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Directory with notes files</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">bibtex-completion-notes-path</span> <span class="org-string">"~/Cloud/brain/"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">bibtex-completion-notes-extension</span> <span class="org-string">".org"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">bibtex-completion-pdf-extension</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">".pdf"</span> <span class="org-string">".djvu"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">bibtex-completion-additional-search-fields</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span>keywords<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use "keywords" field when looking for bib entries</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">helm-bibtex-additional-search-fields</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span>keywords<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">helm-bibtex-full-frame</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Display of bibtex entries with helm</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">bibtex-completion-display-formats</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>t . <span class="org-string">"${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=:1}"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Special symbols for notes and pdf</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">bibtex-completion-pdf-symbol</span> <span class="org-string">"&#8984;"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">bibtex-completion-notes-symbol</span> <span class="org-string">"&#9998;"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Template used when creating new Note file</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">bibtex-completion-notes-template-multiple-files</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"#+title: ${title}\n"</span>
<span class="org-string">"#+setupfile: ./setup/org-setup-file.org\n"</span>
<span class="org-string">"#+hugo_section: ${=type=}\n"</span>
<span class="org-string">"#+roam_key: ${=key=}\n"</span>
2021-10-25 14:37:10 +02:00
<span class="org-string">"#+hugo_draft: true\n"</span>
2021-01-08 01:34:53 +01:00
<span class="org-string">"\n"</span>
<span class="org-string">"- Tags ::\n"</span>
<span class="org-string">"- Reference :: cite:${=key=}\n"</span>
<span class="org-string">"- Author(s) :: ${author}\n"</span>
<span class="org-string">"- Year :: ${year}\n"</span>
<span class="org-string">"\n"</span>
<span class="org-string">"* ${author-abbrev} (${year}): ${title} :${=type=}:ignore:\n"</span>
<span class="org-string">":PROPERTIES:\n"</span>
<span class="org-string">":NOTER_DOCUMENT: ../pdfs/${=key=}.pdf\n"</span>
<span class="org-string">":END:\n"</span>
<span class="org-string">"\n"</span>
<span class="org-string">"* Bibliography :ignore:\n"</span>
<span class="org-string">"bibliography:./biblio/references.bib"</span>
<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Make "Edit notes" the default action</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">helm-delete-action-from-source</span> <span class="org-string">"Edit notes"</span> <span class="org-variable-name">helm-source-bibtex</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">helm-add-action-to-source</span> <span class="org-string">"Edit notes"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">helm-bibtex-edit-notes</span> <span class="org-variable-name">helm-source-bibtex</span> <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">helm-delete-action-from-source</span> <span class="org-string">"Open PDF Externally"</span> <span class="org-variable-name">helm-source-bibtex</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">helm-add-action-to-source</span> <span class="org-string">"Open PDF Externally"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-open-pdf-externally</span> <span class="org-variable-name">helm-source-bibtex</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">helm-add-action-to-source</span> <span class="org-string">"Insert Link to Note"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-insert-link-to-note</span> <span class="org-variable-name">helm-source-bibtex</span> <span class="org-highlight-numbers-number">2</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">helm-add-action-to-source</span> <span class="org-string">"Insert E-Reader Link"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-insert-link-to-pdf-entry</span> <span class="org-variable-name">helm-source-bibtex</span> <span class="org-highlight-numbers-number">3</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-11-03 16:27:09 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-insert-link-to-pdf-entry</span> <span class="org-rainbow-delimiters-depth-2">(</span>key<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Insert a link to a pdf associated with the bibtex entry."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let*</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span>entry <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">bibtex-completion-get-entry</span> key<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>title <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">bibtex-completion-get-value</span> <span class="org-string">"title"</span> entry<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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-rainbow-delimiters-depth-4">(</span><span class="org-constant">concat</span> <span class="org-string">"[[file:Download/"</span> key <span class="org-string">".pdf]["</span> title <span class="org-string">"]] (cite:"</span> key <span class="org-string">")"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-insert-link-to-note</span> <span class="org-rainbow-delimiters-depth-2">(</span>key<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Insert a link to a note associated with the bibtex entry."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-variable-name">bibtex-completion-notes-path</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">f-directory?</span> <span class="org-variable-name">bibtex-completion-notes-path</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span>path <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">f-join</span> <span class="org-variable-name">bibtex-completion-notes-path</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">s-concat</span> key <span class="org-variable-name">bibtex-completion-notes-extension</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><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-exists-p</span> path<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-string">"[[file:"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">file-relative-name</span> path<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-string">"][Notes]]"</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">message</span> <span class="org-string">"No note file associated"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-05-26 08:40:15 +02:00
<p>
Open pdf externally
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-open-pdf-externally</span> <span class="org-rainbow-delimiters-depth-2">(</span>key<span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">call-process</span> <span class="org-string">"zathura"</span> nil <span class="org-highlight-numbers-number">0</span> nil <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">0</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">-cons-to-list</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">bibtex-completion-find-pdf</span> key<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-05-26 08:40:15 +02:00
<p>
Special Commands
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-helm-bibtex-favorites</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">&amp;optional</span> arg<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Search Favorite BibTeX entries"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span> <span class="org-string">"P"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">helm-bibtex</span> arg nil <span class="org-string">"favorite "</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
2020-01-11 22:04:45 +01:00
</div>
2020-05-26 08:40:15 +02:00
<p>
List all element of the bibliography without pdf associated
</p>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-list-bib-without-pdf-associated</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">bibtex-completion-init</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> candidates <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">bibtex-completion-candidates</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">canditate-is-pdf-present</span> <span class="org-rainbow-delimiters-depth-3">(</span>candidate<span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">bibtex-completion-find-pdf-in-library</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">assoc</span> <span class="org-string">"=key="</span> candidate<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> candidates-without-pdf <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">remove-if</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">canditate-is-pdf-present</span> candidates<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> candidate-without-pdf-names <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">mapcar</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">(</span>x<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">assoc</span> <span class="org-string">"title"</span> x<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
candidates-without-pdf<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">with-output-to-temp-buffer</span> <span class="org-string">"*bib-without-pdf*"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">princ</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">string-join</span> candidate-without-pdf-names <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">switch-to-buffer-other-window</span> <span class="org-string">"*bib-without-pdf*"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-10-25 14:37:10 +02:00
<div id="outline-container-orgd7adc6f" class="outline-3">
<h3 id="orgd7adc6f">Deft (<a href="https://github.com/jrblevin/deft">link</a>)</h3>
<div class="outline-text-3" id="text-orgd7adc6f">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> deft
<span class="org-builtin">:custom</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>deft-directory <span class="org-string">"~/Cloud/brain/"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-10-25 14:37:10 +02:00
<div id="outline-container-org2fbe257" class="outline-3">
<h3 id="org2fbe257">Org-Roam-Bibtex (<a href="https://github.com/org-roam/org-roam-bibtex">link</a>)</h3>
<div class="outline-text-3" id="text-org2fbe257">
2020-05-26 08:40:15 +02:00
<p>
Provides nice functions such as:
</p>
<ul class="org-ul">
<li><code>orb-find-non-ref-file</code></li>
<li><code>orb-insert-non-ref</code></li>
<li><code>orb-note-action</code></li>
</ul>
2020-01-11 22:04:45 +01:00
2020-05-26 08:40:15 +02:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> org-roam-bibtex
2021-10-25 14:37:10 +02:00
<span class="org-builtin">:after</span> org-roam
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:config</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">orb-preformat-keywords</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"citekey"</span> <span class="org-string">"title"</span> <span class="org-string">"author"</span> <span class="org-string">"year"</span> <span class="org-string">"author-abbrev"</span> <span class="org-string">"entry-type"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">orb-note-actions-user</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"Open with Zathura"</span> . tdh-open-bib-with-zathura<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-open-bib-with-zathura</span> <span class="org-rainbow-delimiters-depth-2">(</span>key<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Open the pdf corresponding to the reference KEY with Zathura"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">listp</span> key<span class="org-rainbow-delimiters-depth-3">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> key <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">car</span> key<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">call-process</span> <span class="org-string">"zathura"</span> nil <span class="org-highlight-numbers-number">0</span> nil <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ref-get-pdf-filename</span> key<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org31992e4" class="outline-3">
<h3 id="org31992e4">Citeproc-org (<a href="https://github.com/andras-simonyi/citeproc-org">link</a>)</h3>
<div class="outline-text-3" id="text-org31992e4">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> citeproc-org
<span class="org-builtin">:after</span> org
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">citeproc-org-setup</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">citeproc-org-html-backends</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span>html<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-02-10 18:02:02 +01:00
<div id="outline-container-orgb692dae" class="outline-3">
<h3 id="orgb692dae">Bibtex-Mode</h3>
<div class="outline-text-3" id="text-orgb692dae">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> bibtex
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">bibtex-mode-map</span>
<span class="org-builtin">:n</span> <span class="org-string">"C-c c"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-ref-clean-bibtex-entry</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-03-01 22:51:16 +01:00
</div>
2020-05-26 08:40:15 +02:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-org5722bd7" class="outline-2">
<h2 id="org5722bd7">LaTeX</h2>
<div class="outline-text-2" id="text-org5722bd7">
2020-05-26 08:40:15 +02:00
<ul class="org-ul">
<li><a href="https://tex.stackexchange.com/questions/52179/what-is-your-favorite-emacs-and-or-auctex-command-trick">https://tex.stackexchange.com/questions/52179/what-is-your-favorite-emacs-and-or-auctex-command-trick</a></li>
<li><a href="https://tex.stackexchange.com/questions/20843/useful-shortcuts-or-key-bindings-or-predefined-commands-for-emacsauctex">https://tex.stackexchange.com/questions/20843/useful-shortcuts-or-key-bindings-or-predefined-commands-for-emacsauctex</a></li>
</ul>
2020-03-01 22:51:16 +01:00
</div>
2021-10-25 14:37:10 +02:00
<div id="outline-container-org8a54304" class="outline-3">
<h3 id="org8a54304">Basic Config</h3>
<div class="outline-text-3" id="text-org8a54304">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> auctex
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">+latex-viewers</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span>zathura pdf-tools<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-05-26 08:40:15 +02:00
</div>
</div>
2020-01-11 22:04:45 +01:00
2021-01-01 20:12:34 +01:00
<div id="outline-container-orge71a16b" class="outline-3">
<h3 id="orge71a16b">Bibtex</h3>
<div class="outline-text-3" id="text-orge71a16b">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> bibtex
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">bibtex-set-dialect</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">BibTeX</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgc460c80" class="outline-2">
<h2 id="orgc460c80">Matlab</h2>
<div class="outline-text-2" id="text-orgc460c80">
2020-01-11 22:04:45 +01:00
<ul class="org-ul">
2020-05-26 08:40:15 +02:00
<li><a href="https://sourceforge.net/projects/matlab-emacs/">https://sourceforge.net/projects/matlab-emacs/</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orga959435" class="outline-3">
<h3 id="orga959435">Setup Matlab Mode</h3>
<div class="outline-text-3" id="text-orga959435">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-04-25 19:10:57 +02:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> matlab-shell-command <span class="org-string">"/home/thomas/.local/bin/matlab"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> matlab-shell-command-switches <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-string">"-softwareopengl -nodesktop -nosplash"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> matlab-indent-function t<span class="org-rainbow-delimiters-depth-1">)</span>
2021-04-25 19:10:57 +02:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mlint-programs <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"mlint"</span> <span class="org-string">"/home/thomas/.local/bin/mlint"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org52660ee" class="outline-3">
<h3 id="org52660ee">Setup Flycheck to work with <code>mlint</code></h3>
<div class="outline-text-3" id="text-org52660ee">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defvar</span> <span class="org-variable-name">mlint-executable</span> <span class="org-string">"/home/thomas/.local/bin/mlint"</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">flycheck-define-command-checker</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">matlab-mlint</span>
<span class="org-doc">"A Matlab checker based on mlint."</span>
<span class="org-builtin">:command</span> <span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-2">(</span>,<span class="org-variable-name">mlint-executable</span> source<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:error-patterns</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>warning line-start <span class="org-string">"L "</span> line <span class="org-string">" (C "</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">1+</span> digit<span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-string">"): "</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">message</span><span class="org-rainbow-delimiters-depth-4">)</span> line-end<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:modes</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>matlab-mode<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">flycheck-checkers</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">matlab-mlint</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Automatic startup of flycheck for matlab</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">matlab-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">flycheck-mode</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgc8534a9" class="outline-3">
<h3 id="orgc8534a9">Completion in the Matlab Shell</h3>
<div class="outline-text-3" id="text-orgc8534a9">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-04-25 19:10:57 +02:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> matlab-shell-mode-map
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:i</span> <span class="org-string">"&lt;tab&gt;"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">matlab-shell-tab</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org5cfeb30" class="outline-3">
<h3 id="org5cfeb30">Beautify code</h3>
<div class="outline-text-3" id="text-org5cfeb30">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-matlab-beautify-buffer</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Beautify Current Matlab Buffer"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">First verifies is the current file is a Matlab file</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">string=</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">file-name-extension</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-string">"m"</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">progn</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">save-buffer</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"MBeautify.formatFileNoEditor(\""</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-string">"\", \""</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-string">"\")"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">revert-buffer</span> <span class="org-builtin">:ignore-auto</span> <span class="org-builtin">:noconfirm</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">message</span> <span class="org-string">"Current buffer is not a matlab file"</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org6529958" class="outline-3">
<h3 id="org6529958">Key Bindings</h3>
<div class="outline-text-3" id="text-org6529958">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">tdh-matlab-add-breakpoint</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"dbstop in "</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">buffer-name</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-string">" at "</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">number-to-string</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">line-number-at-pos</span> nil<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-matlab-remove-breakpoint</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"dbclear in "</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">buffer-name</span><span class="org-rainbow-delimiters-depth-4">)</span> <span class="org-string">" at "</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">number-to-string</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">line-number-at-pos</span> nil<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-matlab-list-breakpoints</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"dbstatus "</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">buffer-name</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-matlab-clear-breakpoints</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"dbclear in "</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">buffer-name</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-matlab-no-debug-on-error</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-04-25 19:10:57 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"dbclear if error"</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>
2020-11-03 16:27:09 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-matlab-debug-on-error</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-04-25 19:10:57 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"dbstop if error"</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>
2020-11-03 16:27:09 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-matlab-go-to-file-directory</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"cd "</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">file-name-directory</span> <span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">matlab-mode-map</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:prefix</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">","</span> . <span class="org-string">"prefix"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-builtin">:n</span> <span class="org-string">"g"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-matlab-go-to-file-directory</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:prefix</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"d"</span> . <span class="org-string">"Debug"</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:n</span> <span class="org-string">"de"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-matlab-debug-on-error</span>
<span class="org-builtin">:n</span> <span class="org-string">"dE"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-matlab-no-debug-on-error</span>
<span class="org-builtin">:n</span> <span class="org-string">"da"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-matlab-add-breakpoint</span>
<span class="org-builtin">:n</span> <span class="org-string">"dr"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-matlab-remove-breakpoint</span>
<span class="org-builtin">:n</span> <span class="org-string">"dL"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-matlab-list-breakpoints</span>
<span class="org-builtin">:n</span> <span class="org-string">"dc"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-matlab-clear-breakpoints</span>
<span class="org-builtin">:n</span> <span class="org-string">"dl"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">gud-cont</span>
<span class="org-builtin">:n</span> <span class="org-string">"ds"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">gud-step</span>
<span class="org-builtin">:n</span> <span class="org-string">"dn"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">gud-next</span>
<span class="org-builtin">:n</span> <span class="org-string">"dq"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">gud-finish</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
</div>
2021-04-25 19:10:57 +02:00
<div id="outline-container-orgf8bb7bc" class="outline-2">
<h2 id="orgf8bb7bc">Pandoc</h2>
<div class="outline-text-2" id="text-orgf8bb7bc">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> pandoc-mode
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org4d9098f" class="outline-2">
<h2 id="org4d9098f">Mu4e</h2>
<div class="outline-text-2" id="text-org4d9098f">
2020-01-11 22:04:45 +01:00
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgafab721" class="outline-3">
<h3 id="orgafab721">Resources</h3>
<div class="outline-text-3" id="text-orgafab721">
2020-01-11 22:04:45 +01:00
<p>
2020-05-26 08:40:15 +02:00
Documentation:
2020-01-11 22:04:45 +01:00
</p>
2020-05-26 08:40:15 +02:00
<ul class="org-ul">
<li class="off"><code>[&#xa0;]</code> Mu4e documentation: <a href="http://www.djcbsoftware.nl/code/mu/mu4e/index.html#Top">http://www.djcbsoftware.nl/code/mu/mu4e/index.html#Top</a></li>
<li class="off"><code>[&#xa0;]</code> <a href="https://github.com/djcb/mu">https://github.com/djcb/mu</a></li>
</ul>
2020-01-11 22:04:45 +01:00
<p>
2020-05-26 08:40:15 +02:00
Use contexts for multiple accounts:
2020-01-11 22:04:45 +01:00
</p>
2020-05-26 08:40:15 +02:00
<ul class="org-ul">
<li class="off"><code>[&#xa0;]</code> <a href="https://vxlabs.com/2017/02/07/mu4e-0-9-18-e-mailing-with-emacs-now-even-better/">https://vxlabs.com/2017/02/07/mu4e-0-9-18-e-mailing-with-emacs-now-even-better/</a></li>
<li class="off"><code>[&#xa0;]</code> <a href="http://cachestocaches.com/2017/3/complete-guide-email-emacs-using-mu-and-/">http://cachestocaches.com/2017/3/complete-guide-email-emacs-using-mu-and-/</a></li>
<li class="off"><code>[&#xa0;]</code> <a href="https://notanumber.io/2016-10-03/better-email-with-mu4e/">https://notanumber.io/2016-10-03/better-email-with-mu4e/</a></li>
</ul>
2020-01-11 22:04:45 +01:00
<p>
2020-05-26 08:40:15 +02:00
Send math and source code:
2020-01-11 22:04:45 +01:00
</p>
2020-05-26 08:40:15 +02:00
<ul class="org-ul">
<li class="off"><code>[&#xa0;]</code> <a href="https://vxlabs.com/2015/01/28/sending-emails-with-math-and-source-code/">https://vxlabs.com/2015/01/28/sending-emails-with-math-and-source-code/</a></li>
</ul>
2020-01-11 22:04:45 +01:00
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org2b8b75f" class="outline-3">
<h3 id="org2b8b75f">Cheatsheet</h3>
<div class="outline-text-3" id="text-org2b8b75f">
2020-01-11 22:04:45 +01:00
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">Command</th>
<th scope="col" class="org-left">Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left"><code>C-j</code></td>
<td class="org-left">Next mail</td>
</tr>
<tr>
<td class="org-left"><code>C-k</code></td>
<td class="org-left">Previous mail</td>
</tr>
<tr>
<td class="org-left"><code>R/C/F</code></td>
<td class="org-left">Reply/Compose/Forward</td>
</tr>
<tr>
<td class="org-left"><code>t</code></td>
<td class="org-left">Move to Archive</td>
</tr>
<tr>
<td class="org-left"><code>d</code></td>
<td class="org-left">Move to Trash</td>
</tr>
</tbody>
</table>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-orgebf9129" class="outline-3">
<h3 id="orgebf9129">Helping function</h3>
<div class="outline-text-3" id="text-orgebf9129">
2020-01-11 22:04:45 +01:00
<p>
2020-05-26 08:40:15 +02:00
This is a helper to help determine which account context I am in based on the folder in my maildir the email (eg. ~/.mail/nine27) is located in.
2020-01-11 22:04:45 +01:00
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">mu4e-message-maildir-matches</span> <span class="org-rainbow-delimiters-depth-2">(</span>msg rx<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> rx
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">listp</span> rx<span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">If rx is a list, try each one for a match</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">or</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">mu4e-message-maildir-matches</span> msg <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> rx<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-function-name">mu4e-message-maildir-matches</span> msg <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> rx<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Not a list, check rx</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-constant">string-match</span> rx <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">mu4e-message-field</span> msg <span class="org-builtin">:maildir</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<p>
2020-05-26 08:40:15 +02:00
Choose account label to feed msmtp -a option based on From header in Message buffer; This function must be added to message-send-mail-hook for on-the-fly change of From address before sending message since message-send-mail-hook is processed right before sending message.
2020-01-11 22:04:45 +01:00
</p>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<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">choose-msmtp-account</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">message-mail-p</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">save-excursion</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-keyword">let*</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>from <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">save-restriction</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">message-narrow-to-headers</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">message-fetch-field</span> <span class="org-string">"from"</span><span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>account
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">cond</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">string-match</span> <span class="org-string">"dehaeze.thomas@gmail.com"</span> from<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">"gmail"</span><span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">string-match</span> <span class="org-string">"thomas.dehaeze@esrf.fr"</span> from<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">"esrf"</span><span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">message-sendmail-extra-arguments</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-string">"-a"</span> account<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</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>
2021-01-03 22:52:53 +01:00
</pre>
</div>
</div>
</div>
2021-10-25 14:37:10 +02:00
<div id="outline-container-org195a677" class="outline-3">
<h3 id="org195a677">Basic Config</h3>
<div class="outline-text-3" id="text-org195a677">
2021-01-03 22:52:53 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> mu4e
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">mail-user-agent</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">mu4e-user-agent</span>
<span class="org-variable-name">mu4e-mu-binary</span> <span class="org-string">"/usr/bin/mu"</span>
mu4e-maildir <span class="org-string">"~/.mail"</span>
<span class="org-variable-name">mu4e-compose-format-flowed</span> t
<span class="org-variable-name">mu4e-compose-in-new-frame</span> nil
<span class="org-variable-name">mu4e-view-show-images</span> t
<span class="org-variable-name">mu4e-html2text-command</span> <span class="org-string">"w3m -dump -T text/html"</span>
<span class="org-variable-name">mu4e-use-fancy-chars</span> t
<span class="org-variable-name">mu4e-headers-include-related</span> t
<span class="org-variable-name">mu4e-attachment-dir</span> <span class="org-string">"~/Downloads"</span>
<span class="org-variable-name">message-kill-buffer-on-exit</span> t
<span class="org-variable-name">mu4e-compose-signature-auto-include</span> t
<span class="org-variable-name">mu4e-view-show-images</span> t
<span class="org-variable-name">mu4e-view-show-addresses</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org7c3d72b" class="outline-3">
<h3 id="org7c3d72b">Additional config</h3>
<div class="outline-text-3" id="text-org7c3d72b">
2020-05-26 08:40:15 +02:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> mu4e
<span class="org-builtin">:config</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use imagemagick, if available.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">fboundp</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">imagemagick-register-types</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">imagemagick-register-types</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Sometimes html email is just not readable in a text based client, this lets me open the</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">email in my browser.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">mu4e-view-actions</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"View in browser"</span> . mu4e-action-view-in-browser<span class="org-rainbow-delimiters-depth-3">)</span> t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Spell checking ftw.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">mu4e-compose-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">flyspell-mode</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use Helm to select mailboxes</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">mu4e-completing-read-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">completing-read</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Don't ask for a 'context' upon opening mu4e</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">mu4e-context-policy</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">pick-first</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Don't ask to quit... why is this the default?</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">mu4e-confirm-quit</span> nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-12 00:19:16 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org716f5e2" class="outline-3">
<h3 id="org716f5e2">Provide Information</h3>
<div class="outline-text-3" id="text-org716f5e2">
2020-01-12 00:19:16 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> mu4e
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> mu4e-user-mail-address-list <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"dehaeze.thomas@gmail.com"</span> <span class="org-string">"thomas.dehaeze@esrf.fr"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-variable-name">mu4e-compose-signature</span> <span class="org-string">"Thomas Dehaeze\n"</span>
<span class="org-variable-name">user-mail-address</span> <span class="org-string">"dehaeze.thomas@gmail.com"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Default Folders</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">mu4e-sent-folder</span> <span class="org-string">"/gmail/Sent"</span>
<span class="org-variable-name">mu4e-drafts-folder</span> <span class="org-string">"/gmail/Drafts"</span>
<span class="org-variable-name">mu4e-trash-folder</span> <span class="org-string">"/gmail/Trash"</span>
<span class="org-variable-name">mu4e-refile-folder</span> <span class="org-string">"/gmail/Archive"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-12 00:19:16 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org48a7840" class="outline-3">
<h3 id="org48a7840">Receiving emails using mbsync</h3>
<div class="outline-text-3" id="text-org48a7840">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> mu4e
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">mu4e-get-mail-command</span> <span class="org-string">"checkmail"</span>
<span class="org-variable-name">mu4e-update-interval</span> nil
<span class="org-variable-name">mu4e-change-filenames-when-moving</span> t<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">Fix for mbsync</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org6a9fd0f" class="outline-3">
<h3 id="org6a9fd0f">Contexts</h3>
<div class="outline-text-3" id="text-org6a9fd0f">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> mu4e
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">mu4e-contexts</span>
2021-10-25 14:37:10 +02:00
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-3">(</span> ,<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">make-mu4e-context</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:name</span> <span class="org-string">"gmail"</span>
2021-10-25 14:37:10 +02:00
<span class="org-builtin">:enter-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">mu4e-message</span> <span class="org-string">"Switch to the gmail context"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:match-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">(</span>msg<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> msg
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">string-prefix-p</span> <span class="org-string">"/gmail"</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">mu4e-message-field</span> msg <span class="org-builtin">:maildir</span><span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-builtin">:leave-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">mu4e-clear-caches</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:vars</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">user-mail-address</span> . <span class="org-string">"dehaeze.thomas@gmail.com"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">user-full-name</span> . <span class="org-string">"Thomas Dehaeze"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">mu4e-sent-folder</span> . <span class="org-string">"/gmail/Sent"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">mu4e-trash-folder</span> . <span class="org-string">"/gmail/Trash"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">mu4e-drafts-folder</span> . <span class="org-string">"/gmail/Drafts"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">mu4e-refile-folder</span> . <span class="org-string">"/gmail/Archive"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">mu4e-compose-signature</span> . <span class="org-string">"Thomas Dehaeze\n"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
,<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">make-mu4e-context</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:name</span> <span class="org-string">"esrf"</span>
2021-10-25 14:37:10 +02:00
<span class="org-builtin">:enter-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">mu4e-message</span> <span class="org-string">"Switch to the esrf context"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:match-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">(</span>msg<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> msg
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">string-prefix-p</span> <span class="org-string">"/esrf"</span> <span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">mu4e-message-field</span> msg <span class="org-builtin">:maildir</span><span class="org-rainbow-delimiters-depth-4">)</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>
<span class="org-builtin">:leave-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">mu4e-clear-caches</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:vars</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">user-mail-address</span> . <span class="org-string">"thomas.dehaeze@esrf.fr"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">user-full-name</span> . <span class="org-string">"Thomas Dehaeze"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">mu4e-sent-folder</span> . <span class="org-string">"/esrf/Sent"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">mu4e-trash-folder</span> . <span class="org-string">"/esrf/Trash"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">mu4e-drafts-folder</span> . <span class="org-string">"/esrf/Drafts"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">mu4e-refile-folder</span> . <span class="org-string">"/esrf/Archive"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">mu4e-compose-signature</span> . <span class="org-string">"Thomas Dehaeze\n"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-4">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org6833676" class="outline-3">
<h3 id="org6833676">Sending mails</h3>
<div class="outline-text-3" id="text-org6833676">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> mu4e
<span class="org-builtin">:config</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">message-send-mail-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">message-send-mail-with-sendmail</span>
<span class="org-variable-name">sendmail-program</span> <span class="org-string">"/usr/bin/msmtp"</span>
<span class="org-variable-name">user-full-name</span> <span class="org-string">"Thomas Dehaeze"</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">This prevents saving the email to the Sent folder since gmail will do this for us on their end.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">mu4e-sent-messages-behavior</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">delete</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use the correct account context when sending mail based on the from header.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">message-sendmail-envelope-from</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">header</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">message-send-mail-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">choose-msmtp-account</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org0b1e63d" class="outline-3">
<h3 id="org0b1e63d">Bookmarks</h3>
<div class="outline-text-3" id="text-org0b1e63d">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> mu4e
<span class="org-builtin">:config</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">mu4e-bookmarks</span> <span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-3">(</span>,<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-function-name">make-mu4e-bookmark</span>
2021-01-08 01:34:53 +01:00
<span class="org-builtin">:name</span> <span class="org-string">"All Inboxes"</span>
<span class="org-builtin">:query</span> <span class="org-string">"maildir:/gmail/Inbox OR maildir:/esrf/Inbox"</span>
2021-10-25 14:37:10 +02:00
<span class="org-builtin">:key</span> ?i<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"flag:unread"</span> <span class="org-string">"Unread messages"</span> ?u<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"date:today..now"</span> <span class="org-string">"Today's messages"</span> ?t<span class="org-rainbow-delimiters-depth-4">)</span>
<span class="org-rainbow-delimiters-depth-4">(</span><span class="org-string">"date:7d..now"</span> <span class="org-string">"Last 7 days"</span> ?w<span class="org-rainbow-delimiters-depth-4">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org40d8b3b" class="outline-2">
<h2 id="org40d8b3b">Doom <code>init.el</code></h2>
<div class="outline-text-2" id="text-org40d8b3b">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">when</span> <span class="org-variable-name">noninteractive</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">after!</span> undo-tree
<span class="org-rainbow-delimiters-depth-3">(</span>global-undo-tree-mode <span class="org-highlight-numbers-number">-1</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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">doom!</span> <span class="org-builtin">:completion</span>
company <span class="org-comment-delimiter">; </span><span class="org-comment">the ultimate code completion backend</span>
helm <span class="org-comment-delimiter">; </span><span class="org-comment">the *other* search engine for love and life</span>
ivy <span class="org-comment-delimiter">; </span><span class="org-comment">a search engine for love and life</span>
<span class="org-builtin">:ui</span>
doom <span class="org-comment-delimiter">; </span><span class="org-comment">what makes DOOM look the way it does</span>
deft
2021-10-25 14:37:10 +02:00
hl-todo <span class="org-comment-delimiter">; </span><span class="org-comment">highlight </span><span class="org-comment"><span class="org-bold"><span class="org-warning">TODO</span></span></span><span class="org-comment">/</span><span class="org-comment"><span class="org-bold"><span class="org-error">FIXME</span></span></span><span class="org-comment">/</span><span class="org-comment"><span class="org-bold"><span class="org-success">NOTE</span></span></span><span class="org-comment">/</span><span class="org-comment"><span class="org-bold"><span class="org-doc">DEPRECATED</span></span></span><span class="org-comment">/</span><span class="org-comment"><span class="org-bold"><span class="org-constant">HACK</span></span></span><span class="org-comment">/</span><span class="org-comment"><span class="org-bold"><span class="org-keyword">REVIEW</span></span></span>
2021-01-08 01:34:53 +01:00
hydra
modeline
ophints <span class="org-comment-delimiter">; </span><span class="org-comment">highlight the region an operation acts on</span>
<span class="org-rainbow-delimiters-depth-2">(</span>popup <span class="org-comment-delimiter">; </span><span class="org-comment">tame sudden yet inevitable temporary windows</span>
+all <span class="org-comment-delimiter">; </span><span class="org-comment">catch all popups that start with an asterix</span>
+defaults<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">default popup rules</span>
unicode <span class="org-comment-delimiter">; </span><span class="org-comment">extended unicode support for various languages</span>
vc-gutter <span class="org-comment-delimiter">; </span><span class="org-comment">vcs diff in the fringe</span>
vi-tilde-fringe <span class="org-comment-delimiter">; </span><span class="org-comment">fringe tildes to mark beyond EOB</span>
workspaces <span class="org-comment-delimiter">; </span><span class="org-comment">tab emulation, persistence &amp; separate workspaces</span>
<span class="org-rainbow-delimiters-depth-2">(</span>emoji +unicode<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:editor</span>
<span class="org-rainbow-delimiters-depth-2">(</span>evil +everywhere<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-comment-delimiter">; </span><span class="org-comment">come to the dark side, we have cookies</span>
fold <span class="org-comment-delimiter">; </span><span class="org-comment">(nigh) universal code folding</span>
rotate-text <span class="org-comment-delimiter">; </span><span class="org-comment">cycle region at point between text candidates</span>
snippets <span class="org-comment-delimiter">; </span><span class="org-comment">my elves. They type so I don't have to</span>
<span class="org-variable-name">word-wrap</span> <span class="org-comment-delimiter">; </span><span class="org-comment">soft wrapping with language-aware indent</span>
<span class="org-builtin">:emacs</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">dired</span> +icons<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">making dired pretty [functional]</span>
electric <span class="org-comment-delimiter">; </span><span class="org-comment">smarter, keyword-based electric-indent</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">ibuffer</span> +icons<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">interactive buffer management</span>
vc <span class="org-comment-delimiter">; </span><span class="org-comment">version-control and Emacs, sitting in a tree</span>
undo
<span class="org-builtin">:term</span>
eshell <span class="org-comment-delimiter">; </span><span class="org-comment">a consistent, cross-platform shell (WIP)</span>
vterm
<span class="org-builtin">:tools</span>
<span class="org-variable-name">debugger</span> <span class="org-comment-delimiter">; </span><span class="org-comment">Stepping through code, to help you add bugs</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">eval</span> +overlay<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">run code, run (also, repls)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>lookup <span class="org-comment-delimiter">; </span><span class="org-comment">helps you navigate your code and documentation</span>
+docsets<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">...or in Dash docsets locally</span>
lsp
magit <span class="org-comment-delimiter">; </span><span class="org-comment">a git porcelain for Emacs</span>
docker
<span class="org-comment-delimiter">;;</span><span class="org-comment">pass ; password manager for nerds</span>
pdf <span class="org-comment-delimiter">; </span><span class="org-comment">pdf enhancements</span>
eval
biblio
<span class="org-rainbow-delimiters-depth-2">(</span>lookup +dictionary<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:checkers</span>
syntax <span class="org-comment-delimiter">; </span><span class="org-comment">tasing you for every semicolon you forget</span>
<span class="org-rainbow-delimiters-depth-2">(</span>spell +aspell<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">tasing you for misspelling mispelling</span>
<span class="org-builtin">:lang</span>
data <span class="org-comment-delimiter">; </span><span class="org-comment">config/data formats</span>
emacs-lisp <span class="org-comment-delimiter">; </span><span class="org-comment">drown in parentheses</span>
go
<span class="org-rainbow-delimiters-depth-2">(</span>javascript
+lsp<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>latex
2021-05-02 11:27:39 +02:00
+latexmk<span class="org-rainbow-delimiters-depth-2">)</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">markdown ; writing docs for people to ignore</span>
<span class="org-rainbow-delimiters-depth-2">(</span>org <span class="org-comment-delimiter">; </span><span class="org-comment">organize your plain life in plain text</span>
+dragndrop <span class="org-comment-delimiter">; </span><span class="org-comment">drag &amp; drop files/images into org buffers</span>
+hugo <span class="org-comment-delimiter">; </span><span class="org-comment">use Emacs for hugo blogging</span>
2021-10-25 14:37:10 +02:00
+roam2 <span class="org-comment-delimiter">;</span>
2021-01-08 01:34:53 +01:00
+gnuplot
+present<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">using org-mode for presentations</span>
python <span class="org-comment-delimiter">; </span><span class="org-comment">beautiful is better than ugly</span>
<span class="org-rainbow-delimiters-depth-2">(</span>sh <span class="org-comment-delimiter">; </span><span class="org-comment">she sells {ba,z,fi}sh shells on the C xor</span>
+lsp<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>web
+lsp<span class="org-rainbow-delimiters-depth-2">)</span>
yaml
<span class="org-builtin">:email</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">mu4e</span> +gmail<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:app</span>
2021-10-25 14:37:10 +02:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">calendar</span>
2021-01-08 01:34:53 +01:00
<span class="org-comment-delimiter">;;</span><span class="org-comment">(rss +org) ; emacs as an RSS reader</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">write ; emacs for writers (fiction, notes, papers, etc.)</span>
<span class="org-builtin">:config</span>
literate
<span class="org-rainbow-delimiters-depth-2">(</span>default +bindings<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2021-01-01 20:12:34 +01:00
<div id="outline-container-org287a149" class="outline-2">
<h2 id="org287a149">Doom <code>packages.el</code></h2>
<div class="outline-text-2" id="text-org287a149">
2021-04-25 19:10:57 +02:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-xournalpp
<span class="org-builtin">:recipe</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:host</span> gitlab
<span class="org-builtin">:repo</span> <span class="org-string">"vherrmann/org-xournalpp"</span>
<span class="org-builtin">:files</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"resources"</span> <span class="org-string">"*.el"</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>
2021-10-25 14:37:10 +02:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-transclusion
<span class="org-builtin">:recipe</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:host</span> github
<span class="org-builtin">:repo</span> <span class="org-string">"nobiot/org-transclusion"</span>
<span class="org-builtin">:branch</span> <span class="org-string">"main"</span>
<span class="org-builtin">:files</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"*.el"</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>
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Vimrc</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> vimrc-mode<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
2021-04-25 19:10:57 +02:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-media-note
<span class="org-builtin">:recipe</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:host</span> github <span class="org-builtin">:repo</span> <span class="org-string">"yuchen-lea/org-media-note"</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-keyword">package!</span> mpv<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> pretty-hydra<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
2021-01-01 20:12:34 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Automatic toggling of LaTeX fragments</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-fragtog<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">custom blocks and links for org-mode</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-special-block-extras<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Nice theme</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> poet-theme<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Import file to Org-mode</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-pandoc-import
<span class="org-builtin">:recipe</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:host</span> github
<span class="org-builtin">:repo</span> <span class="org-string">"tecosaur/org-pandoc-import"</span>
<span class="org-builtin">:files</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"*.el"</span> <span class="org-string">"filters"</span> <span class="org-string">"preprocessors"</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>
2021-01-01 20:12:34 +01:00
</pre>
</div>
2020-11-03 16:27:09 +01:00
2021-01-01 20:12:34 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Renders Org-mode citations in CSL styles</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> citeproc-org<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
2021-02-10 18:02:02 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Connector between Org-roam, BibTeX-completion, and Org-ref</span>
2021-10-25 14:37:10 +02:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-roam-bibtex
<span class="org-builtin">:recipe</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:host</span> github <span class="org-builtin">:repo</span> <span class="org-string">"org-roam/org-roam-bibtex"</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-keyword">unpin!</span> org-roam company-org-roam<span class="org-rainbow-delimiters-depth-1">)</span>
2021-02-10 18:02:02 +01:00
</pre>
</div>
2021-01-01 20:12:34 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Org-mode modules for citations, cross-references, bibliographies</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-ref<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Alert notifications for org-agenda</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-wild-notifier<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Turn table into subfigure</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> ox-latex-subfigure
<span class="org-builtin">:recipe</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:host</span> github <span class="org-builtin">:repo</span> <span class="org-string">"linktohack/ox-latex-subfigure"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Major Mode for Matlab</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> matlab-mode
<span class="org-builtin">:recipe</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:host</span> github <span class="org-builtin">:repo</span> <span class="org-string">"matlab-mode/mirror"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Org-mode query language</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-ql<span class="org-rainbow-delimiters-depth-1">)</span>
2021-02-10 18:02:02 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> helm-org-ql<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Display Org Mode priorities as custom strings</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-fancy-priorities<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Web Server</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> web-server<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2021-01-01 20:12:34 +01:00
<div class="org-src-container">
2021-01-08 01:34:53 +01:00
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Don't use this default package in Doom</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> evil-escape <span class="org-builtin">:disable</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
2021-01-01 20:12:34 +01:00
</pre>
</div>
2021-02-10 18:02:02 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Nice gantt charts</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> ob-mermaid<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
2020-01-11 22:04:45 +01:00
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
2021-10-25 14:37:10 +02:00
<p class="date">Created: 2021-10-25 lun. 14:33</p>
2020-01-11 22:04:45 +01:00
</div>
</body>
</html>