literate-dotfiles/docs/doom.html

4341 lines
530 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>
2020-11-03 16:27:09 +01:00
<!-- 2020-11-03 mar. 16:26 -->
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="generator" content="Org mode" />
<meta name="author" content="Dehaeze Thomas" />
2020-01-12 00:19:16 +01:00
<link rel="stylesheet" type="text/css" href="./css/htmlize.css"/>
<link rel="stylesheet" type="text/css" href="./css/readtheorg.css"/>
<script type="text/javascript" src="./js/jquery.min.js"></script>
<script type="text/javascript" src="./js/bootstrap.min.js"></script>
<script type="text/javascript" src="./js/jquery.stickytableheaders.min.js"></script>
<script type="text/javascript" src="./js/readtheorg.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>
</div><div id="content">
2020-01-11 22:04:45 +01:00
<h1 class="title">Doom Emacs Configuration</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
2020-05-26 08:40:15 +02:00
<li><a href="#org1e5264a">Useful Bindings</a>
<ul>
<li><a href="#orgbca83fb">General Bindings</a></li>
<li><a href="#orgbb83b0a">Org-Babel Bindings</a></li>
<li><a href="#org7ac1104">Evil bindings</a></li>
</ul>
</li>
<li><a href="#orge548d2c">Basic Configuration</a>
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#orgd49c2db">Personal Information</a></li>
<li><a href="#orgcf3b44c">Doom Config</a></li>
<li><a href="#orga2ab779">Evil</a></li>
2020-03-01 22:51:16 +01:00
<li><a href="#org10e9de4">Which Key</a></li>
2020-01-12 00:19:16 +01:00
<li><a href="#org0272904">Visual</a></li>
2020-11-03 16:27:09 +01:00
<li><a href="#org8aff7a7">Useful General Functions</a></li>
2020-01-12 00:19:16 +01:00
<li><a href="#orgfa0f4d4">Change default alert backend</a></li>
<li><a href="#orgab0c401">Lockfiles</a></li>
2020-01-28 21:32:38 +01:00
<li><a href="#org343ab5d">Disable highlight of current line</a></li>
2020-03-22 23:04:07 +01:00
<li><a href="#org8fb9aef">Remap <code>jump-forward</code> key binding</a></li>
2020-05-26 08:40:15 +02:00
<li><a href="#orgc047155">Magit</a></li>
<li><a href="#org5891449">Dired</a></li>
<li><a href="#orgd5fd766">PDF-Tools</a></li>
<li><a href="#org3ef34ce">Yassnippets</a></li>
<li><a href="#orgdf363e3">Ox-Hugo</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-05-26 08:40:15 +02:00
<li><a href="#orgda82ce0">Org Mode</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#orge682476">Org General Config</a></li>
2020-03-19 10:42:30 +01:00
<li><a href="#org4479f13">Org Inline Images</a></li>
2020-01-12 00:19:16 +01:00
<li><a href="#org8afc2de">Org Links</a></li>
<li><a href="#orgcd26239">Org Tagging</a></li>
<li><a href="#org65d0f06">Org Refile</a></li>
<li><a href="#org25ed4f3">Org TODO</a></li>
2020-05-26 08:40:15 +02:00
<li><a href="#orga7b5140">Org Archive</a></li>
<li><a href="#orga36def8">Org Agenda</a></li>
2020-03-01 22:51:16 +01:00
<li><a href="#org0b832f0">Org Fancy Priority</a></li>
2020-01-12 00:19:16 +01:00
<li><a href="#orgb9fc96d">Org Notification based on calendar event</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#org1199365">appt-notification script</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#org3c5e1f3">Org Structure Template</a></li>
<li><a href="#org9713b96">Org Capture</a></li>
2020-05-26 08:40:15 +02:00
<li><a href="#org839d7a9">Org Export</a></li>
2020-03-22 23:04:07 +01:00
<li><a href="#org253b1f3">HTML Export</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-05-26 08:40:15 +02:00
<li><a href="#orge413ce2">HTML Defaults</a></li>
2020-01-12 00:19:16 +01:00
<li><a href="#orgfe81dca">MathJax</a></li>
2020-05-26 08:40:15 +02:00
<li><a href="#orgbaa8390">Ensuring useful HTML Anchors</a></li>
<li><a href="#orged04965">Folded Drawers</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#org1a43ae2">Org LaTeX</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-03-22 23:04:07 +01:00
<li><a href="#org3a04c02">LaTeX Fragments</a></li>
2020-01-12 00:19:16 +01:00
<li><a href="#orgaa26736">LaTeX Classes</a></li>
2020-05-26 08:40:15 +02:00
<li><a href="#org3480957">Ox Latex Subfigure package</a></li>
<li><a href="#org44cf309">Clear page before heading</a></li>
2020-03-01 22:51:16 +01:00
<li><a href="#org3b03fac">Default added packages</a></li>
<li><a href="#org3b79603">Some configurations</a></li>
2020-01-12 00:19:16 +01:00
<li><a href="#orgce10c33">Beamer</a></li>
2020-05-26 08:40:15 +02:00
<li><a href="#org7d55947">Custom Export - Add Page and Label for LaTeX export</a></li>
2020-01-12 00:19:16 +01:00
<li><a href="#org9d2764e">Number Equations</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-03-19 10:42:30 +01:00
<li><a href="#org5236d09">LaTeX macro both for LaTeX and HTML export</a></li>
2020-03-01 23:04:12 +01:00
<li><a href="#org51ce4d3">Org Projects</a></li>
2020-05-26 08:40:15 +02:00
<li><a href="#orgf5cfaee">Org big org-project</a></li>
2020-01-12 00:19:16 +01:00
<li><a href="#org0a79d9f">Automatically run <code>startblock</code> when opening org-mode files</a></li>
2020-05-26 08:40:15 +02:00
<li><a href="#orga1fc443">Insert ScreenShot or Picture from Phone</a></li>
<li><a href="#org7902aff">Render Tables</a></li>
2020-01-12 00:19:16 +01:00
<li><a href="#org66f0a8a">Org Gcal</a></li>
2020-11-03 16:27:09 +01:00
<li><a href="#org5970686">Citeproc-Org</a></li>
<li><a href="#org06259a5">Org Wild Notifier</a></li>
<li><a href="#orgaa7cec6">Orch</a></li>
2020-05-26 08:40:15 +02:00
<li><a href="#orgafe7963">Custom Keybindings - <code>,</code> leader key and <code>C-c</code></a>
2020-03-22 23:04:07 +01:00
<ul>
<li><a href="#orgdc0a145">Insert Elements <code>,i</code></a></li>
<li><a href="#orgc62ba13">LaTeX <code>,l</code></a></li>
<li><a href="#org0b5774e">Org LaTeX Automatic fragment</a></li>
2020-05-26 08:40:15 +02:00
<li><a href="#orgee735c5">Bibtex <code>,r</code></a></li>
2020-03-22 23:04:07 +01:00
<li><a href="#org87d89c4">Open ranger in current directory <code>,o</code></a></li>
<li><a href="#orgb7c8cca">View in External programs <code>,v</code></a></li>
</ul>
</li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#org38a8163">Org Babel</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#org97bf4fc">Main configuration</a></li>
2020-03-01 22:51:16 +01:00
<li><a href="#org741956d">Appearance of source blocks</a></li>
2020-03-22 23:04:07 +01:00
<li><a href="#org737e623">Indentation</a></li>
2020-01-12 00:19:16 +01:00
<li><a href="#orgee4e789">Library of Babel</a></li>
<li><a href="#org232fea8">Org-Babel Matlab</a></li>
2020-03-22 23:04:07 +01:00
<li><a href="#org80ca3ef">Some functions for using Matlab with Org Babel <code>,m</code></a></li>
<li><a href="#org71fa917">Remap <code>ctrl-ret</code> used to execute the src block and go to the next one</a></li>
<li><a href="#org4b37ab8">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>
2020-03-22 23:04:07 +01:00
<li><a href="#orgb05f319"><code>tdh-org-babel-execute-matlab-background</code></a></li>
<li><a href="#orgf77f938"><code>tdh-matlab-execute-selected</code></a></li>
<li><a href="#orgc5f1a86">Remap <code>ctrl-shift-ref</code></a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-05-26 08:40:15 +02:00
<li><a href="#org354b3a0">Align Source Blocks</a></li>
2020-03-22 23:04:07 +01:00
<li><a href="#org5783483">Helping Functions - Tangling <code>,b</code></a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-05-26 08:40:15 +02:00
<li><a href="#orgbf4c78e">Bibliography Management</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-05-26 08:40:15 +02:00
<li><a href="#orgd6dd52d">Org Ref (link)</a></li>
<li><a href="#orgd5277ba">Org Noter (link)</a></li>
<li><a href="#org11a3a48">Org Roam (link)</a></li>
<li><a href="#org18473f5">Helm-Bibtex (link)</a></li>
<li><a href="#orgd601e31">Deft</a></li>
<li><a href="#org910a943">Org-Roam-Bibtex (link)</a></li>
2020-11-03 16:27:09 +01:00
<li><a href="#orgf447528">Citeproc-org (link)</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-05-26 08:40:15 +02:00
<li><a href="#org5bc2aea">LaTeX</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-05-26 08:40:15 +02:00
<li><a href="#org0822b20">Master file</a></li>
<li><a href="#org944a888">Clean Output Files</a></li>
<li><a href="#orga4ad7f6">PDF Viewer</a></li>
<li><a href="#org120de8b">Bibtex</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-05-26 08:40:15 +02:00
<li><a href="#orgd94d627">Matlab</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#orgb915baf">Setup Matlab Mode</a></li>
2020-05-26 08:40:15 +02:00
<li><a href="#orga36d033">Setup Flycheck to work with <code>mlint</code></a></li>
2020-03-01 22:51:16 +01:00
<li><a href="#org04bf41d">Completion in the Matlab Shell</a></li>
2020-05-26 08:40:15 +02:00
<li><a href="#orgace4163">Beautify code</a></li>
2020-01-12 00:19:16 +01:00
<li><a href="#orgb85ca7e">Key Bindings</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-05-26 08:40:15 +02:00
<li><a href="#org7d36b5d">Mu4e</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-05-26 08:40:15 +02:00
<li><a href="#org0022939">Resources</a></li>
<li><a href="#orgdf9660c">Cheatsheet</a></li>
<li><a href="#org998a101">Helping function</a></li>
<li><a href="#orge7dad22">Basic Config</a></li>
<li><a href="#org5886531">Additional config</a></li>
<li><a href="#orgbc87a17">Provide Information</a></li>
<li><a href="#org4f572af">Receiving emails using mbsync</a></li>
<li><a href="#orgd7ab730">Contexts</a></li>
<li><a href="#org0f5f14d">Sending mails</a></li>
2020-01-12 00:19:16 +01:00
<li><a href="#orgeb454c4">Bookmarks</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-03-19 10:42:30 +01:00
<li><a href="#org0b90463">Doom <code>init.el</code></a></li>
2020-01-12 00:19:16 +01:00
<li><a href="#org973006b">Doom <code>packages.el</code></a></li>
2020-01-11 22:04:45 +01:00
</ul>
</div>
</div>
<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>
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>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org1e5264a" class="outline-2">
<h2 id="org1e5264a">Useful Bindings</h2>
<div class="outline-text-2" id="text-org1e5264a">
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
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgbca83fb" class="outline-3">
<h3 id="orgbca83fb">General Bindings</h3>
<div class="outline-text-3" id="text-orgbca83fb">
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
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgbb83b0a" class="outline-3">
<h3 id="orgbb83b0a">Org-Babel Bindings</h3>
<div class="outline-text-3" id="text-orgbb83b0a">
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>
</div>
</div>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org7ac1104" class="outline-3">
<h3 id="org7ac1104">Evil bindings</h3>
<div class="outline-text-3" id="text-org7ac1104">
<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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orge548d2c" class="outline-2">
<h2 id="orge548d2c">Basic Configuration</h2>
<div class="outline-text-2" id="text-orge548d2c">
</div>
<div id="outline-container-orgd49c2db" class="outline-3">
<h3 id="orgd49c2db">Personal Information</h3>
<div class="outline-text-3" id="text-orgd49c2db">
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
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgcf3b44c" class="outline-3">
<h3 id="orgcf3b44c">Doom Config</h3>
<div class="outline-text-3" id="text-orgcf3b44c">
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">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">
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">setq</span> <span class="org-variable-name">doom-theme</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">doom-gruvbox</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<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">setq</span> <span class="org-variable-name">display-line-numbers-type</span> t<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">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
2020-05-26 08:40:15 +02:00
<div id="outline-container-orga2ab779" class="outline-3">
<h3 id="orga2ab779">Evil</h3>
<div class="outline-text-3" id="text-orga2ab779">
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> evil
<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-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">
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-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">
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">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>
</div>
</div>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org10e9de4" class="outline-3">
<h3 id="org10e9de4">Which Key</h3>
<div class="outline-text-3" id="text-org10e9de4">
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>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org0272904" class="outline-3">
<h3 id="org0272904">Visual</h3>
<div class="outline-text-3" id="text-org0272904">
2020-01-11 22:04:45 +01:00
<p>
Automatic line wrap.
</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-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">
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-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-comment-delimiter">;; </span><span class="org-comment">turn on auto-fill for text-mode</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">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>
</pre>
</div>
</div>
</div>
<div id="outline-container-org8aff7a7" class="outline-3">
<h3 id="org8aff7a7">Useful General Functions</h3>
<div class="outline-text-3" id="text-org8aff7a7">
<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-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>
<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>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgfa0f4d4" class="outline-3">
<h3 id="orgfa0f4d4">Change default alert backend</h3>
<div class="outline-text-3" id="text-orgfa0f4d4">
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">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>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgab0c401" class="outline-3">
<h3 id="orgab0c401">Lockfiles</h3>
<div class="outline-text-3" id="text-orgab0c401">
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">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
<div id="outline-container-org343ab5d" class="outline-3">
<h3 id="org343ab5d">Disable highlight of current line</h3>
<div class="outline-text-3" id="text-org343ab5d">
<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-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>
<span class="org-rainbow-delimiters-depth-3">(</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-variable-name">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-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-3">)</span>
<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
<div id="outline-container-org8fb9aef" class="outline-3">
<h3 id="org8fb9aef">Remap <code>jump-forward</code> key binding</h3>
<div class="outline-text-3" id="text-org8fb9aef">
<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">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>
<div id="outline-container-orgc047155" class="outline-3">
<h3 id="orgc047155">Magit</h3>
<div class="outline-text-3" id="text-orgc047155">
<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-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>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<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>
<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-1">(</span><span class="org-string">"~/Cloud/thesis/matlab/"</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-string">"~/Cloud/thesis/papers/"</span> . <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</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-1">(</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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</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-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:right-align</span> t<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:help-echo</span> <span class="org-string">"Upstream changes not in branch"</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-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-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:right-align</span> t<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:help-echo</span> <span class="org-string">"Local changes not in upstream"</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-string">"Path"</span> <span class="org-highlight-numbers-number">99</span> magit-repolist-column-path nil<span class="org-rainbow-delimiters-depth-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>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
<div id="outline-container-org5891449" class="outline-3">
<h3 id="org5891449">Dired</h3>
<div class="outline-text-3" id="text-org5891449">
<ul class="org-ul">
<li><code>C-c C-e</code> Writable Dired mode, when changes are done <code>C-c C-c</code>.
This works also with <code>C-x C-q</code></li>
<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>
<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">use-package!</span> dired-narrow
<span class="org-builtin">:config</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">dired-mode-map</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">dired-narrow-fuzzy</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>
<div id="outline-container-orgd5fd766" class="outline-3">
<h3 id="orgd5fd766">PDF-Tools</h3>
<div class="outline-text-3" id="text-orgd5fd766">
<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">use-package!</span> pdf-tools
<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">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-1">()</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">linum-mode</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-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>
2020-03-22 23:04:07 +01:00
</pre>
</div>
</div>
</div>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org3ef34ce" class="outline-3">
<h3 id="org3ef34ce">Yassnippets</h3>
<div class="outline-text-3" id="text-org3ef34ce">
<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">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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgdf363e3" class="outline-3">
<h3 id="orgdf363e3">Ox-Hugo</h3>
<div class="outline-text-3" id="text-orgdf363e3">
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-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>
<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-1">(</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-1">)</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
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">while</span> org-files
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> current-org-file <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">car</span> org-files<span class="org-rainbow-delimiters-depth-1">)</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">"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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> org-files <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cdr</span> org-files<span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-05-26 08:40:15 +02:00
</div>
2020-01-11 22:04:45 +01:00
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgda82ce0" class="outline-2">
<h2 id="orgda82ce0">Org Mode</h2>
<div class="outline-text-2" id="text-orgda82ce0">
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>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orge682476" class="outline-3">
<h3 id="orge682476">Org General Config</h3>
<div class="outline-text-3" id="text-orge682476">
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">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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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">
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> 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>
2020-03-19 10:42:30 +01:00
<div id="outline-container-org4479f13" class="outline-3">
<h3 id="org4479f13">Org Inline Images</h3>
<div class="outline-text-3" id="text-org4479f13">
<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">
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> 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>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org8afc2de" class="outline-3">
<h3 id="org8afc2de">Org Links</h3>
<div class="outline-text-3" id="text-org8afc2de">
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> 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>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"bib"</span> . <span class="org-string">"~/Cloud/brain/biblio/references.bib::%s"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"notes"</span> . <span class="org-string">"~/Cloud/brain/%s.org"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"papers"</span> . <span class="org-string">"~/Cloud/pdfs/%s.pdf"</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgcd26239" class="outline-3">
<h3 id="orgcd26239">Org Tagging</h3>
<div class="outline-text-3" id="text-orgcd26239">
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> 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>
<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-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"@home"</span> . ?h<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"@work"</span> . ?w<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"@christophe"</span> . ?c<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"@veijo"</span> . ?v<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org65d0f06" class="outline-3">
<h3 id="org65d0f06">Org Refile</h3>
<div class="outline-text-3" id="text-org65d0f06">
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> org
<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-1">(</span><span class="org-variable-name">org-agenda-files</span> . <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:maxlevel</span> . <span class="org-highlight-numbers-number">6</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org25ed4f3" class="outline-3">
<h3 id="org25ed4f3">Org TODO</h3>
<div class="outline-text-3" id="text-org25ed4f3">
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> 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>
<span class="org-rainbow-delimiters-depth-1">(</span>sequence <span class="org-string">"</span><span class="org-bold"><span class="org-warning">TODO</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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</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">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>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"</span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-string">"</span> . <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"EXER"</span> . <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"NEXT"</span> . <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"MAIL"</span> . <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"READ"</span> . <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"ANSW"</span> . <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">aqua</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"DONE"</span> . <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">aqua</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"WAIT"</span> . <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">orange</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"QUES"</span> . <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">yellow</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"CANC"</span> . <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">grey</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"SDAY"</span> . <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">green</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"BKMK"</span> . <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">green</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"IDEA"</span> . <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">green</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"EXAM"</span> . <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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>
<span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
<div id="outline-container-orga7b5140" class="outline-3">
<h3 id="orga7b5140">Org Archive</h3>
<div class="outline-text-3" id="text-orga7b5140">
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">
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> 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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>fix-archive-p <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">not</span> <span class="org-variable-name">current-prefix-arg</span><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-function-name">use-region-p</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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>location <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-archive--compute-location</span> <span class="org-variable-name">org-archive-location</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>afile <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">car</span> location<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>offset <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">=</span> <span class="org-highlight-numbers-number">0</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">length</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">cdr</span> location<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-numbers-number">1</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">1+</span> <span class="org-rainbow-delimiters-depth-2">(</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-3">(</span><span class="org-constant">cdr</span> location<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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>buffer <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">or</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">find-buffer-visiting</span> afile<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">find-file-noselect</span> afile<span class="org-rainbow-delimiters-depth-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>
2020-03-01 22:51:16 +01:00
ad-do-it
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">when</span> fix-archive-p
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">with-current-buffer</span> buffer
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">&gt;</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-current-level</span><span class="org-rainbow-delimiters-depth-2">)</span> offset<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-up-heading-safe</span><span class="org-rainbow-delimiters-depth-1">)</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-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>olpath <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-entry-get</span> <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-string">"ARCHIVE_OLPATH"</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>path <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> olpath <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">split-string</span> olpath <span class="org-string">"/"</span><span class="org-rainbow-delimiters-depth-1">)</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>level offset<span class="org-rainbow-delimiters-depth-2">)</span>
tree-text<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">when</span> olpath
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-mark-subtree</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> tree-text <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">buffer-substring</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">region-beginning</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">region-end</span><span class="org-rainbow-delimiters-depth-1">)</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-variable-name">this-command</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-cut-subtree</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">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">save-restriction</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-3">(</span><span class="org-function-name">-each</span> path
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">(</span>heading<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-constant">re-search-forward</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">rx-to-string</span>
<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-3">)</span></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-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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</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>
<span class="org-string">" "</span>
2020-03-01 22:51:16 +01:00
heading
2020-11-03 16:27:09 +01:00
<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-2">(</span><span class="org-keyword">cl-incf</span> level<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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-3">(</span><span class="org-function-name">org-end-of-subtree</span> t t<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-paste-subtree</span> level tree-text<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orga36def8" class="outline-3">
<h3 id="orga36def8">Org Agenda</h3>
<div class="outline-text-3" id="text-orga36def8">
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">
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> 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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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> t<span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Set colours for priorities</span>
<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-1">(</span>?A . <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#FB4934"</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>?B . <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#FABD2F"</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>?C . <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#98971A"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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
2020-11-03 16:27:09 +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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-prefix-format</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>agenda . <span class="org-string">" %?-12t% s"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>todo . <span class="org-string">""</span><span class="org-rainbow-delimiters-depth-1">)</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-1">(</span>tags . <span class="org-string">" %-12:c"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">search</span> . <span class="org-string">" %-12:c"</span><span class="org-rainbow-delimiters-depth-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>
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">
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> 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>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"w"</span> <span class="org-string">"Work"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>tags <span class="org-string">"@work"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"</span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>priority <span class="org-string">"A"</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>org-ql-block-header <span class="org-string">"Important TODOs"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>tags <span class="org-string">"@work"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"</span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>priority <span class="org-string">"B"</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>org-ql-block-header <span class="org-string">"TODOs"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>tags <span class="org-string">"@work"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"</span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>priority <span class="org-string">"C"</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>org-ql-block-header <span class="org-string">"Not important TODOs"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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-string">"h"</span> <span class="org-string">"Home"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>tags <span class="org-string">"@home"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"</span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>priority <span class="org-string">"A"</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>org-ql-block-header <span class="org-string">"Things to do"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>tags <span class="org-string">"@home"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"</span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>priority <span class="org-string">"B"</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>org-ql-block-header <span class="org-string">"Things to do"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>tags <span class="org-string">"@home"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"</span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>priority <span class="org-string">"C"</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>org-ql-block-header <span class="org-string">"Things to do"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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-string">"q"</span> <span class="org-string">"Questions to ask"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"QUES"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>tags <span class="org-string">"@christophe"</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>org-ql-block-header <span class="org-string">"Questions to Christophe"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"QUES"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>tags <span class="org-string">"@veijo"</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>org-ql-block-header <span class="org-string">"Questions to Veijo"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"QUES"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-3">(</span>tags <span class="org-string">"@veijo"</span> <span class="org-string">"@christophe"</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>org-ql-block-header <span class="org-string">"Other Questions"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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-string">"R"</span> <span class="org-string">"Already read Articles and Books"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"DONE"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>level <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</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-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>org-ql-block-header <span class="org-string">"Articles"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"DONE"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>level <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>tags <span class="org-string">"book"</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>org-ql-block-header <span class="org-string">"Books"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"DONE"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>level <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>tags <span class="org-string">"phdthesis"</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>org-ql-block-header <span class="org-string">"Phd Thesis"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"DONE"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>level <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">not</span> <span class="org-rainbow-delimiters-depth-3">(</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-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>org-ql-block-header <span class="org-string">"Other Things"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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-variable-name">org-agenda-files</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"~/Cloud/brain/"</span><span class="org-rainbow-delimiters-depth-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-string">"r"</span> <span class="org-string">"Articles and Books to read"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"READ"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>level <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</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-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>org-ql-block-header <span class="org-string">"Article to Read"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"READ"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>level <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>tags <span class="org-string">"book"</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>org-ql-block-header <span class="org-string">"Books to Read"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"READ"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>level <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>tags <span class="org-string">"phdthesis"</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>org-ql-block-header <span class="org-string">"Phd Thesis to Read"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-ql-block</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"READ"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>level <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">not</span> <span class="org-rainbow-delimiters-depth-3">(</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-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>org-ql-block-header <span class="org-string">"Other Things to Read"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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-variable-name">org-agenda-files</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"~/Cloud/brain/"</span><span class="org-rainbow-delimiters-depth-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-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>
2020-03-01 22:51:16 +01:00
<div id="outline-container-org0b832f0" class="outline-3">
<h3 id="org0b832f0">Org Fancy Priority</h3>
<div class="outline-text-3" id="text-org0b832f0">
<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">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>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgb9fc96d" class="outline-3">
<h3 id="orgb9fc96d">Org Notification based on calendar event</h3>
<div class="outline-text-3" id="text-orgb9fc96d">
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">
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> org-agenda
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> appt-message-warning-time <span class="org-highlight-numbers-number">5</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-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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> appt-time-msg-list nil<span class="org-rainbow-delimiters-depth-3">)</span>
<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>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +01:00
<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>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> appt-disp-window-function <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> appt-delete-window-function <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">()</span> t<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +01: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-1">(</span><span class="org-function-name">getenv</span> <span class="org-string">"HOME"</span><span class="org-rainbow-delimiters-depth-1">)</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>
<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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">atom</span> min-to-app<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 min-to-app msg<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">dolist</span> <span class="org-rainbow-delimiters-depth-2">(</span>i <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">number-sequence</span> <span class="org-highlight-numbers-number">0</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">1-</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">length</span> min-to-app<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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">start-process</span> <span class="org-string">"tdh-appt-notification-app"</span> nil tdh-appt-notification-app <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">nth</span> i min-to-app<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">nth</span> i msg<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-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>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org1199365" class="outline-4">
<h4 id="org1199365">appt-notification script</h4>
<div class="outline-text-4" id="text-org1199365">
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-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
2020-11-03 16:27:09 +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>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org3c5e1f3" class="outline-3">
<h3 id="org3c5e1f3">Org Structure Template</h3>
<div class="outline-text-3" id="text-org3c5e1f3">
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> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-structure-template-alist</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"c"</span> . <span class="org-string">"center"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"C"</span> . <span class="org-string">"comment"</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-string">"src matlab\n"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"l"</span> . <span class="org-string">"src emacs-lisp\n"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"i"</span> . <span class="org-string">"important"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"e"</span> . <span class="org-string">"example"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"q"</span> . <span class="org-string">"quote"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"s"</span> . <span class="org-string">"src"</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org9713b96" class="outline-3">
<h3 id="org9713b96">Org Capture</h3>
<div class="outline-text-3" id="text-org9713b96">
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">
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> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-capture-templates</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">quote</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"t"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">key</span>
<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>
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">target</span>
<span class="org-string">"** </span><span class="org-bold"><span class="org-warning">TODO</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-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"M"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">key</span>
<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>
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">target</span>
<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>
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"m"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">key</span>
<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>
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">target</span>
<span class="org-string">"** </span><span class="org-bold"><span class="org-warning">TODO</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-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"r"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">key</span>
<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>
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">target</span>
<span class="org-string">"** </span><span class="org-bold"><span class="org-warning">TODO</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-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"pm"</span>
<span class="org-string">"Org-Protocol Mail"</span>
2020-05-26 08:40:15 +02:00
entry
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span>
<span class="org-string">"* MAIL %:description [[message:%:link][link]]\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n\n"</span>
<span class="org-builtin">:immediate-finish</span> t
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"pu"</span>
<span class="org-string">"Org-Protocol Url"</span>
2020-05-26 08:40:15 +02:00
entry
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span>
<span class="org-string">"* [[%:link][%:description]]\nCaptured On: %U\n\n"</span>
<span class="org-builtin">:immediate-finish</span> t
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"pt"</span>
<span class="org-string">"Org-Protocol text"</span>
2020-05-26 08:40:15 +02:00
entry
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span>
<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
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org839d7a9" class="outline-3">
<h3 id="org839d7a9">Org Export</h3>
<div class="outline-text-3" id="text-org839d7a9">
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">
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> 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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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">
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> 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">
2020-11-03 16:27:09 +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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org253b1f3" class="outline-3">
<h3 id="org253b1f3">HTML Export</h3>
<div class="outline-text-3" id="text-org253b1f3">
2020-01-11 22:04:45 +01:00
</div>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orge413ce2" class="outline-4">
<h4 id="orge413ce2">HTML Defaults</h4>
<div class="outline-text-4" id="text-orge413ce2">
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> org
<span class="org-comment-delimiter">;; </span><span class="org-comment">(setq org-html-head-extra (concat</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">"&lt;link rel='stylesheet' href='../css/htmlize.css'&gt;\n"</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">"&lt;link rel='stylesheet' href='../css/readtheorg.css'&gt;\n"</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">"&lt;link rel='stylesheet' href='../css/zenburn.css'&gt;\n"</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">"&lt;link rel='text/javascript' href='../js/bootstrap.min.js'&gt;\n"</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">"&lt;link rel='text/javascript' href='../js/jquery.min.js'&gt;\n"</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">"&lt;link rel='text/javascript' href='../js/jquery.stickytableheaders.min.js'&gt;\n"</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">"&lt;link rel='text/javascript' href='../js/readtheorg.js'&gt;\n"))</span>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">cleans up anything that would have been in there.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-head</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-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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgfe81dca" class="outline-4">
<h4 id="orgfe81dca">MathJax</h4>
<div class="outline-text-4" id="text-orgfe81dca">
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> 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;MathJax = {</span>
<span class="org-string"> tex: {</span>
<span class="org-string"> tags: 'ams',</span>
<span class="org-string"> macros: {bm: [\"\\\\boldsymbol{#1}\",1],}</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 type=\"text/javascript\" src=\"%PATH\"&gt;&lt;/script&gt;"</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-mathjax-options</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>path <span class="org-string">"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>scale <span class="org-string">"100"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">align</span> <span class="org-string">"center"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>font <span class="org-string">"TeX"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>linebreaks <span class="org-string">"false"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>autonumber <span class="org-string">"AMS"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>indent <span class="org-string">"0em"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>multlinewidth <span class="org-string">"85%"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>tagindent <span class="org-string">".8em"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>tagside <span class="org-string">"right"</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgbaa8390" class="outline-4">
<h4 id="orgbaa8390">Ensuring useful HTML Anchors</h4>
<div class="outline-text-4" id="text-orgbaa8390">
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">
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">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>
<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-1">(</span>cache <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">plist-get</span> info <span class="org-builtin">:internal-references</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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-1">(</span><span class="org-constant">car</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">rassq</span> datum cache<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">let*</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>crossrefs <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">plist-get</span> info <span class="org-builtin">:crossrefs</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>cells <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-export-search-cells</span> datum<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<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>
<span class="org-rainbow-delimiters-depth-3">(</span>new <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">or</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">cl-some</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">(</span>cell<span class="org-rainbow-delimiters-depth-1">)</span>
<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>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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> stored
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
cells<span class="org-rainbow-delimiters-depth-2">)</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-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-comment-delimiter">;; </span><span class="org-comment">Heading with a title</span>
<span class="org-rainbow-delimiters-depth-3">(</span>unpackaged/org-export-new-title-reference datum cache<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-bold"><span class="org-success">NOTE:</span></span><span class="org-comment"> This probably breaks some Org Export</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">feature, but if it does what I need, fine.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-export-format-reference</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-export-new-reference</span> cache<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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>reference-string new<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">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>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">dolist</span> <span class="org-rainbow-delimiters-depth-3">(</span>cell cells<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">push</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cons</span> cell new<span class="org-rainbow-delimiters-depth-1">)</span> cache<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">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>
<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> reference-string datum<span class="org-rainbow-delimiters-depth-3">)</span> cache<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">plist-put</span> info <span class="org-builtin">:internal-references</span> cache<span class="org-rainbow-delimiters-depth-2">)</span>
reference-string<span class="org-rainbow-delimiters-depth-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">defun</span> <span class="org-function-name">unpackaged/org-export-new-title-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>
<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-1">(</span>inc-suffixf <span class="org-rainbow-delimiters-depth-2">(</span>place<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-highlight-quoted-quote">`</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-constant">string-match</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">rx</span> bos
<span class="org-rainbow-delimiters-depth-2">(</span>minimal-match <span class="org-rainbow-delimiters-depth-3">(</span>group <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">1+</span> anything<span class="org-rainbow-delimiters-depth-1">)</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>optional <span class="org-string">"--"</span> <span class="org-rainbow-delimiters-depth-3">(</span>group <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">1+</span> digit<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
eos<span class="org-rainbow-delimiters-depth-1">)</span>
,place<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-bold"><span class="org-constant">HACK:</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-3">(</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-rainbow-delimiters-depth-3">(</span>s1 suffix<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">list</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">match-string</span> <span class="org-highlight-numbers-number">1</span> ,place<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">match-string</span> <span class="org-highlight-numbers-number">2</span> ,place<span class="org-rainbow-delimiters-depth-1">)</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>suffix <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> suffix
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">string-to-number</span> suffix<span class="org-rainbow-delimiters-depth-1">)</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><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setf</span> ,place <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> <span class="org-string">"%s--%s"</span> s1 <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">cl-incf</span> suffix<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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>title <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-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>ref <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">url-hexify-string</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">substring-no-properties</span> title<span class="org-rainbow-delimiters-depth-1">)</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>parent <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-1">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">--any</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">equal</span> ref <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">car</span> it<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
cache<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Title not unique: make it so.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> parent
<span class="org-comment-delimiter">;; </span><span class="org-comment">Append ancestor title.</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setf</span> title <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-function-name">org-element-property</span> <span class="org-builtin">:raw-value</span> parent<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-string">"--"</span> title<span class="org-rainbow-delimiters-depth-1">)</span>
ref <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">url-hexify-string</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">substring-no-properties</span> title<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
parent <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:parent</span> parent<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">No more ancestors: add and increment a number.</span>
<span class="org-rainbow-delimiters-depth-3">(</span>inc-suffixf 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>
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>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
<div id="outline-container-orged04965" class="outline-4">
<h4 id="orged04965">Folded Drawers</h4>
<div class="outline-text-4" id="text-orged04965">
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">
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">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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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>
<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-1">(</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">":export:.*\n?"</span> <span class="org-string">""</span> contents<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>fold? <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>export? <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">string-match</span> <span class="org-string">":export:\s+t"</span> contents<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>not-export? <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">string-match</span> <span class="org-string">":export:\s+nil"</span> contents<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&#8242; <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">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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">match-string</span> <span class="org-highlight-numbers-number">1</span> contents<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-3">)</span>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Ensure we have a title.</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">unless</span> title&#8242; <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> title&#8242; <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">s-join</span> <span class="org-string">" "</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">s-split</span> <span class="org-string">"_"</span> name<span class="org-rainbow-delimiters-depth-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-3">)</span>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">and</span> export? <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">not</span> fold?<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span> contents&#8242;<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>not-export? nil<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>fold?
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">thread-last</span> contents&#8242;
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"&lt;details class=\"code-details\"&gt; &lt;summary&gt; &lt;strong&gt;</span>
<span class="org-string"> &lt;font face=\"Courier\" size=\"3\" color=\"green\"&gt; %s</span>
<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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +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
2020-03-01 22:51:16 +01:00
<div id="outline-container-org1a43ae2" class="outline-3">
<h3 id="org1a43ae2">Org LaTeX</h3>
<div class="outline-text-3" id="text-org1a43ae2">
</div>
2020-03-22 23:04:07 +01:00
<div id="outline-container-org3a04c02" class="outline-4">
<h4 id="org3a04c02">LaTeX Fragments</h4>
<div class="outline-text-4" id="text-org3a04c02">
<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> 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>
<span class="org-rainbow-delimiters-depth-3">(</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-keyword">interactive</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</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-1">)</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">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>
<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-1">(</span>imagemagick
<span class="org-builtin">:programs</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"pdflatex"</span> <span class="org-string">"convert"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<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>
<span class="org-builtin">:image-size-adjust</span> <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span>
<span class="org-builtin">:latex-compiler</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"pdflatex -interaction nonstopmode -output-directory %o %f"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:image-converter</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"convert -density %D -trim -antialias %f -quality 100 %O"</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>dvipng
<span class="org-builtin">:programs</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"latex"</span> <span class="org-string">"dvipng"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<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>
<span class="org-builtin">:image-size-adjust</span> <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span>
<span class="org-builtin">:latex-compiler</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"latex -interaction nonstopmode -output-directory %o %f"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:image-converter</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"dvipng -D %D -T tight -o %O %f"</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>dvisvgm
<span class="org-builtin">:programs</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"pdflatex"</span> <span class="org-string">"dvisvgm"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:description</span> <span class="org-string">"dvi &gt; svg"</span>
<span class="org-builtin">:message</span> <span class="org-string">"you need to install the programs: latex and dvisvgm."</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">"svg"</span>
<span class="org-builtin">:image-size-adjust</span> <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span>
<span class="org-builtin">:latex-compiler</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"latex -interaction nonstopmode -output-directory %o %f"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:image-converter</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"dvisvgm %f -n -b min -c %S -o %O"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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">Use imagemagick/dvisvgm to generate png from pdf</span>
<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">dvisvgm</span><span class="org-rainbow-delimiters-depth-2">)</span>
<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>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> font-latex-fontify-script nil<span class="org-rainbow-delimiters-depth-2">)</span>
<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>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgaa26736" class="outline-4">
<h4 id="orgaa26736">LaTeX Classes</h4>
<div class="outline-text-4" id="text-orgaa26736">
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> 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>
,<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"\\documentclass[presentation]{beamer}\n"</span>
<span class="org-string">"[DEFAULT-PACKAGES]"</span>
<span class="org-string">"[PACKAGES]"</span>
<span class="org-string">"[EXTRA]\n"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</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-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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</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-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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</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-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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</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-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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</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-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{scrreprt}"</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</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-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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</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-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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-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>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
<div id="outline-container-org3480957" class="outline-4">
<h4 id="org3480957">Ox Latex Subfigure package</h4>
<div class="outline-text-4" id="text-org3480957">
<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">(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>
</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> 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>
<div id="outline-container-org44cf309" class="outline-4">
<h4 id="org44cf309">Clear page before heading</h4>
<div class="outline-text-4" id="text-org44cf309">
<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">
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> 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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>prop-point <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">next-property-change</span> <span class="org-highlight-numbers-number">0</span> headline<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">if</span> prop-point <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">plist-get</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">text-properties-at</span> prop-point headline<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-builtin">:parent</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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
2020-11-03 16:27:09 +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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<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>elmnt <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">tdh-get-headline-string-element</span> headline backend info<span class="org-rainbow-delimiters-depth-1">)</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">when</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> elmnt <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:CLEARPAGE</span> elmnt<span class="org-rainbow-delimiters-depth-1">)</span><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">"\\clearpage\n"</span> headline<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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +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>
2020-03-01 22:51:16 +01:00
<div id="outline-container-org3b03fac" class="outline-4">
<h4 id="org3b03fac">Default added packages</h4>
<div class="outline-text-4" id="text-org3b03fac">
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> 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
2020-03-01 22:51:16 +01:00
<div id="outline-container-org3b79603" class="outline-4">
<h4 id="org3b79603">Some configurations</h4>
<div class="outline-text-4" id="text-org3b79603">
<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> 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">"\\linewidth"</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">""</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Set the following as images</span>
<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-1">(</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-1">)</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
2020-11-03 16:27:09 +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>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgce10c33" class="outline-4">
<h4 id="orgce10c33">Beamer</h4>
<div class="outline-text-4" id="text-orgce10c33">
2020-01-11 22:04:45 +01:00
<p>
Bold Text
</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">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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">replace-regexp-in-string</span>
<span class="org-rainbow-delimiters-depth-2">(</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-2">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">If not, orgmode is crazy...</span>
<span class="org-string">"\\\\textbf"</span>
contents<span class="org-rainbow-delimiters-depth-1">)</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
2020-11-03 16:27:09 +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">
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> 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>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org7d55947" class="outline-4">
2020-05-26 08:40:15 +02:00
<h4 id="org7d55947">Custom Export - Add Page and Label for LaTeX export</h4>
2020-01-12 00:19:16 +01:00
<div class="outline-text-4" id="text-org7d55947">
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">
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">defcustom</span> <span class="org-variable-name">tdh-org-property-mapping</span>
<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-1">(</span><span class="org-string">"CUSTOM_PAGE"</span> . tdh-insert-org-page-latex<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"CUSTOM_LABEL"</span> . tdh-insert-org-label-latex<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<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>
<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-1">(</span><span class="org-function-name">repeat</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cons</span> string string<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<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-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>
<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-1">(</span><span class="org-function-name">map</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-constant">assoc</span> backend tdh-org-property-mapping<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
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
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-map-entries</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">()</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">dolist</span> <span class="org-rainbow-delimiters-depth-1">(</span>it map<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">save-excursion</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-keyword">setq</span> value <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-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> it<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">funcall</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cdr</span> it<span class="org-rainbow-delimiters-depth-1">)</span> value<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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +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">
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-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>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org9d2764e" class="outline-4">
<h4 id="org9d2764e">Number Equations</h4>
<div class="outline-text-4" id="text-org9d2764e">
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">
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> 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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>results <span class="org-highlight-quoted-quote">'</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>counter <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">numberp</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
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> results <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">loop</span> for <span class="org-rainbow-delimiters-depth-3">(</span>begin . env<span class="org-rainbow-delimiters-depth-3">)</span> in
<span class="org-rainbow-delimiters-depth-3">(</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">latex-environment</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">(</span>env<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cons</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:begin</span> env<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:value</span> env<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-3">)</span>
2020-05-26 08:40:15 +02:00
collect
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">cond</span>
<span class="org-rainbow-delimiters-depth-1">(</span><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">string-match</span> <span class="org-string">"\\\\begin{equation}"</span> env<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-1">(</span><span class="org-constant">string-match</span> <span class="org-string">"\\\\tag{"</span> env<span class="org-rainbow-delimiters-depth-1">)</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">incf</span> counter<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cons</span> begin counter<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">string-match</span> <span class="org-string">"\\\\begin{align}"</span> env<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">prog2</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">incf</span> counter<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">cons</span> begin counter<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">with-temp-buffer</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">insert</span> env<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">goto-char</span> <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-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">\\ is used for a new line. Each one leads to a number</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">incf</span> counter <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">count-matches</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-comment-delimiter">;; </span><span class="org-comment">unless there are nonumbers.</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">goto-char</span> <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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">decf</span> counter <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">count-matches</span> <span class="org-string">"\\nonumber"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>t
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cons</span> begin nil<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<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">setq</span> numberp <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">assoc</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-2">)</span> results<span class="org-rainbow-delimiters-depth-1">)</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">setf</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-3">(</span><span class="org-constant">concat</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"\\setcounter{equation}{%s}\n"</span> numberp<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">car</span> args<span class="org-rainbow-delimiters-depth-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-3">)</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +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>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<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>
2020-03-19 10:42:30 +01:00
<div id="outline-container-org5236d09" class="outline-3">
<h3 id="org5236d09">LaTeX macro both for LaTeX and HTML export</h3>
<div class="outline-text-3" id="text-org5236d09">
<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">
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> 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
2020-11-03 16:27:09 +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>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:results</span> . <span class="org-string">"raw"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:exports</span> . <span class="org-string">"results"</span><span class="org-rainbow-delimiters-depth-1">)</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
2020-11-03 16:27:09 +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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">insert</span> body<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">string-insert-rectangle</span> <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> pre<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">buffer-string</span><span class="org-rainbow-delimiters-depth-1">)</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
2020-11-03 16:27:09 +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>
2020-05-26 08:40:15 +02:00
body
2020-11-03 16:27:09 +01:00
<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
2020-05-26 08:40:15 +02:00
<div id="outline-container-org51ce4d3" class="outline-3">
<h3 id="org51ce4d3">Org Projects</h3>
<div class="outline-text-3" id="text-org51ce4d3">
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">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/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
<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">"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>
<div id="outline-container-orgf5cfaee" class="outline-3">
<h3 id="orgf5cfaee">Org big org-project</h3>
<div class="outline-text-3" id="text-orgf5cfaee">
<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">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">"website"</span>
<span class="org-builtin">:components</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"nass-simscape"</span> <span class="org-string">"nass-simscape-images"</span><span class="org-rainbow-delimiters-depth-1">)</span><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/website/nass-simscape/"</span>
<span class="org-builtin">:publishing-function</span> org-html-publish-to-html
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<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">"~/Cloud/website/index.html"</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<span class="org-builtin">:html-footnotes-section</span> <span class="org-string">"&lt;div id='footnotes'&gt;&lt;!--%s--&gt;%s&lt;/div&gt;"</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<span class="org-builtin">:recursive</span> nil
<span class="org-builtin">:auto-sitemap</span> nil
<span class="org-builtin">:language</span> en<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"nass-simscape-images"</span>
<span class="org-builtin">:base-directory</span> <span class="org-string">"~/Cloud/thesis/matlab/nass-simscape/docs/figs/"</span>
<span class="org-builtin">:base-extension</span> <span class="org-string">"png"</span>
<span class="org-builtin">:publishing-directory</span> <span class="org-string">"~/Cloud/website/nass-simscape/figs/"</span>
<span class="org-builtin">:publishing-function</span> org-publish-attachment<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
2020-05-26 08:40:15 +02:00
<div id="outline-container-org0a79d9f" class="outline-3">
<h3 id="org0a79d9f">Automatically run <code>startblock</code> when opening org-mode files</h3>
<div class="outline-text-3" id="text-org0a79d9f">
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> 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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">member</span> <span class="org-string">"startblock"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-src-block-names</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">save-excursion</span>
<span class="org-rainbow-delimiters-depth-2">(</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-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-execute-src-block</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
nil
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +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-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orga1fc443" class="outline-3">
<h3 id="orga1fc443">Insert ScreenShot or Picture from Phone</h3>
<div class="outline-text-3" id="text-orga1fc443">
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">
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">-remove</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">(</span>x<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">1</span> x<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">directory-files-and-attributes</span> tdh-image-dir<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Get target directory</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> target-dir <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-name-directory</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-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2020-03-19 10:42:30 +01:00
2020-11-03 16:27:09 +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
<span class="org-rainbow-delimiters-depth-1">(</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-2">(</span><span class="org-constant">sort</span> file-list
<span class="org-highlight-quoted-quote">#'</span><span class="org-rainbow-delimiters-depth-3">(</span>lambda <span class="org-rainbow-delimiters-depth-1">(</span>x y<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">time-less-p</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">6</span> y<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">6</span> x<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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-3">)</span>
2020-03-19 10:42:30 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use ivy to select start-file</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> start-file <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">ivy-read</span>
<span class="org-rainbow-delimiters-depth-2">(</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-2">)</span>
2020-05-26 08:40:15 +02:00
file-list-sorted
2020-11-03 16:27:09 +01:00
<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
<span class="org-builtin">:initial-input</span> nil<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2020-03-19 10:42:30 +01:00
2020-11-03 16:27:09 +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
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">expand-file-name</span> start-file tdh-image-dir<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2020-03-19 10:42:30 +01:00
2020-11-03 16:27:09 +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
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">expand-file-name</span> start-file target-dir<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">insert link</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-make-link-string</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> <span class="org-string">"file:%s"</span> start-file<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org7902aff" class="outline-3">
<h3 id="org7902aff">Render Tables</h3>
<div class="outline-text-3" id="text-org7902aff">
<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">
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> 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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">beginning-of-line</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">removes the overlay is already there</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-constant">overlays-at</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-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">delete-overlay</span> <span class="org-rainbow-delimiters-depth-3">(</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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-03-19 10:42:30 +01:00
2020-11-03 16:27:09 +01: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-1">(</span>element-type <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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</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">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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</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">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-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">error</span> <span class="org-string">"not at an org table"</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-03-19 10:42:30 +01:00
2020-11-03 16:27:09 +01:00
<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">not</span> <span class="org-rainbow-delimiters-depth-3">(</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-1">(</span><span class="org-function-name">org-element-type</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-at-point</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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">forward-line</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">tdh-render-org-table</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-at-point</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-03-19 10:42:30 +01:00
2020-11-03 16:27:09 +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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>begin <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:begin</span> table<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>end <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>pos <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:end</span> table<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">goto-char</span> pos<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">beginning-of-line</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">skip possible space after table</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">not</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">looking-at</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-2">(</span><span class="org-keyword">setq</span> pos <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-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">forward-line</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>
pos<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>tabletxt <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">buffer-substring-no-properties</span> begin end<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>img <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">with-temp-buffer</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">insert</span> tabletxt<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">mark-whole-buffer</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-latex-convert-region-to-latex</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-latex-preview</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">goto-char</span> <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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-get</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-1">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">display</span><span class="org-rainbow-delimiters-depth-1">)</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>overlay <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">make-overlay</span> begin end<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">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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">forward-line</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-1">)</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
2020-11-03 16:27:09 +01:00
<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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-map</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-parse-buffer</span><span class="org-rainbow-delimiters-depth-2">)</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-1">)</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
2020-11-03 16:27:09 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use F9 to globally generate tables</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;f8&gt;"</span> <span class="org-rainbow-delimiters-depth-3">(</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-keyword">interactive</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">tdh-render-org-table-at-point</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org66f0a8a" class="outline-3">
<h3 id="org66f0a8a">Org Gcal</h3>
<div class="outline-text-3" id="text-org66f0a8a">
<ul class="org-ul">
<li><a href="https://cestlaz.github.io/posts/using-emacs-26-gcal/#.WIqBud9vGAk">https://cestlaz.github.io/posts/using-emacs-26-gcal/#.WIqBud9vGAk</a></li>
</ul>
2020-03-01 23:04:12 +01:00
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">use-package!</span> org-gcal
<span class="org-builtin">:after</span> org
<span class="org-builtin">:init</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-gcal-client-id</span> <span class="org-string">"396102378658-dcmbcmrnthbe925519otsjbd921otq0v.apps.googleusercontent.com"</span>
<span class="org-variable-name">org-gcal-client-secret</span> <span class="org-string">"4M5PWrbhQjwYEMXGK85lDYX9"</span>
<span class="org-variable-name">org-gcal-file-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"dehaeze.thomas@gmail.com"</span> . <span class="org-string">"~/Cloud/org/gcal.org"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"8kjmhe2ar0abnm054ill1fb0gc@group.calendar.google.com"</span> . <span class="org-string">"~/Cloud/org/gcal_phd.org"</span><span class="org-rainbow-delimiters-depth-1">)</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">Automatic fetch of the new events</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(add-hook 'org-agenda-mode-hook (lambda () (org-gcal-fetch) ))</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org5970686" class="outline-3">
<h3 id="org5970686">Citeproc-Org</h3>
<div class="outline-text-3" id="text-org5970686">
<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">:ensure</span> t
<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>
<div id="outline-container-org06259a5" class="outline-3">
<h3 id="org06259a5">Org Wild Notifier</h3>
<div class="outline-text-3" id="text-org06259a5">
<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-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-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgaa7cec6" class="outline-3">
<h3 id="orgaa7cec6">Orch</h3>
<div class="outline-text-3" id="text-orgaa7cec6">
<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> web-server
<span class="org-builtin">:init</span>
<span class="org-builtin">:config</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-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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgafe7963" class="outline-3">
<h3 id="orgafe7963">Custom Keybindings - <code>,</code> leader key and <code>C-c</code></h3>
<div class="outline-text-3" id="text-orgafe7963">
<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">
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> 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
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgdc0a145" class="outline-4">
<h4 id="orgdc0a145">Insert Elements <code>,i</code></h4>
<div class="outline-text-4" id="text-orgdc0a145">
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">
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-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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">list</span> <span class="org-rainbow-delimiters-depth-1">(</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-1">)</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-1">(</span><span class="org-function-name">file-name-base</span> paper<span class="org-rainbow-delimiters-depth-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>
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">
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-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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">list</span> <span class="org-rainbow-delimiters-depth-1">(</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-1">)</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-1">(</span><span class="org-function-name">file-name-base</span> note<span class="org-rainbow-delimiters-depth-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>
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">
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-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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">list</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">file-relative-name</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">read-file-name</span> <span class="org-string">"Image: "</span> <span class="org-rainbow-delimiters-depth-3">(</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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-variable-name">default-directory</span><span class="org-rainbow-delimiters-depth-1">)</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">"[[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">
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-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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"[[file:%s]]"</span> img<span class="org-rainbow-delimiters-depth-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>
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">
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-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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"[[file:%s]]"</span> img<span class="org-rainbow-delimiters-depth-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>
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">
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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">
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-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>
<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-1">(</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-1">)</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-1">(</span><span class="org-constant">read-string</span> <span class="org-string">"Enter file name:"</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-function-name">split-string</span> <span class="org-rainbow-delimiters-depth-1">(</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-1">)</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><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-1">(</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-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> 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 -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">
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-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>
<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-1">(</span><span class="org-function-name">match-string</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</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-05-26 08:40:15 +02:00
</pre>
</div>
<p>
Insert link to previous figure:
</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-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>
<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-1">(</span><span class="org-function-name">match-string</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</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-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">
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> 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">:prefix</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">",i"</span> . <span class="org-string">"Insert"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<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
<div id="outline-container-orgc62ba13" class="outline-4">
<h4 id="orgc62ba13">LaTeX <code>,l</code></h4>
<div class="outline-text-4" id="text-orgc62ba13">
<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-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>
<span class="org-string">"latexmk"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"-pdflatex=\"xelatex -synctex=1 -shell-escape -interaction nonstopmode -output-directory='%s'\" -pdf -pvc -bibtex -f %s.tex"</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-name-directory</span> <span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</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-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>
2020-03-22 23:04:07 +01:00
</pre>
2020-01-11 22:04:45 +01:00
</div>
<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-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">
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> 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">:prefix</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">",l"</span> . <span class="org-string">"LaTeX"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<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>
2020-03-22 23:04:07 +01:00
<div id="outline-container-org0b5774e" class="outline-4">
<h4 id="org0b5774e">Org LaTeX Automatic fragment</h4>
<div class="outline-text-4" id="text-org0b5774e">
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-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-highlight-quoted-symbol">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
2020-11-03 16:27:09 +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-highlight-quoted-symbol">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">
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> 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">:prefix</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">",l"</span> . <span class="org-string">"LaTeX"</span><span class="org-rainbow-delimiters-depth-1">)</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-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
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgee735c5" class="outline-4">
<h4 id="orgee735c5">Bibtex <code>,r</code></h4>
<div class="outline-text-4" id="text-orgee735c5">
2020-03-22 23:04:07 +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> 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">:prefix</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">",r"</span> . <span class="org-string">"References"</span><span class="org-rainbow-delimiters-depth-1">)</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</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
2020-03-22 23:04:07 +01:00
<div id="outline-container-org87d89c4" class="outline-4">
<h4 id="org87d89c4">Open ranger in current directory <code>,o</code></h4>
<div class="outline-text-4" id="text-org87d89c4">
<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-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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"termite --directory="</span> <span class="org-variable-name">default-directory</span> <span class="org-string">" --exec=ranger"</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">
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> 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>
2020-03-22 23:04:07 +01:00
<div id="outline-container-orgb7c8cca" class="outline-4">
<h4 id="orgb7c8cca">View in External programs <code>,v</code></h4>
<div class="outline-text-4" id="text-orgb7c8cca">
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">
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-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>
<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-1">(</span><span class="org-function-name">file-name-sans-extension</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-rainbow-delimiters-depth-1">)</span> <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-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">
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-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>
<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-1">(</span><span class="org-function-name">file-name-sans-extension</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-rainbow-delimiters-depth-1">)</span> <span class="org-string">".html"</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">
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> 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">:prefix</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">",v"</span> . <span class="org-string">"View"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<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
2020-01-12 00:19:16 +01:00
<div id="outline-container-org38a8163" class="outline-2">
<h2 id="org38a8163">Org Babel</h2>
<div class="outline-text-2" id="text-org38a8163">
2020-01-11 22:04:45 +01:00
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org97bf4fc" class="outline-3">
<h3 id="org97bf4fc">Main configuration</h3>
<div class="outline-text-3" id="text-org97bf4fc">
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">
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-org-confirm-babel-evaluate</span> <span class="org-rainbow-delimiters-depth-2">(</span>lang body<span class="org-rainbow-delimiters-depth-2">)</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">member</span> lang <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</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-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>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +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">
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> org
<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-1">(</span><span class="org-builtin">:eval</span> . <span class="org-string">"no-export"</span><span class="org-rainbow-delimiters-depth-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>
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">
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> 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>
2020-03-01 22:51:16 +01:00
<div id="outline-container-org741956d" class="outline-3">
<h3 id="org741956d">Appearance of source blocks</h3>
<div class="outline-text-3" id="text-org741956d">
<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-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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">mapcar</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">(</span>x<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">list</span> x <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cons</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">upcase</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">car</span> x<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">cdr</span> x<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</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">"#+begin_src"</span> . ?&#9998;<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"#+end_src"</span> . ?&#9633;<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"#+begin_quote"</span> . ?&#171;<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"#+end_quote"</span> . ?&#187;<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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<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
2020-03-22 23:04:07 +01:00
<div id="outline-container-org737e623" class="outline-3">
<h3 id="org737e623">Indentation</h3>
<div class="outline-text-3" id="text-org737e623">
2020-03-01 22:51:16 +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> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-edit-src-content-indentation</span> <span class="org-highlight-numbers-number">2</span>
<span class="org-variable-name">org-src-tab-acts-natively</span> nil
<span class="org-variable-name">org-src-preserve-indentation</span> nil<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-03-22 23:04:07 +01:00
<div id="outline-container-orgee4e789" class="outline-3">
<h3 id="orgee4e789">Library of Babel</h3>
<div class="outline-text-3" id="text-orgee4e789">
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">
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> 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/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
2020-01-12 00:19:16 +01:00
<div id="outline-container-org232fea8" class="outline-3">
<h3 id="org232fea8">Org-Babel Matlab</h3>
<div class="outline-text-3" id="text-org232fea8">
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> org
<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>
<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">
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> org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> org-babel-default-header-args:matlab
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:results</span> . <span class="org-string">"none"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:session</span> . <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-builtin">:comments</span> . <span class="org-string">"org"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:exports</span> . <span class="org-string">"both"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:cache</span> . <span class="org-string">"no"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:noweb</span> . <span class="org-string">"no"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:hlines</span> . <span class="org-string">"no"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:tangle</span> . <span class="org-string">"yes"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:mkdir</span> . <span class="org-string">"yes"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:eval</span> . <span class="org-string">"no-export"</span><span class="org-rainbow-delimiters-depth-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>
</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">
<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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>tmp-file <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-babel-temp-file</span> <span class="org-rainbow-delimiters-depth-1">(</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-1">)</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>wait-file <span class="org-rainbow-delimiters-depth-3">(</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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>full-body
<span class="org-rainbow-delimiters-depth-3">(</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">output</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">org-babel-chomp</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">list</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">if</span> matlabp
<span class="org-rainbow-delimiters-depth-2">(</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-3">(</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>
<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>
<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-3">)</span> <span class="org-comment-delimiter">;</span><span class="org-comment">Concatenate lines</span>
body<span class="org-rainbow-delimiters-depth-2">)</span>
body<span class="org-rainbow-delimiters-depth-1">)</span>
org-babel-octave-eoe-indicator<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-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><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-constant">concat</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> org-babel-matlab-emacs-link-wrapper-method
body
<span class="org-rainbow-delimiters-depth-2">(</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-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</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-2">)</span> wait-file<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">mapconcat</span>
<span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">org-babel-chomp</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-constant">format</span> org-babel-octave-wrapper-method
body
<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><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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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>raw <span class="org-rainbow-delimiters-depth-3">(</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-keyword">save-window-excursion</span>
<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> full-body<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">matlab-shell-run-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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">message</span> <span class="org-string">"Waiting for Matlab Emacs Link"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-exists-p</span> wait-file<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">sit-for</span> <span class="org-highlight-numbers-number">0.01</span><span class="org-rainbow-delimiters-depth-1">)</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-comment-delimiter">;; </span><span class="org-comment">matlab-shell-run-region doesn't seem to</span>
<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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">org-babel-comint-with-output</span>
<span class="org-rainbow-delimiters-depth-2">(</span>session
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> matlabp
org-babel-octave-eoe-indicator
org-babel-octave-eoe-output<span class="org-rainbow-delimiters-depth-3">)</span>
t full-body<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">insert</span> full-body<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">comint-send-input</span> nil t<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-warning">results</span><span class="org-warning"><span class="org-rainbow-delimiters-depth-1">)</span></span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">pcase</span> result-type
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-quoted-quote">`</span><span class="org-highlight-quoted-symbol">value</span>
<span class="org-rainbow-delimiters-depth-3">(</span>org-babel-octave-import-elisp-from-file tmp-file<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-highlight-quoted-quote">`</span><span class="org-highlight-quoted-symbol">output</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> results
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">if</span> matlabp
<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">reverse</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">delete</span> <span class="org-string">""</span> <span class="org-rainbow-delimiters-depth-2">(</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-3">(</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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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">cdr</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">member</span> org-babel-octave-eoe-output
<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">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-3">(</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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</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">reverse</span> results<span class="org-rainbow-delimiters-depth-1">)</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><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">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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">cons</span> <span class="org-rainbow-delimiters-depth-1">(</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-2">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">split-string-and-unquote</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">car</span> raw<span class="org-rainbow-delimiters-depth-1">)</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-string">"\n"</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cdr</span> raw<span class="org-rainbow-delimiters-depth-1">)</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">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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">null</span> replacements-list<span class="org-rainbow-delimiters-depth-1">)</span>
string
<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>regex <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">caar</span> replacements-list<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>replacement <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">cdar</span> replacements-list<span class="org-rainbow-delimiters-depth-1">)</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">multi-replace-regexp-in-string</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">cdr</span> replacements-list<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">replace-regexp-in-string</span> regex replacement
string rest<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-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>
2020-03-22 23:04:07 +01:00
<div id="outline-container-org80ca3ef" class="outline-3">
<h3 id="org80ca3ef">Some functions for using Matlab with Org Babel <code>,m</code></h3>
<div class="outline-text-3" id="text-org80ca3ef">
<p>
<code>whos</code> matlab function
</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-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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>regionp <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">buffer-substring</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">region-beginning</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">region-end</span><span class="org-rainbow-delimiters-depth-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-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">"whosEmacs "</span> regionp <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-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-1">(</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-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>
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">
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-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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>regionp <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">buffer-substring</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">region-beginning</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">region-end</span><span class="org-rainbow-delimiters-depth-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-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">"help "</span> regionp <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-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-1">(</span><span class="org-constant">concat</span> <span class="org-string">"help "</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">read-string</span> <span class="org-string">"Matlab help:"</span><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-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
</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>
<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>
<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-1">(</span><span class="org-constant">read-string</span> <span class="org-string">"Matlab Command: "</span><span class="org-rainbow-delimiters-depth-1">)</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">
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-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>
<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-1">(</span><span class="org-constant">read-string</span> <span class="org-string">"Matlab Command: "</span><span class="org-rainbow-delimiters-depth-1">)</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>
<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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">cl-letf</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</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-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">(</span>start end filename <span class="org-type">&amp;rest</span> _ignore<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> file filename<span class="org-rainbow-delimiters-depth-1">)</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-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-3">)</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">ignore</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-tangle</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">4</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> file
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> file <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">expand-file-name</span> 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-keyword">if</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">file-readable-p</span> file<span class="org-rainbow-delimiters-depth-2">)</span>
<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">"run "</span> file <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-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-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>
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">
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> 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">:prefix</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">",m"</span> . <span class="org-string">"Matlab"</span><span class="org-rainbow-delimiters-depth-1">)</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</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>
2020-03-22 23:04:07 +01:00
<div id="outline-container-org71fa917" class="outline-3">
<h3 id="org71fa917">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-org71fa917">
<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">
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-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>
<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-1">(</span><span class="org-function-name">org-in-block-p</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"src"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span>tdh-in-src-block-p<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">progn</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-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-3">)</span>
<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">
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">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>
2020-03-22 23:04:07 +01:00
<div id="outline-container-org4b37ab8" class="outline-3">
<h3 id="org4b37ab8">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-org4b37ab8">
</div>
<div id="outline-container-orgb05f319" class="outline-4">
<h4 id="orgb05f319"><code>tdh-org-babel-execute-matlab-background</code></h4>
<div class="outline-text-4" id="text-orgb05f319">
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-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>
<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-1">(</span><span class="org-variable-name">org-babel-current-src-block-location</span>
<span class="org-rainbow-delimiters-depth-2">(</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-3">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">5</span> info<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-babel-where-is-src-block-head</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">info</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> info <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">copy-tree</span> info<span class="org-rainbow-delimiters-depth-3">)</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-3">)</span>
<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>
<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-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> 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-1">(</span><span class="org-function-name">org-babel-check-evaluate</span> info<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">cl-callf</span> org-babel-process-params <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">2</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><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>cache <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>c <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">assq</span> <span class="org-builtin">:cache</span> params<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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">and</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">not</span> arg<span class="org-rainbow-delimiters-depth-3">)</span> c <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">string=</span> <span class="org-string">"yes"</span> c<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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>new-hash <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> cache <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-sha1-hash</span> info <span class="org-builtin">:eval</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>old-hash <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> cache <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-current-result-hash</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>current-cache <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> new-hash <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">equal</span> new-hash old-hash<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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">cond</span>
<span class="org-rainbow-delimiters-depth-3">(</span>current-cache
<span class="org-rainbow-delimiters-depth-1">(</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-2">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-babel-where-is-src-block-result</span> nil 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><span class="org-constant">forward-line</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">skip-chars-forward</span> <span class="org-string">" \t"</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-1">(</span>result <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-read-result</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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-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> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> <span class="org-string">"%S"</span> result<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
result<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-confirm-evaluate</span> info<span class="org-rainbow-delimiters-depth-1">)</span>
<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>lang <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">0</span> info<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>result-params <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">assq</span> <span class="org-builtin">:result-params</span> params<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<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>
<span class="org-rainbow-delimiters-depth-3">(</span>body
<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>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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>expand
<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>
<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-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-constant">not</span> coderef<span class="org-rainbow-delimiters-depth-3">)</span> expand
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>dir <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">assq</span> <span class="org-builtin">:dir</span> params<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>mkdirp <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">assq</span> <span class="org-builtin">:mkdirp</span> params<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">default-directory</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">cond</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">not</span> dir<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-variable-name">default-directory</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">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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>t
<span class="org-rainbow-delimiters-depth-3">(</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-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-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">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>
d<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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>cmd <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">intern</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-string">"org-babel-execute:"</span> lang<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
result<span class="org-rainbow-delimiters-depth-2">)</span>
<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> body <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
result<span class="org-rainbow-delimiters-depth-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-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>
2020-03-22 23:04:07 +01:00
<div id="outline-container-orgf77f938" class="outline-4">
<h4 id="orgf77f938"><code>tdh-matlab-execute-selected</code></h4>
<div class="outline-text-4" id="text-orgf77f938">
<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-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>
<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-1">(</span>regionp <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">buffer-substring</span> start end<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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-1">(</span><span class="org-constant">concat</span> regionp <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-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>
2020-03-22 23:04:07 +01:00
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc5f1a86" class="outline-4">
<h4 id="orgc5f1a86">Remap <code>ctrl-shift-ref</code></h4>
<div class="outline-text-4" id="text-orgc5f1a86">
<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">
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-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>
<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-1">(</span><span class="org-function-name">org-in-block-p</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"src"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span>tdh-in-src-block-p<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-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>lang <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-1">(</span><span class="org-function-name">org-babel-get-src-block-info</span><span class="org-rainbow-delimiters-depth-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">if</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">string=</span> lang <span class="org-string">"matlab"</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">region-active-p</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">tdh-matlab-execute-selected</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">region-beginning</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">region-end</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">progn</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">tdh-org-babel-execute-matlab-background</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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">tdh-ctrl-ret</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
2020-03-22 23:04:07 +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">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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org354b3a0" class="outline-3">
<h3 id="org354b3a0">Align Source Blocks</h3>
<div class="outline-text-3" id="text-org354b3a0">
<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-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>
<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-1">(</span><span class="org-function-name">org-in-block-p</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"src"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span>tdh-in-src-block-p<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">progn</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-edit-special</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">evil-indent</span> <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-function-name">org-edit-src-exit</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<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>
2020-03-22 23:04:07 +01:00
<div id="outline-container-org5783483" class="outline-3">
<h3 id="org5783483">Helping Functions - Tangling <code>,b</code></h3>
<div class="outline-text-3" id="text-org5783483">
<p>
Org-Babel Tangle Sub-tree
</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-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">
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-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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">cl-letf</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</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-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">(</span>start end filename <span class="org-type">&amp;rest</span> _ignore<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> file filename<span class="org-rainbow-delimiters-depth-1">)</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-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-3">)</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">ignore</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-tangle</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">4</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> file
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> file <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">expand-file-name</span> 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-keyword">if</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">file-readable-p</span> file<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">find-file</span> file<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-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>
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">
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> 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">:prefix</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">",b"</span> . <span class="org-string">"Tangle"</span><span class="org-rainbow-delimiters-depth-1">)</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-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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgbf4c78e" class="outline-2">
<h2 id="orgbf4c78e">Bibliography Management</h2>
<div class="outline-text-2" id="text-orgbf4c78e">
<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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgd6dd52d" class="outline-3">
<h3 id="orgd6dd52d">Org Ref (<a href="https://github.com/jkitchin/org-ref">link</a>)</h3>
<div class="outline-text-3" id="text-orgd6dd52d">
<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">
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">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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"book"</span> . <span class="org-string">"%a, %t, %u (%y)."</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"techreport"</span> . <span class="org-string">"%a, %t, %i, %u (%y)."</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"phdthesis"</span> . <span class="org-string">"%a, %t (%y)."</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"proceedings"</span> . <span class="org-string">"%e, %t in %S, %u (%y)."</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</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
2020-11-03 16:27:09 +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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">(</span>thekey<span class="org-rainbow-delimiters-depth-1">)</span>
<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><span class="org-variable-name">bibtex-completion-bibliography</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-ref-find-bibliography</span><span class="org-rainbow-delimiters-depth-1">)</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">bibtex-completion-edit-notes</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">list</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">org-ref-get-bibtex-key-and-file</span> thekey<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +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>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +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-ref-helm-user-candidates</span>
<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-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-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-1">(</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-1">)</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">org-ref-get-bibtex-key-and-file</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<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-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
t<span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +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-ref-helm-user-candidates</span>
<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-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-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-3">(</span><span class="org-constant">concat</span>
<span class="org-string">"dragon-drag-and-drop "</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</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">org-ref-get-bibtex-key-and-file</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<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-rainbow-delimiters-depth-1">)</span><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">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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</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-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> <span class="org-string">"\\eqref{%s}"</span> keyword<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">eq</span> format <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">html</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">"\\eqref{%s}"</span> keyword<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">eq</span> format <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">md</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">"\\eqref{%s}"</span> keyword<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>
2020-05-26 08:40:15 +02:00
</pre>
</div>
<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-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>
<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-1">(</span>results <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-ref-get-bibtex-key-and-file</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>key <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> results<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>pdf-file <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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-1">(</span><span class="org-constant">file-exists-p</span> pdf-file<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 pdf-file<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 pdf found for %s"</span> key<span class="org-rainbow-delimiters-depth-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>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
<div id="outline-container-orgd5277ba" class="outline-3">
<h3 id="orgd5277ba">Org Noter (<a href="https://github.com/weirdNox/org-noter">link</a>)</h3>
<div class="outline-text-3" id="text-orgd5277ba">
2020-03-22 23:04:07 +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">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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org11a3a48" class="outline-3">
<h3 id="org11a3a48">Org Roam (<a href="https://github.com/jethrokuan/org-roam/">link</a>)</h3>
<div class="outline-text-3" id="text-org11a3a48">
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">use-package!</span> org-roam
<span class="org-builtin">:custom-face</span>
<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-1">(</span>t <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</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-roam-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-roam-completion-system</span> <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> <span class="org-variable-name">org-roam-tag-sources</span> <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>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-roam-capture-templates</span>
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"d"</span> <span class="org-string">"default"</span> plain <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">function</span> org-roam--capture-get-point<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-string">"%?"</span>
<span class="org-builtin">:file-name</span> <span class="org-string">"${slug}"</span>
<span class="org-builtin">:head</span> ,<span class="org-rainbow-delimiters-depth-2">(</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: zettels\n"</span>
<span class="org-string">"\n"</span>
<span class="org-string">"- Tags ::\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-2">)</span>
<span class="org-builtin">:unnarrowed</span> t<span class="org-rainbow-delimiters-depth-1">)</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-roam-capture-ref-templates</span>
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"r"</span> <span class="org-string">"ref"</span> plain <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">function</span> org-roam--capture-get-point<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-string">"%?"</span>
<span class="org-builtin">:file-name</span> <span class="org-string">"${slug}"</span>
<span class="org-builtin">:head</span> ,<span class="org-rainbow-delimiters-depth-2">(</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: websites\n"</span>
<span class="org-string">"#+ROAM_KEY: ${ref}\n"</span>
<span class="org-string">"\n"</span>
<span class="org-string">"- Tags ::\n"</span>
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:unnarrowed</span> t<span class="org-rainbow-delimiters-depth-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>
</pre>
</div>
<p>
Automatic export of backlinks
</p>
<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> <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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-roam--org-roam-file-p</span> file<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</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-2">(</span><span class="org-function-name">org-roam-db-query</span> <span class="org-rainbow-delimiters-depth-3">[</span><span class="org-builtin">:select</span> <span class="org-builtin">:distinct</span> <span class="org-rainbow-delimiters-depth-1">[</span>from<span class="org-rainbow-delimiters-depth-1">]</span>
<span class="org-builtin">:from</span> links
<span class="org-builtin">:where</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">=</span> to $s1<span class="org-rainbow-delimiters-depth-1">)</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-3">]</span> file <span class="org-string">"%private%"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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">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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when-let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>links <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">tdh-org-roam--backlinks-list</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-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">insert</span> <span class="org-string">"\nBacklinks:\n"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">dolist</span> <span class="org-rainbow-delimiters-depth-2">(</span>link links<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">"- [[file:%s][%s]]\n"</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-roam--get-title-or-slug</span> link<span class="org-rainbow-delimiters-depth-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-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-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>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh-org-roam-export-all</span> <span class="org-rainbow-delimiters-depth-3">()</span>
<span class="org-doc">"Re-exports all Org-roam files to Hugo markdown."</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">dolist</span> <span class="org-rainbow-delimiters-depth-1">(</span>f <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-roam--list-all-files</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">with-current-buffer</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">find-file</span> f<span class="org-rainbow-delimiters-depth-2">)</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-function-name">s-contains?</span> <span class="org-string">"SETUPFILE"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">buffer-string</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-hugo-export-wim-to-md</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-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>
2020-03-01 22:51:16 +01:00
2020-05-26 08:40:15 +02:00
<div id="outline-container-org18473f5" class="outline-3">
<h3 id="org18473f5">Helm-Bibtex (<a href="https://github.com/tmalsburg/helm-bibtex">link</a>)</h3>
<div class="outline-text-3" id="text-org18473f5">
2020-03-01 22:51:16 +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">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-string">"~/Cloud/brain/biblio/references.bib"</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-string">"~/Cloud/pdfs/"</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<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>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use "tags" 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>tags<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<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>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<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>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>t . <span class="org-string">"${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=:1}"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +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>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +01:00
<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>
<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>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +01:00
<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>
</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">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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>entry <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">bibtex-completion-get-entry</span> key<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-function-name">bibtex-completion-get-value</span> <span class="org-string">"title"</span> entry<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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-1">(</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-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<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-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>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</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-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>path <span class="org-rainbow-delimiters-depth-3">(</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-1">(</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-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">if</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">file-exists-p</span> path<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">concat</span> <span class="org-string">"[[file:"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">file-relative-name</span> path<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">"][Notes]]"</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">message</span> <span class="org-string">"No note file associated"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>
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">
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-open-pdf-externally</span> <span class="org-rainbow-delimiters-depth-2">(</span>key<span class="org-rainbow-delimiters-depth-2">)</span>
<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-1">(</span><span class="org-function-name">-cons-to-list</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">bibtex-completion-find-pdf</span> key<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>
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">
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-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">
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-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
2020-11-03 16:27:09 +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>
<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-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">"=key="</span> candidate<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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>
<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">cdr</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">assoc</span> <span class="org-string">"title"</span> x<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
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
2020-11-03 16:27:09 +01: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-1">(</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-1">)</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">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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgd601e31" class="outline-3">
<h3 id="orgd601e31">Deft</h3>
<div class="outline-text-3" id="text-orgd601e31">
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">use-package!</span> deft
<span class="org-builtin">:custom</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">deft-directory</span> <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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org910a943" class="outline-3">
<h3 id="org910a943">Org-Roam-Bibtex (<a href="https://github.com/Zaeph/org-roam-bibtex">link</a>)</h3>
<div class="outline-text-3" id="text-org910a943">
<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">
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">use-package!</span> org-roam-bibtex
<span class="org-builtin">:hook</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-roam-mode</span> . org-roam-bibtex-mode<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> orb-preformat-keywords <span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"=key="</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">"=type="</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
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> orb-templates
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"r"</span> <span class="org-string">"ref"</span> plain <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">function</span> org-roam-capture--get-point<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-string">""</span>
<span class="org-builtin">:file-name</span> <span class="org-string">"${=key=}"</span>
<span class="org-builtin">:head</span> ,<span class="org-rainbow-delimiters-depth-2">(</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: ${ref}\n"</span>
<span class="org-string">"\n"</span>
<span class="org-string">"- Tags ::\n"</span>
<span class="org-string">"- Reference :: ${ref}\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-2">)</span>
<span class="org-builtin">:unnarrowed</span> t<span class="org-rainbow-delimiters-depth-1">)</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
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> orb-note-actions-user <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"Open with Zathura"</span> . tdh-open-bib-with-zathura<span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<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-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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> key <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">car</span> key<span class="org-rainbow-delimiters-depth-1">)</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">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>
2020-11-03 16:27:09 +01:00
<div id="outline-container-orgf447528" class="outline-3">
<h3 id="orgf447528">Citeproc-org (<a href="https://github.com/andras-simonyi/citeproc-org">link</a>)</h3>
<div class="outline-text-3" id="text-orgf447528">
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">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-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-03-01 22:51:16 +01:00
</div>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org5bc2aea" class="outline-2">
<h2 id="org5bc2aea">LaTeX</h2>
<div class="outline-text-2" id="text-org5bc2aea">
<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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org0822b20" class="outline-3">
<h3 id="org0822b20">Master file</h3>
<div class="outline-text-3" id="text-org0822b20">
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">setq-default</span> TeX-master nil<span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org944a888" class="outline-3">
<h3 id="org944a888">Clean Output Files</h3>
<div class="outline-text-3" id="text-org944a888">
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-latex-clean</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Clean LaTeX output 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">async-shell-command</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">command and parameters</span>
<span class="org-string">"latexmk -c "</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">shell-quote-argument</span> <span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-string">" &amp;"</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
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> LaTeX-mode-map
<span class="org-builtin">:n</span> <span class="org-string">",C"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh-latex-clean</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +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-highlight-quoted-symbol">TeX-mode-hook</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">TeX-fold-mode</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
2020-05-26 08:40:15 +02:00
<div id="outline-container-orga4ad7f6" class="outline-3">
<h3 id="orga4ad7f6">PDF Viewer</h3>
<div class="outline-text-3" id="text-orga4ad7f6">
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">setq</span> TeX-view-program-selection <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>output-pdf <span class="org-string">"Zathura"</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> TeX-source-correlate-mode t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> TeX-source-correlate-start-server t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> TeX-source-correlate-method <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">synctex</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> TeX-view-program-list
<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">"PDF Tools"</span> TeX-pdf-tools-sync-view<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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org120de8b" class="outline-3">
<h3 id="org120de8b">Bibtex</h3>
<div class="outline-text-3" id="text-org120de8b">
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">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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgd94d627" class="outline-2">
<h2 id="orgd94d627">Matlab</h2>
<div class="outline-text-2" id="text-orgd94d627">
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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgb915baf" class="outline-3">
<h3 id="orgb915baf">Setup Matlab Mode</h3>
<div class="outline-text-3" id="text-orgb915baf">
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">setq</span> <span class="org-variable-name">matlab-shell-command</span> <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> <span class="org-variable-name">matlab-shell-command-switches</span> <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>
<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>
<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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orga36d033" class="outline-3">
<h3 id="orga36d033">Setup Flycheck to work with <code>mlint</code></h3>
<div class="outline-text-3" id="text-orga36d033">
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">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
2020-11-03 16:27:09 +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>
<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-1">(</span><span class="org-constant">1+</span> digit<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">"): "</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">message</span><span class="org-rainbow-delimiters-depth-1">)</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-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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org04bf41d" class="outline-3">
<h3 id="org04bf41d">Completion in the Matlab Shell</h3>
<div class="outline-text-3" id="text-org04bf41d">
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">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">matlab-shell-mode-map</span>
<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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgace4163" class="outline-3">
<h3 id="orgace4163">Beautify code</h3>
<div class="outline-text-3" id="text-orgace4163">
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-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>
<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-1">(</span><span class="org-function-name">file-name-extension</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-rainbow-delimiters-depth-1">)</span> <span class="org-string">"m"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">progn</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">save-buffer</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">matlab-shell-run-command</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-string">"MBeautify.formatFileNoEditor(\""</span> <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-string">"\", \""</span> <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-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">revert-buffer</span> <span class="org-builtin">:ignore-auto</span> <span class="org-builtin">:noconfirm</span><span class="org-rainbow-delimiters-depth-1">)</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">"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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgb85ca7e" class="outline-3">
<h3 id="orgb85ca7e">Key Bindings</h3>
<div class="outline-text-3" id="text-orgb85ca7e">
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-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>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">matlab-shell-run-command</span> <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-1">(</span><span class="org-constant">buffer-name</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">" at "</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">number-to-string</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">line-number-at-pos</span> nil<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +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>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">matlab-shell-run-command</span> <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-1">(</span><span class="org-constant">buffer-name</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">" at "</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">number-to-string</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">line-number-at-pos</span> nil<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +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>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">matlab-shell-run-command</span> <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-1">(</span><span class="org-constant">buffer-name</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +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>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">matlab-shell-run-command</span> <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-1">(</span><span class="org-constant">buffer-name</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +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>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">matlab-shell-run-command</span> <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>
<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>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">matlab-shell-run-command</span> <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>
<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>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">matlab-shell-run-command</span> <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-1">(</span><span class="org-constant">file-name-directory</span> <span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
<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">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>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:prefix</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"d"</span> . <span class="org-string">"Debug"</span><span class="org-rainbow-delimiters-depth-1">)</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-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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org7d36b5d" class="outline-2">
<h2 id="org7d36b5d">Mu4e</h2>
<div class="outline-text-2" id="text-org7d36b5d">
2020-01-11 22:04:45 +01:00
</div>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org0022939" class="outline-3">
<h3 id="org0022939">Resources</h3>
<div class="outline-text-3" id="text-org0022939">
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>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgdf9660c" class="outline-3">
2020-05-26 08:40:15 +02:00
<h3 id="orgdf9660c">Cheatsheet</h3>
2020-01-12 00:19:16 +01:00
<div class="outline-text-3" id="text-orgdf9660c">
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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org998a101" class="outline-3">
<h3 id="org998a101">Helping function</h3>
<div class="outline-text-3" id="text-org998a101">
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">
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">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
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">listp</span> rx<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">If rx is a list, try each one for a match</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">or</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">mu4e-message-maildir-matches</span> msg <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">car</span> rx<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">mu4e-message-maildir-matches</span> msg <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">cdr</span> rx<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">Not a list, check rx</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">string-match</span> rx <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">mu4e-message-field</span> msg <span class="org-builtin">:maildir</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>
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">
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">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>
<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>from <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">save-restriction</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">message-narrow-to-headers</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">message-fetch-field</span> <span class="org-string">"from"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>account
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">cond</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">string-match</span> <span class="org-string">"dehaeze.thomas@gmail.com"</span> from<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-string">"gmail"</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">string-match</span> <span class="org-string">"thomas.dehaeze@esrf.fr"</span> from<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-string">"esrf"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</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">message-sendmail-extra-arguments</span> <span class="org-rainbow-delimiters-depth-3">(</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-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orge7dad22" class="outline-3">
<h3 id="orge7dad22">Basic Config</h3>
<div class="outline-text-3" id="text-orge7dad22">
2020-01-12 00:19:16 +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">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>
<div id="outline-container-org5886531" class="outline-3">
<h3 id="org5886531">Additional config</h3>
<div class="outline-text-3" id="text-org5886531">
<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">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>
2020-03-01 22:51:16 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-01-12 00:19:16 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-01-12 00:19:16 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgbc87a17" class="outline-3">
<h3 id="orgbc87a17">Provide Information</h3>
<div class="outline-text-3" id="text-orgbc87a17">
2020-01-12 00:19:16 +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">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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org4f572af" class="outline-3">
<h3 id="org4f572af">Receiving emails using mbsync</h3>
<div class="outline-text-3" id="text-org4f572af">
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">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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgd7ab730" class="outline-3">
<h3 id="orgd7ab730">Contexts</h3>
<div class="outline-text-3" id="text-orgd7ab730">
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">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>
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-3">(</span> ,<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">make-mu4e-context</span>
<span class="org-builtin">:name</span> <span class="org-string">"gmail"</span>
<span class="org-builtin">:enter-func</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">()</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">mu4e-message</span> <span class="org-string">"Switch to the gmail context"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:match-func</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">(</span>msg<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> msg
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">string-prefix-p</span> <span class="org-string">"/gmail"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">mu4e-message-field</span> msg <span class="org-builtin">:maildir</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:leave-func</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">()</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">mu4e-clear-caches</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:vars</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-variable-name">user-mail-address</span> . <span class="org-string">"dehaeze.thomas@gmail.com"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">user-full-name</span> . <span class="org-string">"Thomas Dehaeze"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">mu4e-sent-folder</span> . <span class="org-string">"/gmail/Sent"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">mu4e-trash-folder</span> . <span class="org-string">"/gmail/Trash"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">mu4e-drafts-folder</span> . <span class="org-string">"/gmail/Drafts"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">mu4e-refile-folder</span> . <span class="org-string">"/gmail/Archive"</span><span class="org-rainbow-delimiters-depth-3">)</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-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">make-mu4e-context</span>
<span class="org-builtin">:name</span> <span class="org-string">"esrf"</span>
<span class="org-builtin">:enter-func</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">()</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">mu4e-message</span> <span class="org-string">"Switch to the esrf context"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:match-func</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">(</span>msg<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> msg
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">string-prefix-p</span> <span class="org-string">"/esrf"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">mu4e-message-field</span> msg <span class="org-builtin">:maildir</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:leave-func</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">()</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">mu4e-clear-caches</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:vars</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-variable-name">user-mail-address</span> . <span class="org-string">"thomas.dehaeze@esrf.fr"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">user-full-name</span> . <span class="org-string">"Thomas Dehaeze"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">mu4e-sent-folder</span> . <span class="org-string">"/esrf/Sent"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">mu4e-trash-folder</span> . <span class="org-string">"/esrf/Trash"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">mu4e-drafts-folder</span> . <span class="org-string">"/esrf/Drafts"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">mu4e-refile-folder</span> . <span class="org-string">"/esrf/Archive"</span><span class="org-rainbow-delimiters-depth-3">)</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-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-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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org0f5f14d" class="outline-3">
<h3 id="org0f5f14d">Sending mails</h3>
<div class="outline-text-3" id="text-org0f5f14d">
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">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
2020-11-03 16:27:09 +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
2020-11-03 16:27:09 +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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgeb454c4" class="outline-3">
<h3 id="orgeb454c4">Bookmarks</h3>
<div class="outline-text-3" id="text-orgeb454c4">
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">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-bookmarks</span> <span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-3">(</span>,<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">make-mu4e-bookmark</span>
<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>
<span class="org-builtin">:key</span> ?i<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"flag:unread"</span> <span class="org-string">"Unread messages"</span> ?u<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"date:today..now"</span> <span class="org-string">"Today's messages"</span> ?t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"date:7d..now"</span> <span class="org-string">"Last 7 days"</span> ?w<span class="org-rainbow-delimiters-depth-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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
</div>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org0b90463" class="outline-2">
<h2 id="org0b90463">Doom <code>init.el</code></h2>
<div class="outline-text-2" id="text-org0b90463">
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">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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-05-26 08:40:15 +02:00
deft
2020-11-03 16:27:09 +01:00
hl-todo <span class="org-comment-delimiter">; </span><span class="org-comment">highlight </span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-comment">/</span><span class="org-bold"><span class="org-error">FIXME</span></span><span class="org-comment">/</span><span class="org-bold"><span class="org-success">NOTE</span></span><span class="org-comment">/</span><span class="org-bold"><span class="org-doc">DEPRECATED</span></span><span class="org-comment">/</span><span class="org-bold"><span class="org-constant">HACK</span></span><span class="org-comment">/</span><span class="org-bold"><span class="org-keyword">REVIEW</span></span>
2020-05-26 08:40:15 +02:00
hydra
2020-11-03 16:27:09 +01:00
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>
2020-05-26 08:40:15 +02:00
vterm
2020-11-03 16:27:09 +01:00
<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>
2020-05-26 08:40:15 +02:00
lsp
2020-11-03 16:27:09 +01:00
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>
2020-05-26 08:40:15 +02:00
eval
biblio
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span>lookup +dictionary<span class="org-rainbow-delimiters-depth-2">)</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<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>
spell <span class="org-comment-delimiter">; </span><span class="org-comment">tasing you for misspelling mispelling</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<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>
2020-05-26 08:40:15 +02:00
go
2020-11-03 16:27:09 +01:00
<span class="org-rainbow-delimiters-depth-2">(</span>javascript
+lsp<span class="org-rainbow-delimiters-depth-2">)</span>
latex <span class="org-comment-delimiter">; </span><span class="org-comment">writing papers in Emacs has never been so fun</span>
<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>
+roam <span class="org-comment-delimiter">;</span>
+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>
2020-05-26 08:40:15 +02:00
calendar
2020-11-03 16:27:09 +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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-builtin">:config</span>
2020-05-26 08:40:15 +02:00
literate
2020-11-03 16:27:09 +01:00
<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>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org973006b" class="outline-2">
<h2 id="org973006b">Doom <code>packages.el</code></h2>
<div class="outline-text-2" id="text-org973006b">
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">package!</span> poet-theme<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> spice-mode<span class="org-rainbow-delimiters-depth-1">)</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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> citeproc-org<span class="org-rainbow-delimiters-depth-1">)</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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-gcal<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(package! ox-latex-subfigure</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">:recipe (:host github :repo "linktohack/ox-latex-subfigure"))</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(package! matlab-mode)</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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-ref<span class="org-rainbow-delimiters-depth-1">)</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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-ql<span class="org-rainbow-delimiters-depth-1">)</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>
<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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> dired-narrow<span class="org-rainbow-delimiters-depth-1">)</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>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
2020-11-03 16:27:09 +01:00
<p class="date">Created: 2020-11-03 mar. 16:26</p>
2020-01-11 22:04:45 +01:00
</div>
</body>
</html>