literate-dotfiles/docs/doom/config.html

4403 lines
443 KiB
HTML
Raw Normal View History

2020-01-11 22:04:45 +01:00
<?xml version="1.0" encoding="utf-8"?>
<?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-01-11 22:22:46 +01:00
<!-- 2020-01-11 sam. 22:22 -->
2020-01-11 22:04:45 +01:00
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Doom Emacs Configuration</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="Dehaeze Thomas" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
</style>
2020-01-11 22:22:46 +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
<script type="text/javascript">
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
</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>
<li><a href="#orgdcad6df">Useful Bindings</a></li>
<li><a href="#org6974198">Personal Information</a></li>
<li><a href="#org26824d6">Doom Config</a></li>
<li><a href="#orgc2d3b64">Evil</a></li>
2020-01-11 22:22:46 +01:00
<li><a href="#orgc45e435">Basic</a>
2020-01-11 22:04:45 +01:00
<ul>
<li><a href="#org76f0197">Visual</a></li>
<li><a href="#org360759b">Change default alert backend</a></li>
<li><a href="#org65ee774">Lockfiles</a></li>
</ul>
</li>
<li><a href="#org0456c37">Magit</a></li>
2020-01-11 22:22:46 +01:00
<li><a href="#org898486f">Org Mode</a>
2020-01-11 22:04:45 +01:00
<ul>
<li><a href="#org51c888f">Make sure to load Org</a></li>
<li><a href="#org18e9423">Org General Config</a></li>
<li><a href="#org33228d1">Org latex fragment</a></li>
<li><a href="#orgda8f127">Org Links</a></li>
<li><a href="#org4de4efc">Org Tagging</a></li>
<li><a href="#org3a53b1e">Org Refile</a></li>
<li><a href="#org7f1ae10">Org TODO</a></li>
<li><a href="#org313f63a">Archive subtrees under the same hierarchy as original in the archive files</a></li>
<li><a href="#org69bde0d">Org Agenda</a>
<ul>
<li><a href="#org91308ad">General configuration</a></li>
<li><a href="#org01e7997">Org Agenda Custom Views</a></li>
</ul>
</li>
<li><a href="#orgffaad69">Org Notification based on calendar event</a>
<ul>
<li><a href="#org3d7b8b2">appt-notification script</a></li>
</ul>
</li>
<li><a href="#orgf1c1c06">Org Structure Template</a></li>
<li><a href="#orgb62a6da">Org Capture</a></li>
<li><a href="#org8e280ac">Org Export</a>
<ul>
2020-01-11 22:22:46 +01:00
<li><a href="#org0294672">Basic</a></li>
2020-01-11 22:04:45 +01:00
<li><a href="#org57a2dff">Ox Latex Subfigure package</a></li>
<li><a href="#orge6c06e3">Clear page before heading</a></li>
<li><a href="#orgd16b1f5"><span class="todo TODO">TODO</span> HTML Export</a>
<ul>
<li><a href="#org5984e85">MathJax</a></li>
<li><a href="#org1aab8b0">Export with css class instead of inline css</a></li>
<li><a href="#org323116f"><span class="todo TODO">TODO</span> MP4 movies</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#org240c4ac">Org LaTeX</a>
<ul>
<li><a href="#orgd28c8d1">Org CdLatex</a></li>
<li><a href="#org53bf303">LaTeX Classes</a></li>
2020-01-11 22:22:46 +01:00
<li><a href="#org7a618e0">Basic</a></li>
2020-01-11 22:04:45 +01:00
<li><a href="#orgc656325">Beamer</a></li>
<li><a href="#orge552217"><span class="todo TODO">TODO</span> Latex Fragments</a></li>
<li><a href="#org0ee127c"><span class="todo TODO">TODO</span> Custom Export - Add Page and Label for LaTeX export</a></li>
<li><a href="#org6cf7477">Number Equations</a></li>
</ul>
</li>
<li><a href="#org2a54be6"><span class="todo TODO">TODO</span> View PDF in org mode</a></li>
<li><a href="#org3a0aab7">Org Ref</a></li>
<li><a href="#orgacb01d5">Org Noter</a></li>
<li><a href="#orgb2514c1">Custom key bindings</a></li>
<li><a href="#org866e476"><span class="todo TODO">TODO</span> Org-Contacts</a></li>
<li><a href="#org357bec6"><span class="todo TODO">TODO</span> Org-Wunderlist</a></li>
<li><a href="#orga2cf41a">Automatically run <code>startblock</code> when opening org-mode files</a></li>
<li><a href="#org5e76baa"><span class="todo TODO">TODO</span> Insert ScreenShot or Picture from Phone</a></li>
<li><a href="#orgdb8e701"><span class="todo TODO">TODO</span> Render Tables</a></li>
<li><a href="#org4f669e4">Org Gcal</a></li>
</ul>
</li>
<li><a href="#org84cbed1">Org Babel</a>
<ul>
<li><a href="#org572c6f8">Main configuration</a></li>
<li><a href="#org2a87b1a">Special Shortcuts</a></li>
<li><a href="#org525beff">Library of Babel</a></li>
<li><a href="#org8058e80">Org-Babel Matlab</a></li>
<li><a href="#org716f877">Default options for Matlab code</a></li>
<li><a href="#org58e84ea"><span class="todo TODO">TODO</span> Asynchronous execution</a></li>
<li><a href="#org0cd0e74"><span class="todo TODO">TODO</span> Theme</a></li>
<li><a href="#org0852213">Indentation</a></li>
<li><a href="#org1a39ee2">Some functions for using Matlab with Org Babel</a>
<ul>
<li><a href="#org752327c"><code>whos</code> matlab function</a></li>
<li><a href="#orgccdb065"><code>help</code> matlab function</a></li>
<li><a href="#org564dcf6">Execute selected text</a></li>
<li><a href="#org4882995">Specify a Matlab command to run</a></li>
<li><a href="#org8c02cc5">Execute the current source block with no output</a></li>
<li><a href="#org5cdfcf6">Execute the source block and go to the next one</a></li>
<li><a href="#org45552c3">Org-Babel Tangle Subtree</a></li>
<li><a href="#org7425511">Org-Babel Jump to Tangle File</a></li>
<li><a href="#org9441f02">Org-Babel Tangle File and Execute</a></li>
</ul>
</li>
</ul>
</li>
2020-01-11 22:22:46 +01:00
<li><a href="#orgce9ebe6">LaTeX</a>
2020-01-11 22:04:45 +01:00
<ul>
<li><a href="#org5eef3c6">Basic LaTeX configuration</a></li>
<li><a href="#org0df299f">Master file</a></li>
<li><a href="#orgef2ee65">Pdf Viewer</a></li>
</ul>
</li>
2020-01-11 22:22:46 +01:00
<li><a href="#org236456d">Helm-Bibtex</a>
2020-01-11 22:04:45 +01:00
<ul>
<li><a href="#orgce7c4cf">General Config</a></li>
<li><a href="#orgd565023">Open pdf externally</a></li>
<li><a href="#org8307ae1">Special Commands</a></li>
<li><a href="#org35c0535">List all element of the bibliography without pdf associated</a></li>
</ul>
</li>
2020-01-11 22:22:46 +01:00
<li><a href="#org96f469b"><span class="todo TODO">TODO</span> Matlab</a>
2020-01-11 22:04:45 +01:00
<ul>
<li><a href="#orga556b70">Setup Matlab Mode</a></li>
<li><a href="#org9a5923a">Setup Flycheck</a></li>
<li><a href="#org3d0effc"><span class="todo TODO">TODO</span> Setup Company - not working</a></li>
<li><a href="#org22063fd"><span class="todo TODO">TODO</span> Beautify code</a></li>
<li><a href="#org8c111a1">Key Bindings</a></li>
<li><a href="#orgf28fce3">Wrong highlight of comments</a></li>
</ul>
</li>
<li><a href="#orgc9f203c"><span class="todo TODO">TODO</span> Mails With Mu4e</a>
<ul>
<li><a href="#org6c54d87">Set default mail user agent to mu4e</a></li>
<li><a href="#orga2126a4">Default config</a>
<ul>
<li><a href="#org5d80b48">Default behavior</a></li>
<li><a href="#orgdf61747">Default folders</a></li>
<li><a href="#orgf57030d">Default signature and email address</a></li>
<li><a href="#orgad9cf03">Saving the attachment to Downloads directory</a></li>
<li><a href="#orgda5d5f6">A list of user&rsquo;s e-mail addresses</a></li>
<li><a href="#orgfe31f50">Mail directory shortcuts</a></li>
</ul>
</li>
<li><a href="#orgf6a8676"><span class="todo TODO">TODO</span> Contexts - Email accounts</a></li>
<li><a href="#orgf1ec656">Receiving emails - Mbsync</a></li>
<li><a href="#org93aa81c">Sending emails - Msmtp</a></li>
<li><a href="#org56fed03">Bookmarks</a></li>
<li><a href="#orgf03113f"><span class="todo TODO">TODO</span> Notifications</a></li>
<li><a href="#orge85d0b3">Use Org-Mode Tables In Emails</a></li>
<li><a href="#orge21bdce"><span class="todo TODO">TODO</span> Integration with Org-Mode</a></li>
<li><a href="#orgab99aec"><span class="todo TODO">TODO</span> When putting something on the Trash, it will be in the archive folder on gmail</a></li>
<li><a href="#orgb7198c3"><span class="todo TODO">TODO</span> Verify that sending mails with gmail account works and that there is no duplicate</a></li>
<li><a href="#org95b0dd9"><span class="todo TODO">TODO</span> Cheatsheet</a></li>
</ul>
</li>
<li><a href="#org2844b83">PDF-Tools</a></li>
<li><a href="#org5aa0513">Custom command and leader keys</a>
<ul>
<li><a href="#org5375daf">Watch LaTeX file using latexmk</a></li>
2020-01-11 22:22:46 +01:00
<li><a href="#org5558146">Helm-Bibtex</a></li>
2020-01-11 22:04:45 +01:00
<li><a href="#org41e47d1">Open terminal in current directory</a></li>
<li><a href="#org5ed8af0">Open ranger in current directory</a></li>
</ul>
</li>
<li><a href="#org608a8a8">Yassnippets</a></li>
<li><a href="#org31414b1">Path for Shell</a></li>
<li><a href="#orgb2770dd">Proxy</a></li>
<li><a href="#org65e9b0d"><span class="todo TODO">TODO</span> Slack</a></li>
<li><a href="#org567fc7b"><span class="todo TODO">TODO</span> Neomutt connection</a></li>
<li><a href="#org217ae13">Abbreviations</a></li>
<li><a href="#org9485a30">Other</a></li>
<li><a href="#orgfe6edb2">Snippets</a>
<ul>
2020-01-11 22:22:46 +01:00
<li><a href="#org045da24">LaTeX</a>
2020-01-11 22:04:45 +01:00
<ul>
<li><a href="#orge7be203">Coordinate</a></li>
<li><a href="#org85fe854">Draw</a></li>
<li><a href="#org20756a3">Node</a></li>
<li><a href="#orgc1d5a0e">Path</a></li>
</ul>
</li>
2020-01-11 22:22:46 +01:00
<li><a href="#org98458a3">Matlab</a>
2020-01-11 22:04:45 +01:00
<ul>
<li><a href="#org7c48930">Clear</a></li>
<li><a href="#org2014103">Function</a></li>
</ul>
</li>
2020-01-11 22:22:46 +01:00
<li><a href="#org7c4e9b0">Org Mode</a>
2020-01-11 22:04:45 +01:00
<ul>
<li><a href="#orga2e53df">Begin</a></li>
<li><a href="#org72aba26">Block</a></li>
<li><a href="#orgf93a88e">Custom Box</a></li>
<li><a href="#org9bc409b">Latex Class</a></li>
<li><a href="#org53dd3a0">Name Caption Figure</a></li>
<li><a href="#org3b14c56">Bibliography with completion</a></li>
<li><a href="#org1219714">Cite</a></li>
<li><a href="#org41c8702">Ref</a></li>
<li><a href="#org2f6e626">Beamer - CBOX</a></li>
<li><a href="#org9081798">Code</a></li>
<li><a href="#orga87f155">Equation</a></li>
<li><a href="#org3ea2dea">Figure</a></li>
<li><a href="#org703a145">Frac</a></li>
<li><a href="#org58438c7">Left</a></li>
<li><a href="#org92d0938">Mconfig</a></li>
<li><a href="#org13add5e">Mdescription</a></li>
<li><a href="#org417fc63">Mfigure</a></li>
<li><a href="#org6a37b47">Mfunction</a></li>
<li><a href="#org7b94a12">Mheader</a></li>
<li><a href="#org417513f">Minipage</a></li>
<li><a href="#orgd3bfb9a">Minit</a></li>
<li><a href="#orgc6f45a3">Mtable</a></li>
<li><a href="#orgecc8e5f">Multicolumn</a></li>
<li><a href="#org923ba96">Subfigure</a></li>
<li><a href="#org40f613b">Table</a></li>
<li><a href="#org2e611fc">Tikz</a></li>
<li><a href="#org5fc10a4">Tikzfig</a></li>
<li><a href="#orgae9990f">Tikzheader</a></li>
<li><a href="#orgb79a363">User-config</a></li>
<li><a href="#orgb563f74">User-init</a></li>
<li><a href="#org8723da7">Wrap</a></li>
<li><a href="#org41d3ff5">Latex</a>
<ul>
<li><a href="#org30f241c">Integral</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</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>
</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>
<div id="outline-container-orgdcad6df" class="outline-2">
<h2 id="orgdcad6df">Useful Bindings</h2>
<div class="outline-text-2" id="text-orgdcad6df">
<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"><code>spc :</code></th>
<th scope="col" class="org-left">Execute command</th>
</tr>
<tr>
<th scope="col" class="org-left"><code>spc &lt;</code></th>
<th scope="col" class="org-left">Switch to buffer</th>
</tr>
<tr>
<th scope="col" class="org-left"><code>spc X</code></th>
<th scope="col" class="org-left">org-capture</th>
</tr>
</thead>
<tbody>
<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>
</tbody>
<tbody>
<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>
</tbody>
<tbody>
<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>
</tbody>
<tbody>
<tr>
<td class="org-left"><code>spc n l</code></td>
<td class="org-left">Store link</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><code>spc g g</code></td>
<td class="org-left">Magit status</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><code>spc f r</code></td>
<td class="org-left">Open recent file</td>
</tr>
</tbody>
<tbody>
<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>
</tbody>
<tbody>
<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>
</tbody>
<tbody>
<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>
<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">C-c C-v p</td>
<td class="org-left">org-babel-previous-src-block</td>
</tr>
<tr>
<td class="org-left">C-c C-v n</td>
<td class="org-left">org-babel-next-src-block</td>
</tr>
<tr>
<td class="org-left">C-c C-v e</td>
<td class="org-left">org-babel-execute-maybe</td>
</tr>
<tr>
<td class="org-left">C-c C-v o</td>
<td class="org-left">org-babel-open-src-block-result</td>
</tr>
<tr>
<td class="org-left">C-c C-v v</td>
<td class="org-left">org-babel-expand-src-block</td>
</tr>
<tr>
<td class="org-left">C-c C-v u</td>
<td class="org-left">org-babel-goto-src-block-head</td>
</tr>
<tr>
<td class="org-left">C-c C-v g</td>
<td class="org-left">org-babel-goto-named-src-block</td>
</tr>
<tr>
<td class="org-left">C-c C-v r</td>
<td class="org-left">org-babel-goto-named-result</td>
</tr>
<tr>
<td class="org-left">C-c C-v b</td>
<td class="org-left">org-babel-execute-buffer</td>
</tr>
<tr>
<td class="org-left">C-c C-v s</td>
<td class="org-left">org-babel-execute-subtree</td>
</tr>
<tr>
<td class="org-left">C-c C-v d</td>
<td class="org-left">org-babel-demarcate-block</td>
</tr>
<tr>
<td class="org-left">C-c C-v t</td>
<td class="org-left">org-babel-tangle</td>
</tr>
<tr>
<td class="org-left">C-c C-v f</td>
<td class="org-left">org-babel-tangle-file</td>
</tr>
<tr>
<td class="org-left">C-c C-v c</td>
<td class="org-left">org-babel-check-src-block</td>
</tr>
<tr>
<td class="org-left">C-c C-v j</td>
<td class="org-left">org-babel-insert-header-arg</td>
</tr>
<tr>
<td class="org-left">C-c C-v l</td>
<td class="org-left">org-babel-load-in-session</td>
</tr>
<tr>
<td class="org-left">C-c C-v i</td>
<td class="org-left">org-babel-lob-ingest</td>
</tr>
<tr>
<td class="org-left">C-c C-v I</td>
<td class="org-left">org-babel-view-src-block-info</td>
</tr>
<tr>
<td class="org-left">C-c C-v z</td>
<td class="org-left">org-babel-switch-to-session-with-code</td>
</tr>
<tr>
<td class="org-left">C-c C-v a</td>
<td class="org-left">org-babel-sha1-hash</td>
</tr>
<tr>
<td class="org-left">C-c C-v h</td>
<td class="org-left">org-babel-describe-bindings</td>
</tr>
<tr>
<td class="org-left">C-c C-v x</td>
<td class="org-left">org-babel-do-key-sequence-in-edit-buffer</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-org6974198" class="outline-2">
<h2 id="org6974198">Personal Information</h2>
<div class="outline-text-2" id="text-org6974198">
<div class="org-src-container">
<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>
</pre>
</div>
</div>
</div>
<div id="outline-container-org26824d6" class="outline-2">
<h2 id="org26824d6">Doom Config</h2>
<div class="outline-text-2" id="text-org26824d6">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">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>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">There are two ways to load a theme. Both assume the theme is installed and</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">available. You can either set `</span><span class="org-comment"><span class="org-constant">doom-theme</span></span><span class="org-comment">' or manually load a theme with the</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">`</span><span class="org-comment"><span class="org-constant">load-theme</span></span><span class="org-comment">' function. These are the defaults.</span>
<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>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">display-line-numbers-type</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc2d3b64" class="outline-2">
<h2 id="orgc2d3b64">Evil</h2>
<div class="outline-text-2" id="text-orgc2d3b64">
<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> 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>
</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">map!</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:after</span> evil
<span class="org-builtin">:en</span> <span class="org-string">"C-h"</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">evil-window-left</span>
<span class="org-builtin">:en</span> <span class="org-string">"C-j"</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">evil-window-down</span>
<span class="org-builtin">:en</span> <span class="org-string">"C-k"</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">evil-window-up</span>
<span class="org-builtin">:en</span> <span class="org-string">"C-l"</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">evil-window-right</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">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>
</pre>
</div>
</div>
</div>
2020-01-11 22:22:46 +01:00
<div id="outline-container-orgc45e435" class="outline-2">
<h2 id="orgc45e435">Basic</h2>
<div class="outline-text-2" id="text-orgc45e435">
2020-01-11 22:04:45 +01:00
</div>
<div id="outline-container-org76f0197" class="outline-3">
<h3 id="org76f0197">Visual</h3>
<div class="outline-text-3" id="text-org76f0197">
<p>
Automatic line wrap.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">global-visual-line-mode</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<p>
Turn off auto-fill mode that add line breaks.
</p>
<div class="org-src-container">
<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>
</pre>
</div>
</div>
</div>
<div id="outline-container-org360759b" class="outline-3">
<h3 id="org360759b">Change default alert backend</h3>
<div class="outline-text-3" id="text-org360759b">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> alert-default-style <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">libnotify</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org65ee774" class="outline-3">
<h3 id="org65ee774">Lockfiles</h3>
<div class="outline-text-3" id="text-org65ee774">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">create-lockfiles</span> nil<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org0456c37" class="outline-2">
<h2 id="org0456c37">Magit</h2>
<div class="outline-text-2" id="text-org0456c37">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">setenv</span> <span class="org-string">"GIT_ASKPASS"</span> <span class="org-string">"git-gui--askpass"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">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-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-11 22:22:46 +01:00
<div id="outline-container-org898486f" class="outline-2">
<h2 id="org898486f">Org Mode</h2>
<div class="outline-text-2" id="text-org898486f">
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>
<div id="outline-container-org51c888f" class="outline-3">
<h3 id="org51c888f">Make sure to load Org</h3>
<div class="outline-text-3" id="text-org51c888f">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">org</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org18e9423" class="outline-3">
<h3 id="org18e9423">Org General Config</h3>
<div class="outline-text-3" id="text-org18e9423">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-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">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-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Highligh latex parts in org mode</span>
<span class="org-rainbow-delimiters-depth-1">(</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-2">(</span>native<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">The following setting hides blank lines between headings which keeps folded view nice and compact.</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Indent according to the outline structure</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-startup-indented</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<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-1">(</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-1">)</span>
</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">
<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>
</pre>
</div>
</div>
</div>
<div id="outline-container-org33228d1" class="outline-3">
<h3 id="org33228d1">Org latex fragment</h3>
<div class="outline-text-3" id="text-org33228d1">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-highlight-latex-and-related</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>native<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">defvar</span> <span class="org-variable-name">tdh/org-latex-fragment-last</span> nil
<span class="org-doc">"Holds last fragment/environment you were on."</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/org-in-latex-fragment-p</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Return the point where the latex fragment begins, if inside</span>
<span class="org-doc"> a latex fragment. Else return false"</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>el <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-context</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>el-type <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> el<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">and</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-constant">eq</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">latex-fragment</span> el-type<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">eq</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">latex-environment</span> el-type<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-element-property</span> <span class="org-builtin">:begin</span> el<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">tdh/org-latex-fragment-toggle</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Toggle a latex fragment image "</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">eq</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-mode</span> <span class="org-variable-name">major-mode</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">tdh/org-in-latex-fragment-p</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">cond</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">were on a fragment and now on a new fragment</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">fragment we were on</span>
<span class="org-variable-name">tdh/org-latex-fragment-last</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">and are on a fragment now</span>
begin
<span class="org-comment-delimiter">;; </span><span class="org-comment">but not on the last one this is a little tricky. as you edit the</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">fragment, it is not equal to the last one. We use the begin</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">property which is less likely to change for the comparison.</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-keyword">and</span> <span class="org-variable-name">tdh/org-latex-fragment-last</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">=</span> begin
<span class="org-variable-name">tdh/org-latex-fragment-last</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">go back to last one and put image back, provided there is still a fragment there</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">goto-char</span> <span class="org-variable-name">tdh/org-latex-fragment-last</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">tdh/org-in-latex-fragment-p</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-preview-latex-fragment</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">now remove current image</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">goto-char</span> begin<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>ov <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">loop</span> for ov in <span class="org-rainbow-delimiters-depth-2">(</span>org--list-latex-overlays<span class="org-rainbow-delimiters-depth-2">)</span>
if
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">and</span>
r <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">&lt;=</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-start</span> ov<span class="org-rainbow-delimiters-depth-1">)</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-3">(</span><span class="org-constant">&gt;=</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-end</span> ov<span class="org-rainbow-delimiters-depth-1">)</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>
return ov<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> ov
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">delete-overlay</span> ov<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">and save new fragment</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">tdh/org-latex-fragment-last</span> begin<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">were on a fragment and now are not on a fragment</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">not on a fragment now</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">not</span> begin<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">but we were on one</span>
<span class="org-variable-name">tdh/org-latex-fragment-last</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">put image back on, provided that there is still a fragment here.</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">goto-char</span> <span class="org-variable-name">tdh/org-latex-fragment-last</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">tdh/org-in-latex-fragment-p</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-preview-latex-fragment</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">unset last fragment</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">tdh/org-latex-fragment-last</span> nil<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">were not on a fragment, and now are</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">we were not one one</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">not</span> <span class="org-variable-name">tdh/org-latex-fragment-last</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">but now we are</span>
begin<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">remove image</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">goto-char</span> begin<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>ov <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">loop</span> for ov in <span class="org-rainbow-delimiters-depth-2">(</span>org--list-latex-overlays<span class="org-rainbow-delimiters-depth-2">)</span>
if
<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">&lt;=</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-start</span> ov<span class="org-rainbow-delimiters-depth-1">)</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-3">(</span><span class="org-constant">&gt;=</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-end</span> ov<span class="org-rainbow-delimiters-depth-1">)</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>
return ov<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> ov
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">delete-overlay</span> ov<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> <span class="org-variable-name">tdh/org-latex-fragment-last</span> begin<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>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgda8f127" class="outline-3">
<h3 id="orgda8f127">Org Links</h3>
<div class="outline-text-3" id="text-orgda8f127">
<div class="org-src-container">
<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">org-mode-map</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-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org4de4efc" class="outline-3">
<h3 id="org4de4efc">Org Tagging</h3>
<div class="outline-text-3" id="text-org4de4efc">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Align Tags and flush right</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-tags-column</span> <span class="org-highlight-numbers-number">-80</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Tags with fast selection keys</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-tag-alist</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">quote</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"@home"</span> . ?h<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"@work"</span> . ?w<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"@christophe"</span> . ?c<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"@veijo"</span> . ?v<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</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-org3a53b1e" class="outline-3">
<h3 id="org3a53b1e">Org Refile</h3>
<div class="outline-text-3" id="text-org3a53b1e">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-refile-targets</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">org-agenda-files</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:maxlevel</span> . <span class="org-highlight-numbers-number">6</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</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-org7f1ae10" class="outline-3">
<h3 id="org7f1ae10">Org TODO</h3>
<div class="outline-text-3" id="text-org7f1ae10">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Tags with fast selection keys</span>
<span class="org-rainbow-delimiters-depth-1">(</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-2">(</span>
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</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-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">Display of the keywords</span>
<span class="org-rainbow-delimiters-depth-1">(</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-2">(</span><span class="org-rainbow-delimiters-depth-3">(</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-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"EXER"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"NEXT"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"MAIL"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"READ"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"ANSW"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#689d6a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">aqua</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"DONE"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#689d6a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">aqua</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"WAIT"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#d65d0e"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">orange</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"QUES"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#d79921"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">yellow</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"CANC"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#a89984"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">grey</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"SDAY"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#98971a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">green</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"BKMK"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#98971a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">green</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"IDEA"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#98971a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">green</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"EXAM"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#98971a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-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">green</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org313f63a" class="outline-3">
<h3 id="org313f63a">Archive subtrees under the same hierarchy as original in the archive files</h3>
<div class="outline-text-3" id="text-org313f63a">
<p>
<a href="https://gist.github.com/Fuco1/e86fb5e0a5bb71ceafccedb5ca22fcfb">https://gist.github.com/Fuco1/e86fb5e0a5bb71ceafccedb5ca22fcfb</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">defadvice</span> <span class="org-function-name">org-archive-subtree</span> <span class="org-rainbow-delimiters-depth-2">(</span>around fix-hierarchy activate<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>fix-archive-p <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">not</span> <span class="org-variable-name">current-prefix-arg</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">use-region-p</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>location <span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>afile <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> location<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>offset <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">=</span> <span class="org-highlight-numbers-number">0</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">length</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> location<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-highlight-numbers-number">1</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">1+</span> <span class="org-rainbow-delimiters-depth-1">(</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-2">(</span><span class="org-constant">cdr</span> location<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>buffer <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">or</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">find-buffer-visiting</span> afile<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">find-file-noselect</span> afile<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
ad-do-it
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> fix-archive-p
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">with-current-buffer</span> buffer
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">point-max</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">&gt;</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-current-level</span><span class="org-rainbow-delimiters-depth-1">)</span> offset<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-up-heading-safe</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>olpath <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-entry-get</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-string">"ARCHIVE_OLPATH"</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>path <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">and</span> olpath <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">split-string</span> olpath <span class="org-string">"/"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>level offset<span class="org-rainbow-delimiters-depth-1">)</span>
tree-text<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> olpath
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-mark-subtree</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> tree-text <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">buffer-substring</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">region-beginning</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">region-end</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">this-command</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-cut-subtree</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> <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">save-restriction</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">widen</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">-each</span> path
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">(</span>heading<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">re-search-forward</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">rx-to-string</span>
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-1">(</span>: bol <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">repeat</span> ,level <span class="org-string">"*"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">1+</span> <span class="org-string">" "</span><span class="org-rainbow-delimiters-depth-2">)</span> ,heading<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-warning">nil t</span><span class="org-warning"><span class="org-rainbow-delimiters-depth-2">)</span></span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-narrow-to-subtree</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-max</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">unless</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-3">(</span><span class="org-constant">insert</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-2">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">make-string</span> level ?*<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-string">" "</span>
heading
<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-keyword">cl-incf</span> level<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">widen</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-end-of-subtree</span> t t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-paste-subtree</span> level tree-text<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>
</pre>
</div>
</div>
</div>
<div id="outline-container-org69bde0d" class="outline-3">
<h3 id="org69bde0d">Org Agenda</h3>
<div class="outline-text-3" id="text-org69bde0d">
</div>
<div id="outline-container-org91308ad" class="outline-4">
<h4 id="org91308ad">General configuration</h4>
<div class="outline-text-4" id="text-org91308ad">
<div class="org-src-container">
<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">org-mode-map</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-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">File to save todo items</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-files</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-string">"~/Cloud/org/"</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">Include archived files</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-archives-mode</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Set priority range from A to C with default A</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-highest-priority</span> ?A<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">org-lowest-priority</span> ?C<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">org-default-priority</span> ?C<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Set colours for priorities</span>
<span class="org-rainbow-delimiters-depth-1">(</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-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>?A . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#CC241D"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>?B . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#D65D0E"</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>?C . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#D79921"</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-comment-delimiter">;; </span><span class="org-comment">Open agenda in current window</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</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-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>agenda . <span class="org-string">" %-12:c %?-12t% s"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>todo . <span class="org-string">""</span><span class="org-rainbow-delimiters-depth-3">)</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-3">(</span>tags . <span class="org-string">" %-12:c"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">search</span> . <span class="org-string">" %-12:c"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</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-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">File to save todo items</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-files</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-string">"~/Cloud/org/"</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">Include archived files</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-archives-mode</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Set priority range from A to C with default A</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-highest-priority</span> ?A<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">org-lowest-priority</span> ?C<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">org-default-priority</span> ?C<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Set colours for priorities</span>
<span class="org-rainbow-delimiters-depth-1">(</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-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>?A . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#CC241D"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>?B . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#D65D0E"</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>?C . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#D79921"</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-comment-delimiter">;; </span><span class="org-comment">Open agenda in current window</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</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-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>agenda . <span class="org-string">" %-12:c %?-12t% s"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>todo . <span class="org-string">""</span><span class="org-rainbow-delimiters-depth-3">)</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-3">(</span>tags . <span class="org-string">" %-12:c"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">search</span> . <span class="org-string">" %-12:c"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org01e7997" class="outline-4">
<h4 id="org01e7997">Org Agenda Custom Views</h4>
<div class="outline-text-4" id="text-org01e7997">
<p>
<a href="https://blog.aaronbieber.com/2016/09/24/an-agenda-for-life-with-org-mode.html">https://blog.aaronbieber.com/2016/09/24/an-agenda-for-life-with-org-mode.html</a>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-agenda-skip-scheduled</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-custom-commands</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">"w"</span> <span class="org-string">"Work"</span> tags-todo <span class="org-string">"@work"</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">All todos related to work</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"h"</span> <span class="org-string">"Home"</span> tags-todo <span class="org-string">"@home"</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">All todos not related to work</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"q"</span> . <span class="org-string">"Questions to ask"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"qc"</span> <span class="org-string">"Questions to Cristophe"</span> tags <span class="org-string">"@christophe/QUES"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <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-string">"qm"</span> <span class="org-string">"Questions to Muriel"</span> tags <span class="org-string">"@muriel/QUES"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Questions to Muriel"</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-string">"qo"</span> <span class="org-string">"Questions to Olivier"</span> tags <span class="org-string">"@olivier/QUES"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Questions to Olivier"</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-string">"qq"</span> <span class="org-string">"All questions"</span> tags <span class="org-string">"/QUES"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <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-3">(</span><span class="org-string">"n"</span> <span class="org-string">"Next things to do"</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>tags <span class="org-string">"+PRIORITY+\"A\""</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">org-agenda-skip-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>org-agenda-skip-entry-if <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">todo</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">done</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"High-priority unfinished tasks:"</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>agenda <span class="org-string">""</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"NEXT"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">org-agenda-skip-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/org-agenda-skip-scheduled</span><span class="org-rainbow-delimiters-depth-1">)(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Next thing to do that are not scheduled"</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>todo <span class="org-string">"MAIL"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Email to write/reply"</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>todo <span class="org-string">"WAIT"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Things Waiting"</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-string">"u"</span> <span class="org-string">"Unscheduled tasks"</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-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-skip-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/org-agenda-skip-scheduled</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Unscheduled </span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-string"> entries: "</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-string">"r"</span> <span class="org-string">"Things to read"</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"READ"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Things to read"</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-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-files</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"~/Cloud/thesis/ressources/notes/"</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>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgffaad69" class="outline-3">
<h3 id="orgffaad69">Org Notification based on calendar event</h3>
<div class="outline-text-3" id="text-orgffaad69">
<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">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">my-org-agenda-to-appt</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> appt-time-msg-list nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-agenda-to-appt</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">my-org-agenda-to-appt</span><span class="org-rainbow-delimiters-depth-1">)</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-1">(</span><span class="org-keyword">setq</span> appt-disp-window-function <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">my-appt-display</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> appt-delete-window-function <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">()</span> t<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> my-appt-notification-app <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">getenv</span> <span class="org-string">"HOME"</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-string">"/bin/appt-notification"</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">my-appt-display</span> <span class="org-rainbow-delimiters-depth-2">(</span>min-to-app new-time msg<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">atom</span> min-to-app<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">start-process</span> <span class="org-string">"my-appt-notification-app"</span> nil my-appt-notification-app min-to-app msg<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>i <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">number-sequence</span> <span class="org-highlight-numbers-number">0</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">1-</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">length</span> min-to-app<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">start-process</span> <span class="org-string">"my-appt-notification-app"</span> nil my-appt-notification-app <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> i min-to-app<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> i msg<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
<div id="outline-container-org3d7b8b2" class="outline-4">
<h4 id="org3d7b8b2">appt-notification script</h4>
<div class="outline-text-4" id="text-org3d7b8b2">
<div class="org-src-container">
<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>
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>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgf1c1c06" class="outline-3">
<h3 id="orgf1c1c06">Org Structure Template</h3>
<div class="outline-text-3" id="text-orgf1c1c06">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-structure-template-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">"c"</span> . <span class="org-string">"center"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"C"</span> . <span class="org-string">"comment"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"i"</span> . <span class="org-string">"important"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"e"</span> . <span class="org-string">"example"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"q"</span> . <span class="org-string">"quote"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"s"</span> . <span class="org-string">"src"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb62a6da" class="outline-3">
<h3 id="orgb62a6da">Org Capture</h3>
<div class="outline-text-3" id="text-orgb62a6da">
<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">
<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">org-mode-map</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-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-capture-templates</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">quote</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"t"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">key</span>
<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-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Inbox"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">target</span>
<span class="org-string">"** </span><span class="org-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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"M"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">key</span>
<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-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Meetings"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">target</span>
<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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"m"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">key</span>
<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-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Mails"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">target</span>
<span class="org-string">"** </span><span class="org-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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pm"</span>
<span class="org-string">"Org-Protocol Mail"</span>
entry
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Mails"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-string">"* 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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pu"</span>
<span class="org-string">"Org-Protocol Url"</span>
entry
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Inbox"</span><span class="org-rainbow-delimiters-depth-2">)</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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pt"</span>
<span class="org-string">"Org-Protocol text"</span>
entry
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Inbox"</span><span class="org-rainbow-delimiters-depth-2">)</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-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>
</div>
</div>
<div id="outline-container-org8e280ac" class="outline-3">
<h3 id="org8e280ac">Org Export</h3>
<div class="outline-text-3" id="text-org8e280ac">
</div>
2020-01-11 22:22:46 +01:00
<div id="outline-container-org0294672" class="outline-4">
<h4 id="org0294672">Basic</h4>
<div class="outline-text-4" id="text-org0294672">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">How many levels of headline to export</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Authorize BIND to set local variables</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<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-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">ox-extra</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">ox-extras-activate</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>ignore-headlines<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org57a2dff" class="outline-4">
<h4 id="org57a2dff">Ox Latex Subfigure package</h4>
<div class="outline-text-4" id="text-org57a2dff">
<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">: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>
</pre>
</div>
</div>
</div>
<div id="outline-container-orge6c06e3" class="outline-4">
<h4 id="orge6c06e3">Clear page before heading</h4>
<div class="outline-text-4" id="text-orge6c06e3">
<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">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">org/get-headline-string-element</span> <span class="org-rainbow-delimiters-depth-2">(</span>headline backend info<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>prop-point <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">next-property-change</span> <span class="org-highlight-numbers-number">0</span> headline<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> prop-point <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">plist-get</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">text-properties-at</span> prop-point headline<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-builtin">:parent</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-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">org/ensure-latex-clearpage</span> <span class="org-rainbow-delimiters-depth-2">(</span>headline backend info<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-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-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>elmnt <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org/get-headline-string-element</span> headline backend info<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">and</span> elmnt <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:CLEARPAGE</span> elmnt<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-string">"\\clearpage\n"</span> headline<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-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">org/ensure-latex-clearpage</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgd16b1f5" class="outline-4">
<h4 id="orgd16b1f5"><span class="todo TODO">TODO</span> HTML Export</h4>
<div class="outline-text-4" id="text-orgd16b1f5">
</div>
<div id="outline-container-org5984e85" class="outline-5">
<h5 id="org5984e85">MathJax</h5>
<div class="outline-text-5" id="text-org5984e85">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-mathjax-template</span>
<span class="org-string">"&lt;script type=\"text/x-mathjax-config\"&gt;</span>
<span class="org-string"> MathJax.Hub.Config({</span>
<span class="org-string"> displayAlign: \"%ALIGN\",</span>
<span class="org-string"> displayIndent: \"%INDENT\",</span>
<span class="org-string"> \"HTML-CSS\": { scale: %SCALE,</span>
<span class="org-string"> linebreaks: { automatic: \"%LINEBREAKS\" },</span>
<span class="org-string"> webFont: \"%FONT\"</span>
<span class="org-string"> },</span>
<span class="org-string"> SVG: {scale: %SCALE,</span>
<span class="org-string"> linebreaks: { automatic: \"%LINEBREAKS\" },</span>
<span class="org-string"> font: \"%FONT\"},</span>
<span class="org-string"> NativeMML: {scale: %SCALE},</span>
<span class="org-string"> TeX: { equationNumbers: {autoNumber: \"%AUTONUMBER\"},</span>
<span class="org-string"> MultLineWidth: \"%MULTLINEWIDTH\",</span>
<span class="org-string"> TagSide: \"%TAGSIDE\",</span>
<span class="org-string"> TagIndent: \"%TAGINDENT\",</span>
<span class="org-string"> Macros: {</span>
<span class="org-string"> bm: [\"{\\\\boldsymbol #1}\",1],</span>
<span class="org-string"> }</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\"</span>
<span class="org-string"> src=\"%PATH\"&gt;&lt;/script&gt;"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org1aab8b0" class="outline-5">
<h5 id="org1aab8b0">Export with css class instead of inline css</h5>
<div class="outline-text-5" id="text-org1aab8b0">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-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-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org323116f" class="outline-5">
<h5 id="org323116f"><span class="todo TODO">TODO</span> MP4 movies</h5>
<div class="outline-text-5" id="text-org323116f">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-html5-fancy</span> t<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">org-html-doctype</span> <span class="org-string">"xhtml-strict"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="outline-container-org240c4ac" class="outline-3">
<h3 id="org240c4ac">Org LaTeX</h3>
<div class="outline-text-3" id="text-org240c4ac">
</div>
<div id="outline-container-orgd28c8d1" class="outline-4">
<h4 id="orgd28c8d1">Org CdLatex</h4>
<div class="outline-text-4" id="text-orgd28c8d1">
<p>
<a href="https://orgmode.org/manual/CDLaTeX-mode.html#CDLaTeX-mode">https://orgmode.org/manual/CDLaTeX-mode.html#CDLaTeX-mode</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">push</span> <span class="org-string">"~/.config/doom/local/"</span> <span class="org-variable-name">load-path</span><span class="org-rainbow-delimiters-depth-1">)</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">cdlatex</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">turn-on-org-cdlatex</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org53bf303" class="outline-4">
<h4 id="org53bf303">LaTeX Classes</h4>
<div class="outline-text-4" id="text-org53bf303">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><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-1">(</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-2">(</span><span class="org-string">"beamer"</span>
,<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</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">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-2">(</span><span class="org-string">"clean-cheatsheet"</span>
<span class="org-string">"\\documentclass{clean-cheatsheet}"</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</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">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-2">(</span><span class="org-string">"clean-beamer"</span>
<span class="org-string">"\\documentclass{clean-beamer}"</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</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">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-2">(</span><span class="org-string">"cleanreport"</span>
<span class="org-string">"\\documentclass{cleanreport}"</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</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">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-2">(</span><span class="org-string">"scrreprt"</span>
<span class="org-string">"\\documentclass{scrreprt}"</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</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">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-2">(</span><span class="org-string">"biblioreport"</span>
<span class="org-string">"\\documentclass{biblioreport}"</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-11 22:22:46 +01:00
<div id="outline-container-org7a618e0" class="outline-4">
<h4 id="org7a618e0">Basic</h4>
<div class="outline-text-4" id="text-org7a618e0">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Add packages by default</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">""</span> <span class="org-string">"siunitx"</span> t<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">""</span> <span class="org-string">"array"</span> t<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">""</span> <span class="org-string">"tabularx"</span> t<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">""</span> <span class="org-string">"booktabs"</span> t<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">""</span> <span class="org-string">"bm"</span> t<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"most"</span> <span class="org-string">"tcolorbox"</span> t<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">Setup default option for image size when exporting to LaTeX</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-image-default-option</span> <span class="org-string">"scale=1"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-image-default-width</span> nil<span class="org-rainbow-delimiters-depth-1">)</span>
<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-1">(</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-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Captions above the table</span>
<span class="org-rainbow-delimiters-depth-1">(</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-2">(</span>table<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">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-1">(</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-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Command used when exporting to pdf</span>
<span class="org-rainbow-delimiters-depth-1">(</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-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc656325" class="outline-4">
<h4 id="orgc656325">Beamer</h4>
<div class="outline-text-4" id="text-orgc656325">
<p>
Bold Text
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/my-beamer-bold</span> <span class="org-rainbow-delimiters-depth-2">(</span>contents backend info<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-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-3">)</span>
<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-constant">concat</span> <span class="org-string">"\\`\\\\"</span> <span class="org-string">"[A-Za-z0-9]+"</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">If not, orgmode is crazy...</span>
<span class="org-string">"\\\\textbf"</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-1">(</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-1">)</span>
</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">
<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">org-beamer-environments-extra</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-beamer-environments-extra</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</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-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orge552217" class="outline-4">
<h4 id="orge552217"><span class="todo TODO">TODO</span> Latex Fragments</h4>
<div class="outline-text-4" id="text-orge552217">
<ul class="org-ul">
<li class="off"><code>[&#xa0;]</code> The remove hook does not seems to work</li>
</ul>
<p>
<a href="http://slumpy.org/blog/2017-02-01-automatic-latex-preview-in-org-mode/">http://slumpy.org/blog/2017-02-01-automatic-latex-preview-in-org-mode/</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">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Activate Automatic LaTeX fragment</span>
<span class="org-builtin">:n</span> <span class="org-string">",ol"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>lambda <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-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">post-command-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/org-latex-fragment-toggle</span> t<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">;; Disable Automatic LaTeX fragment</span>
<span class="org-builtin">:n</span> <span class="org-string">",oL"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>lambda <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-function-name">remove-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">post-command-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/org-latex-fragment-toggle</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use F9 to globally generate all the latex fragments</span>
<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">org-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">"&lt;f9&gt;"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">()</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-preview-latex-fragment</span> <span class="org-highlight-numbers-number">16</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Put all the preview images in some directory</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Define backends to preview LaTeX fragments</span>
<span class="org-rainbow-delimiters-depth-1">(</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-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>imagemagick
<span class="org-builtin">:programs</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"latex"</span> <span class="org-string">"convert"</span><span class="org-rainbow-delimiters-depth-1">)</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: latex 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-1">(</span><span class="org-highlight-numbers-number">0.6</span> . <span class="org-highlight-numbers-number">0.6</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:latex-compiler</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pdflatex -interaction nonstopmode -output-directory %o %f"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:image-converter</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"convert -density %D -trim -antialias %f -quality 100 %O"</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>pdf2svg
<span class="org-builtin">:programs</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"latex"</span> <span class="org-string">"pdf2svg"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:description</span> <span class="org-string">"pdf &gt; svg"</span>
<span class="org-builtin">:message</span> <span class="org-string">"you need to install the programs: pdflatex and pdf2svg."</span>
<span class="org-builtin">:image-input-type</span> <span class="org-string">"pdf"</span>
<span class="org-builtin">:image-output-type</span> <span class="org-string">"svg"</span>
<span class="org-builtin">:image-size-adjust</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-numbers-number">1.0</span> . <span class="org-highlight-numbers-number">1.0</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:latex-compiler</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pdflatex -interaction nonstopmode -output-directory %o %f"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:image-converter</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pdfcrop %f %f &amp;&amp; pdftocairo -svg %f %O"</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">:image-converter ("pdf2svg %f %O"))</span>
<span class="org-rainbow-delimiters-depth-3">(</span>dvisvgm
<span class="org-builtin">:programs</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"latex"</span> <span class="org-string">"dvisvgm"</span><span class="org-rainbow-delimiters-depth-1">)</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-1">(</span><span class="org-highlight-numbers-number">0.8</span> . <span class="org-highlight-numbers-number">0.8</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:latex-compiler</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"latex -interaction nonstopmode -output-directory %o %f"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:image-converter</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"dvisvgm %f -n -b min -c %S -o %O"</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-comment-delimiter">;; </span><span class="org-comment">Use imagemagick/dvisvgm to generate png from pdf</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org0ee127c" class="outline-4">
<h4 id="org0ee127c"><span class="todo TODO">TODO</span> Custom Export - Add Page and Label for LaTeX export</h4>
<div class="outline-text-4" id="text-org0ee127c">
<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">
<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">tdehaeze/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> . tdehaeze/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> . tdehaeze/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>
</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">tdehaeze/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">tdehaeze/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">tdehaeze/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 tdehaeze/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>
<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">tdehaeze/replace-org-property</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">tdehaeze/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">tdehaeze/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>
</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">org-latex-format-headline-default-function</span> <span class="org-rainbow-delimiters-depth-2">(</span>todo _todo-type priority text tags _info<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Default format function for a headline.</span>
<span class="org-doc"> See `</span><span class="org-doc"><span class="org-constant">org-latex-format-headline-function</span></span><span class="org-doc">' for details."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> todo <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"{\\bfseries\\sffamily %s} "</span> todo<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">and</span> priority <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"\\framebox{\\#%c} "</span> priority<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
text
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> tags
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"\\hfill{}\\textsc{%s}"</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-latex--protect-text</span> tags <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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> todo <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"{\n\\page{%s} "</span> todo<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org6cf7477" class="outline-4">
<h4 id="org6cf7477">Number Equations</h4>
<div class="outline-text-4" id="text-org6cf7477">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">org-renumber-environment</span> <span class="org-rainbow-delimiters-depth-2">(</span>orig-func <span class="org-type">&amp;rest</span> args<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"A function to inject numbers in LaTeX fragment previews."</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-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">()</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>counter <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">numberp</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</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">loop</span> for <span class="org-rainbow-delimiters-depth-2">(</span>begin . env<span class="org-rainbow-delimiters-depth-2">)</span> in
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-map</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-parse-buffer</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">latex-environment</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">(</span>env<span class="org-rainbow-delimiters-depth-1">)</span>
<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-function-name">org-element-property</span> <span class="org-builtin">:begin</span> env<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:value</span> env<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>
collect
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">cond</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">string-match</span> <span class="org-string">"\\\\begin{equation}"</span> env<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">string-match</span> <span class="org-string">"\\\\tag{"</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-1">(</span><span class="org-keyword">incf</span> counter<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cons</span> begin counter<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">string-match</span> <span class="org-string">"\\\\begin{align}"</span> env<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">prog2</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-2">(</span><span class="org-keyword">with-temp-buffer</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">insert</span> env<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-min</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">\\ is used for a new line. Each one leads to a number</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">incf</span> counter <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">count-matches</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">unless there are nonumbers.</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-min</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">decf</span> counter <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">count-matches</span> <span class="org-string">"\\nonumber"</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>t
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cons</span> begin 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><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-keyword">setq</span> numberp <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">assoc</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-1">)</span> results<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setf</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> args<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"\\setcounter{equation}{%s}\n"</span> numberp<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">car</span> args<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">apply</span> orig-func args<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">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">org-renumber-environment</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org2a54be6" class="outline-3">
<h3 id="org2a54be6"><span class="todo TODO">TODO</span> View PDF in org mode</h3>
<div class="outline-text-3" id="text-org2a54be6">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-include-img-from-pdf</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">&amp;rest</span> _<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Convert pdf files to image files in org-mode bracket links.</span>
<span class="org-doc"> # ()convertfrompdf:t # This is a special comment; tells that the upcoming</span>
<span class="org-doc"> # link points to the to-be-converted-to file.</span>
<span class="org-doc"> # If you have a foo.pdf that you need to convert to foo.png, use the</span>
<span class="org-doc"> # foo.png file name in the link.</span>
<span class="org-doc"> [[./foo.png]]</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-function-name">executable-find</span> <span class="org-string">"convert"</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">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">while</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">re-search-forward</span> <span class="org-string">"^[ \t]*#\\s-+()convertfrompdf\\s-*:\\s-*t"</span>
nil <span class="org-builtin">:noerror</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Keep on going to the next line till it finds a line with bracketed</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">file link.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">progn</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-1">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">looking-at</span> <span class="org-variable-name">org-bracket-link-regexp</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">Get the sub-group 1 match, the link, from `</span><span class="org-comment"><span class="org-constant">org-bracket-link-regexp</span></span><span class="org-comment">'</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>link <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">match-string-no-properties</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-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">stringp</span> link<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>imgfile <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">expand-file-name</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">file-name-sans-extension</span> link<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>pdffile <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">expand-file-name</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> imgfile
<span class="org-string">"."</span> <span class="org-string">"pdf"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>cmd <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"pdftocairo -png -transp -singlefile "</span>
pdffile <span class="org-string">" "</span> imgfile<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">message</span> <span class="org-string">"%s"</span> imgfile<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> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-readable-p</span> pdffile<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-newer-than-file-p</span> pdffile imgfile<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">This block is executed only if pdffile is newer than</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">imgfile or if imgfile does not exist.</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">shell-command</span> cmd<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">"%s"</span> cmd<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-function-name">user-error</span> <span class="org-string">"`</span><span class="org-string"><span class="org-constant">convert</span></span><span class="org-string">' executable (part of Imagemagick) is not found"</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">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-include-img-from-pdf</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">image-type-file-name-regexps</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"\\.pdf\\'"</span> . imagemagick<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">image-file-name-extensions</span> <span class="org-string">"pdf"</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">imagemagick-types-inhibit</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">remove</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">PDF</span> <span class="org-variable-name">imagemagick-types-inhibit</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-image-actual-width</span> <span class="org-highlight-numbers-number">600</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">my-latex-filter-nobreaks</span> <span class="org-rainbow-delimiters-depth-2">(</span>text backend info<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Ensure \" \" are properly handled in LaTeX export."</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-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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">" "</span> <span class="org-string">"~"</span> text<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-export-filter-plain-text-functions</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">my-latex-filter-nobreaks</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">image-file-name-extensions</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">quote</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"png"</span> <span class="org-string">"jpeg"</span> <span class="org-string">"jpg"</span> <span class="org-string">"gif"</span> <span class="org-string">"tiff"</span> <span class="org-string">"tif"</span> <span class="org-string">"xbm"</span> <span class="org-string">"xpm"</span> <span class="org-string">"pbm"</span> <span class="org-string">"pgm"</span> <span class="org-string">"ppm"</span> <span class="org-string">"pnm"</span> <span class="org-string">"svg"</span> <span class="org-string">"pdf"</span> <span class="org-string">"bmp"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-image-actual-width</span> <span class="org-highlight-numbers-number">600</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-imagemagick-display-command <span class="org-string">"convert -density 600 \"%s\" -thumbnail \"%sx%s&gt;\" \"%s\""</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">org-display-inline-images</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">&amp;optional</span> include-linked refresh beg end<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Display inline images.</span>
<span class="org-doc">Normally only links without a description part are inlined, because this</span>
<span class="org-doc">is how it will work for export. When INCLUDE-LINKED is set, also links</span>
<span class="org-doc">with a description part will be inlined. This</span>
<span class="org-doc">can be nice for a quick</span>
<span class="org-doc">look at those images, but it does not reflect what exported files will look</span>
<span class="org-doc">like.</span>
<span class="org-doc">When REFRESH is set, refresh existing images between BEG and END.</span>
<span class="org-doc">This will create new image displays only if necessary.</span>
<span class="org-doc">BEG and END default to the buffer boundaries."</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-keyword">unless</span> refresh
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-remove-inline-images</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">fboundp</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">clear-image-cache</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">clear-image-cache</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">save-excursion</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">save-restriction</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">widen</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> beg <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">or</span> beg <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> end <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">or</span> end <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">point-max</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">goto-char</span> beg<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>re <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</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 class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">file:</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 class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></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"><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 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-negation-char">^</span></span><span class="org-string">]\n]+?"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">substring</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-image-file-name-regexp</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-highlight-numbers-number">0</span> <span class="org-highlight-numbers-number">-2</span><span class="org-rainbow-delimiters-depth-2">)</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-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> include-linked <span class="org-string">""</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-3">)</span>
old file ov img<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">re-search-forward</span> re end t<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> old <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">get-char-property-and-overlay</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">match-beginning</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-image-overlay</span><span class="org-rainbow-delimiters-depth-1">)</span>
file <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">expand-file-name</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">or</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">match-string</span> <span class="org-highlight-numbers-number">3</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-3">(</span><span class="org-function-name">match-string</span> <span class="org-highlight-numbers-number">4</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-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">file-exists-p</span> file<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>file-thumb <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"%s%s_thumb.png"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">file-name-directory</span> file<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">file-name-base</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-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">file-exists-p</span> file-thumb<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>thumb-time <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">5</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-attributes</span> file-thumb <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">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>file-time <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">5</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-attributes</span> file <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">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>
<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">time-less-p</span> thumb-time file-time<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">format</span> org-imagemagick-display-command
file <span class="org-variable-name">org-image-actual-width</span> <span class="org-variable-name">org-image-actual-width</span> file-thumb<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-warning">nil nil</span><span class="org-warning"><span class="org-rainbow-delimiters-depth-2">)</span></span><span class="org-warning"><span class="org-rainbow-delimiters-depth-1">)</span></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">shell-command</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> org-imagemagick-display-command
file <span class="org-variable-name">org-image-actual-width</span> <span class="org-variable-name">org-image-actual-width</span> file-thumb<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-warning">nil nil</span><span class="org-warning"><span class="org-rainbow-delimiters-depth-3">)</span></span><span class="org-warning"><span class="org-rainbow-delimiters-depth-2">)</span></span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">car-safe</span> old<span class="org-rainbow-delimiters-depth-1">)</span> refresh<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">image-refresh</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">cdr</span> old<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-3">(</span><span class="org-keyword">setq</span> img <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">save-match-data</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">create-image</span> file-thumb<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> img
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> ov <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">make-overlay</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">match-beginning</span> <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">match-end</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-constant">overlay-put</span> ov <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">overlay-put</span> ov <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">face</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">default</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-put</span> ov <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-image-overlay</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-put</span> ov <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">modification-hooks</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-display-inline-remove-overlay</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">push</span> ov <span class="org-variable-name">org-inline-image-overlays</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><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>
Two options:
</p>
<ul class="org-ul">
<li>work with <code>.png</code> file extension and only replace with <code>.pdf</code> when exporting to LaTeX if the corresponding file exists</li>
<li>work with <code>.pdf</code> file, add a special function to display <code>.pdf</code> files (using <code>convert</code> or <code>pdftocairo</code>). Change to <code>.png</code> when exporting to html</li>
</ul>
<p>
Let&rsquo;s try the first solution.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/change-png-to-pdf</span> <span class="org-rainbow-delimiters-depth-2">(</span>text backend info<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Change png images to pdf images when existing"</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-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-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>text <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">"[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">\\w]</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">[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">\n\t\r]+</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">[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">\\w]"</span> <span class="org-string">"&lt;mark&gt;"</span> text nil nil <span class="org-highlight-numbers-number">1</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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">"[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">\\w]</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;mark&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">[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">\n\t\r]+</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">[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">\\w]"</span> <span class="org-string">"&lt;/mark&gt;"</span> text nil nil <span class="org-highlight-numbers-number">2</span> 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>
<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-highlight-quoted-symbol">org-export-filter-plain-text-fucntions</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">my-html-mark-tag</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">save-excursion</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">while</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">re-search-forward</span> <span class="org-string">"^[ \t]*#\\s-+()convertfrompdf\\s-*:\\s-*t"</span>
nil <span class="org-builtin">:noerror</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Keep on going to the next line till it finds a line with bracketed</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">file link.</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-keyword">progn</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-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-variable-name">org-bracket-link-regexp</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">Get the sub-group 1 match, the link, from `</span><span class="org-comment"><span class="org-constant">org-bracket-link-regexp</span></span><span class="org-comment">'</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>link <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">match-string-no-properties</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">stringp</span> link<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>imgfile <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">expand-file-name</span> link<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>pdffile <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">expand-file-name</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-function-name">file-name-sans-extension</span> imgfile<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-string">"."</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-1">(</span>cmd <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-string">"convert -density 96 -quality 85 "</span>
pdffile <span class="org-string">" "</span> imgfile<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> <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">file-readable-p</span> pdffile<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">file-newer-than-file-p</span> pdffile imgfile<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">This block is executed only if pdffile is newer than</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">imgfile or if imgfile does not exist.</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">shell-command</span> cmd<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">"%s"</span> cmd<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>
</pre>
</div>
</div>
</div>
<div id="outline-container-org3a0aab7" class="outline-3">
<h3 id="org3a0aab7">Org Ref</h3>
<div class="outline-text-3" id="text-org3a0aab7">
<p>
Ressources:
</p>
<ul class="org-ul">
<li><a href="https://github.com/tmalsburg/helm-bibtex">https://github.com/tmalsburg/helm-bibtex</a></li>
<li><a href="https://github.com/jkitchin/org-ref">https://github.com/jkitchin/org-ref</a></li>
<li><a href="https://www.reddit.com/r/emacs/comments/4gudyw/help_me_with_my_orgmode_workflow_for_notetaking/">https://www.reddit.com/r/emacs/comments/4gudyw/help_me_with_my_orgmode_workflow_for_notetaking/</a></li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><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-1">(</span><span class="org-keyword">setq</span> org-ref-notes-directory <span class="org-string">"~/Cloud/thesis/ressources/notes"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-ref-bibliography-notes <span class="org-string">"~/Cloud/thesis/ressources/notes"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Bibliography File</span>
<span class="org-rainbow-delimiters-depth-1">(</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-2">(</span><span class="org-string">"~/Cloud/thesis/ressources/references.bib"</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> org-ref-default-bibliography <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"~/Cloud/thesis/ressources/references.bib"</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">Folder where all the pdf are located</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-ref-pdf-directory <span class="org-string">"~/Cloud/thesis/ressources/pdfs"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<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-1">(</span><span class="org-keyword">setq</span> org-ref-notes-function
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">(</span>thekey<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>bibtex-completion-bibliography <span class="org-rainbow-delimiters-depth-3">(</span>org-ref-find-bibliography<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>bibtex-completion-edit-notes
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">car</span> <span class="org-rainbow-delimiters-depth-1">(</span>org-ref-get-bibtex-key-and-file thekey<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>
<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-1">(</span><span class="org-keyword">setq</span> org-ref-show-broken-links nil<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Display information on the citation</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-ref-show-citation-on-enter t<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgacb01d5" class="outline-3">
<h3 id="orgacb01d5">Org Noter</h3>
<div class="outline-text-3" id="text-orgacb01d5">
<ul class="org-ul">
<li><a href="https://github.com/weirdNox/org-noter">https://github.com/weirdNox/org-noter</a></li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-noter-always-create-frame nil<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-noter-kill-frame-at-session-end nil<span class="org-rainbow-delimiters-depth-1">)</span>
<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-1">(</span><span class="org-keyword">setq</span> org-noter-doc-split-fraction <span class="org-highlight-quoted-quote">'</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-rainbow-delimiters-depth-1">)</span>
<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-1">(</span><span class="org-keyword">setq</span> org-noter-auto-save-last-location t<span class="org-rainbow-delimiters-depth-1">)</span>
<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-1">(</span><span class="org-keyword">setq</span> org-noter-separate-notes-from-heading t<span class="org-rainbow-delimiters-depth-1">)</span>
<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-1">(</span><span class="org-keyword">setq</span> org-noter-notes-search-path <span class="org-string">"~/Cloud/thesis/ressources/notes"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb2514c1" class="outline-3">
<h3 id="orgb2514c1">Custom key bindings</h3>
<div class="outline-text-3" id="text-orgb2514c1">
<p>
Export to LaTeX
</p>
<div class="org-src-container">
<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">org-mode-map</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-1">)</span>
</pre>
</div>
<p>
Open pdf externally.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/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">"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">".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-1">(</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">",vp"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/open-org-pdf-externally</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<p>
Open HTML externally.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/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>
<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">org-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">",vh"</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-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org866e476" class="outline-3">
<h3 id="org866e476"><span class="todo TODO">TODO</span> Org-Contacts</h3>
<div class="outline-text-3" id="text-org866e476">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-contacts-files <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-string">"~/Cloud/org/contacts.org"</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-org357bec6" class="outline-3">
<h3 id="org357bec6"><span class="todo TODO">TODO</span> Org-Wunderlist</h3>
<div class="outline-text-3" id="text-org357bec6">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-wunderlist-client-id <span class="org-string">"6799d9caeb2f5d8bd641"</span>
org-wunderlist-token <span class="org-string">"fd5965cde436c2587850a7c517d366561d8a1cbf7b6d96ab62f3fc8c9930"</span>
org-wunderlist-file <span class="org-string">"~/Cloud/thesis/todos/wunderlist.org"</span>
org-wunderlist-dir <span class="org-string">"~/.emacs.d/org-wunderlist/"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orga2cf41a" class="outline-3">
<h3 id="orga2cf41a">Automatically run <code>startblock</code> when opening org-mode files</h3>
<div class="outline-text-3" id="text-orga2cf41a">
<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/eval-startblock</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">member</span> <span class="org-string">"startblock"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-src-block-names</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-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-babel-goto-named-src-block</span> <span class="org-string">"startblock"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-execute-src-block</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
nil
<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/eval-startblock</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org5e76baa" class="outline-3">
<h3 id="org5e76baa"><span class="todo TODO">TODO</span> Insert ScreenShot or Picture from Phone</h3>
<div class="outline-text-3" id="text-org5e76baa">
<p>
<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>
</p>
<ul class="org-ul">
<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>
</ul>
<div class="org-src-container">
<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>
<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>
<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>
<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>
<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>
<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>
<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>
file-list-sorted
<span class="org-builtin">:re-builder</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">ivy--regex</span>
<span class="org-builtin">:sort</span> nil
<span class="org-builtin">:initial-input</span> nil<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">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>
<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>
<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>
<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>
<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>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgdb8e701" class="outline-3">
<h3 id="orgdb8e701"><span class="todo TODO">TODO</span> Render Tables</h3>
<div class="outline-text-3" id="text-orgdb8e701">
<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>
<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">my-render-org-table-at-point</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">beginning-of-line</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">removes the overlay is already there</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">overlays-at</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">delete-overlay</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">overlays-at</span> <span class="org-rainbow-delimiters-depth-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-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>element-type <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-keyword">if</span> <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-rainbow-delimiters-depth-2">(</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-2">)</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-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-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">error</span> <span class="org-string">"not at an org table"</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">not</span> <span class="org-rainbow-delimiters-depth-2">(</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-3">(</span><span class="org-function-name">org-element-type</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-at-point</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-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">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-3">(</span><span class="org-function-name">my-render-org-table</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-at-point</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-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-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">my-render-org-table</span> <span class="org-rainbow-delimiters-depth-2">(</span>table<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>begin <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:begin</span> table<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>end <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>pos <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:end</span> table<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">goto-char</span> pos<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">beginning-of-line</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">skip possible space after table</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">not</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">looking-at</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-keyword">setq</span> pos <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">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>
pos<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>tabletxt <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">buffer-substring-no-properties</span> begin end<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>img <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">with-temp-buffer</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">insert</span> tabletxt<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">mark-whole-buffer</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-latex-convert-region-to-latex</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-latex-preview</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point-min</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">overlay-get</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">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-1">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">display</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>overlay <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">make-overlay</span> begin end<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</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-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">forward-line</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">my-render-org-tables-in-buffer</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-map</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-parse-buffer</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">table</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">my-render-org-table</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use F9 to globally generate tables</span>
<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">org-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">"&lt;f8&gt;"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">()</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">my-render-org-table-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>
</pre>
</div>
</div>
</div>
<div id="outline-container-org4f669e4" class="outline-3">
<h3 id="org4f669e4">Org Gcal</h3>
<div class="outline-text-3" id="text-org4f669e4">
<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>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-gcal-client-id <span class="org-string">"396102378658-dcmbcmrnthbe925519otsjbd921otq0v.apps.googleusercontent.com"</span>
org-gcal-client-secret <span class="org-string">"4M5PWrbhQjwYEMXGK85lDYX9"</span>
org-gcal-file-alist <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">"dehaeze.thomas@gmail.com"</span> . <span class="org-string">"~/Cloud/org/gcal.org"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</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-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">Automatic fetch of the new events</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-agenda-mode-hook</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">org-gcal-fetch</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org84cbed1" class="outline-2">
<h2 id="org84cbed1">Org Babel</h2>
<div class="outline-text-2" id="text-org84cbed1">
</div>
<div id="outline-container-org572c6f8" class="outline-3">
<h3 id="org572c6f8">Main configuration</h3>
<div class="outline-text-3" id="text-org572c6f8">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Don't ask for confirmation when evalutating latex blocs</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">my-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-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">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">my-org-confirm-babel-evaluate</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-comment-delimiter">;; </span><span class="org-comment">Use the current window for C-c ' source editing</span>
<span class="org-rainbow-delimiters-depth-1">(</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-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org2a87b1a" class="outline-3">
<h3 id="org2a87b1a">Special Shortcuts</h3>
<div class="outline-text-3" id="text-org2a87b1a">
<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 ctrl-ent.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/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">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>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">in-src-block-function</span> <span class="org-rainbow-delimiters-depth-3">()</span>
<span class="org-doc">"Function to do when inside the src block"</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-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span>in-src-block-p<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>in-src-block-function<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>
<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">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>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">(evil-define-minor-mode-key 'normal 'org-src-mode "q" 'org-edit-src-exit)</span>
</pre>
</div>
<p>
Remap <code>C-c C-c</code>:
<a href="https://emacs.stackexchange.com/questions/22430/rebind-org-babel-execute-src-block-maybe-to-c-c-c-c/22530#22530">https://emacs.stackexchange.com/questions/22430/rebind-org-babel-execute-src-block-maybe-to-c-c-c-c/22530#22530</a>
</p>
</div>
</div>
<div id="outline-container-org525beff" class="outline-3">
<h3 id="org525beff">Library of Babel</h3>
<div class="outline-text-3" id="text-org525beff">
<p>
Add all named source blocks to <code>org-babel-library-of-babel</code>.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-lob-ingest</span> <span class="org-string">"~/Cloud/thesis/org-mode/org-babel-tutorial/org-babel-library.org"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org8058e80" class="outline-3">
<h3 id="org8058e80">Org-Babel Matlab</h3>
<div class="outline-text-3" id="text-org8058e80">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-babel-matlab-shell-command <span class="org-string">"/home/thomas/bin/matlab -nodesktop -nosplash"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-babel-matlab-emacs-link-wrapper-method
<span class="org-string">"%s</span>
<span class="org-string"> if ischar(ans);</span>
<span class="org-string"> echo('test');</span>
<span class="org-string"> fid = fopen('%s', 'w');</span>
<span class="org-string"> fprintf(fid, '%s', ans);</span>
<span class="org-string"> fclose(fid);</span>
<span class="org-string"> else;</span>
<span class="org-string"> save -ascii %s ans;</span>
<span class="org-string"> end</span>
<span class="org-string"> delete('%s');</span>
<span class="org-string"> "</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org716f877" class="outline-3">
<h3 id="org716f877">Default options for Matlab code</h3>
<div class="outline-text-3" id="text-org716f877">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-babel-default-header-args:matlab
<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-builtin">:results</span> . <span class="org-string">"none"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:session</span> . <span class="org-string">"*MATLAB*"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:comments</span> . <span class="org-string">"org"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:exports</span> . <span class="org-string">"both"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:cache</span> . <span class="org-string">"no"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:noweb</span> . <span class="org-string">"no"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:hlines</span> . <span class="org-string">"no"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:tangle</span> . <span class="org-string">"no"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:mkdir</span> . <span class="org-string">"yes"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:eval</span> . <span class="org-string">"no-export"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org58e84ea" class="outline-3">
<h3 id="org58e84ea"><span class="todo TODO">TODO</span> Asynchronous execution</h3>
<div class="outline-text-3" id="text-org58e84ea">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">(push "~/.emacs.d/private/ob-session-async/lisp/" load-path)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(require 'ob-session-async)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">(with-eval-after-load "ob"</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(require 'org-babel-eval-in-repl))</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">(with-eval-after-load "eval-in-repl"</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(setq eir-jump-after-eval nil))</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org0cd0e74" class="outline-3">
<h3 id="org0cd0e74"><span class="todo TODO">TODO</span> Theme</h3>
<div class="outline-text-3" id="text-org0cd0e74">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">(after! org</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(require 'color)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(set-face-attribute 'org-block nil :background (color-darken-name (face-attribute 'default :background) 3))</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org0852213" class="outline-3">
<h3 id="org0852213">Indentation</h3>
<div class="outline-text-3" id="text-org0852213">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-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-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org1a39ee2" class="outline-3">
<h3 id="org1a39ee2">Some functions for using Matlab with Org Babel</h3>
<div class="outline-text-3" id="text-org1a39ee2">
</div>
<div id="outline-container-org752327c" class="outline-4">
<h4 id="org752327c"><code>whos</code> matlab function</h4>
<div class="outline-text-4" id="text-org752327c">
<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-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>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgccdb065" class="outline-4">
<h4 id="orgccdb065"><code>help</code> matlab function</h4>
<div class="outline-text-4" id="text-orgccdb065">
<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-help</span> <span class="org-rainbow-delimiters-depth-2">(</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-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> <span class="org-string">"help "</span> regionp <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</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-org564dcf6" class="outline-4">
<h4 id="org564dcf6">Execute selected text</h4>
<div class="outline-text-4" id="text-org564dcf6">
<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-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> regionp<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org4882995" class="outline-4">
<h4 id="org4882995">Specify a Matlab command to run</h4>
<div class="outline-text-4" id="text-org4882995">
<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-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>
</pre>
</div>
</div>
</div>
<div id="outline-container-org8c02cc5" class="outline-4">
<h4 id="org8c02cc5">Execute the current source block with no output</h4>
<div class="outline-text-4" id="text-org8c02cc5">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-babel-execute</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-comment-delimiter">;; </span><span class="org-comment">(message "%s" body)</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>
</pre>
</div>
</div>
</div>
<div id="outline-container-org5cdfcf6" class="outline-4">
<h4 id="org5cdfcf6">Execute the source block and go to the next one</h4>
<div class="outline-text-4" id="text-org5cdfcf6">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-babel-execute-goto-next</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-function-name">tdh/org-babel-execute</span> arg info params<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-next-src-block</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-org45552c3" class="outline-4">
<h4 id="org45552c3">Org-Babel Tangle Subtree</h4>
<div class="outline-text-4" id="text-org45552c3">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-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>
</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">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">",bT"</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-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org7425511" class="outline-4">
<h4 id="org7425511">Org-Babel Jump to Tangle File</h4>
<div class="outline-text-4" id="text-org7425511">
<p>
Actually this tangle the file and then go to the file. Maybe I would like to ignore the tangling phase.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-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>
</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">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">",bF"</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-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org9441f02" class="outline-4">
<h4 id="org9441f02">Org-Babel Tangle File and Execute</h4>
<div class="outline-text-4" id="text-org9441f02">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-babel-execute-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-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>
</pre>
</div>
</div>
</div>
</div>
</div>
2020-01-11 22:22:46 +01:00
<div id="outline-container-orgce9ebe6" class="outline-2">
<h2 id="orgce9ebe6">LaTeX</h2>
<div class="outline-text-2" id="text-orgce9ebe6">
2020-01-11 22:04:45 +01:00
<ul class="org-ul">
<li><a href="https://tex.stackexchange.com/questions/52179/what-is-your-favorite-emacs-and-or-auctex-command-trick">https://tex.stackexchange.com/questions/52179/what-is-your-favorite-emacs-and-or-auctex-command-trick</a></li>
<li><a href="https://tex.stackexchange.com/questions/20843/useful-shortcuts-or-key-bindings-or-predefined-commands-for-emacsauctex">https://tex.stackexchange.com/questions/20843/useful-shortcuts-or-key-bindings-or-predefined-commands-for-emacsauctex</a></li>
</ul>
</div>
<div id="outline-container-org5eef3c6" class="outline-3">
<h3 id="org5eef3c6">Basic LaTeX configuration</h3>
<div class="outline-text-3" id="text-org5eef3c6">
<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">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>
<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">LaTeX-mode-map</span> <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">latex/clean</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">TeX-mode-hook</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-variable-name">TeX-fold-mode</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org0df299f" class="outline-3">
<h3 id="org0df299f">Master file</h3>
<div class="outline-text-3" id="text-org0df299f">
<div class="org-src-container">
<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">TeX-master</span> nil<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgef2ee65" class="outline-3">
<h3 id="orgef2ee65">Pdf Viewer</h3>
<div class="outline-text-3" id="text-orgef2ee65">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">TeX-view-program-selection</span> <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> <span class="org-variable-name">TeX-source-correlate-mode</span> t<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">TeX-source-correlate-start-server</span> t<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">TeX-source-correlate-method</span> <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> <span class="org-variable-name">TeX-view-program-list</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">"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>
</pre>
</div>
</div>
</div>
</div>
2020-01-11 22:22:46 +01:00
<div id="outline-container-org236456d" class="outline-2">
<h2 id="org236456d">Helm-Bibtex</h2>
<div class="outline-text-2" id="text-org236456d">
2020-01-11 22:04:45 +01:00
</div>
<div id="outline-container-orgce7c4cf" class="outline-3">
<h3 id="orgce7c4cf">General Config</h3>
<div class="outline-text-3" id="text-orgce7c4cf">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><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-1">(</span><span class="org-keyword">setq</span> helm-bibtex-additional-search-fields <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>keywords<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">Display of bibtex entries with helm</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> bibtex-completion-display-formats
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>t . <span class="org-string">"${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=: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-comment-delimiter">;; </span><span class="org-comment">Special symbols for notes and pdf</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> bibtex-completion-pdf-symbol <span class="org-string">"&#8984;"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> bibtex-completion-notes-symbol <span class="org-string">"&#9998;"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Bibliography file</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> bibtex-completion-bibliography <span class="org-string">"~/Cloud/thesis/ressources/references.bib"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Directory with all the pdfs</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> bibtex-completion-library-path <span class="org-string">"~/Cloud/thesis/ressources/pdfs"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Directory with notes files</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> bibtex-completion-notes-path <span class="org-string">"~/Cloud/thesis/ressources/notes"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Template used when creating new Note file</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> bibtex-completion-notes-template-multiple-files <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">":DRAWER:\n"</span>
<span class="org-string">"#+LATEX_CLASS: biblioreport\n"</span>
<span class="org-string">"\n"</span>
<span class="org-string">"#+OPTIONS: toc:nil title:nil\n"</span>
<span class="org-string">"#+OPTIONS: ':t -:t\n"</span>
<span class="org-string">"\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refType}{${=type=}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refKey}{${=key=}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refTitle}{${title}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refAuthor}{${author-or-editor}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refJournal}{${journal}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refYear}{${year}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refDoi}{${DOI}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refUrl}{${url}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refKeywords}{${keywords}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\input{config.tex}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\graphicspath{{./figs/${=key=}/}}\n"</span>
<span class="org-string">"# #+TOC: headlines 2\n"</span>
<span class="org-string">":END:\n"</span>
<span class="org-string">"\n"</span>
<span class="org-string">"#+BEGIN_abstract\n"</span>
<span class="org-string">"\n"</span>
<span class="org-string">"#+END_abstract\n"</span>
<span class="org-string">"\n"</span>
<span class="org-string">"* ${title} :ignore:\n"</span>
<span class="org-string">":PROPERTIES:\n"</span>
<span class="org-string">":CUSTOM_ID: ${=key=}\n"</span>
<span class="org-string">":AUTHOR: ${author}\n"</span>
<span class="org-string">":TYPE: ${=type=}\n"</span>
<span class="org-string">":JOURNAL: ${journal}\n"</span>
<span class="org-string">":YEAR: ${year}\n"</span>
<span class="org-string">":VOLUME: ${volume}\n"</span>
<span class="org-string">":PAGES: ${pages}\n"</span>
<span class="org-string">":DOI: ${DOI}\n"</span>
<span class="org-string">":URL: ${url}\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-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Make "Edit notes" the default action</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> helm-bibtex
<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> helm-source-bibtex<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> helm-source-bibtex <span class="org-highlight-numbers-number">0</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-orgd565023" class="outline-3">
<h3 id="orgd565023">Open pdf externally</h3>
<div class="outline-text-3" id="text-orgd565023">
<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">tdehaeze/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>bibtex-completion-find-pdf 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>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Action to open the pdf with Zathura</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> helm-bibtex
<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> helm-source-bibtex<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">tdehaeze/open-pdf-externally</span> helm-source-bibtex <span class="org-highlight-numbers-number">1</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-org8307ae1" class="outline-3">
<h3 id="org8307ae1">Special Commands</h3>
<div class="outline-text-3" id="text-org8307ae1">
<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">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>
</pre>
</div>
</div>
</div>
<div id="outline-container-org35c0535" class="outline-3">
<h3 id="org35c0535">List all element of the bibliography without pdf associated</h3>
<div class="outline-text-3" id="text-org35c0535">
<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">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>bibtex-completion-init<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>bibtex-completion-candidates<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">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>bibtex-completion-find-pdf-in-library <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>
<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>
<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>
<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>
</pre>
</div>
</div>
</div>
</div>
2020-01-11 22:22:46 +01:00
<div id="outline-container-org96f469b" class="outline-2">
<h2 id="org96f469b"><span class="todo TODO">TODO</span> Matlab</h2>
<div class="outline-text-2" id="text-org96f469b">
2020-01-11 22:04:45 +01:00
<ul class="org-ul">
<li><a href="https://github.com/yuhonglin/matlab-mode">https://github.com/yuhonglin/matlab-mode</a></li>
<li><a href="https://github.com/pronobis/matlab-mode">https://github.com/pronobis/matlab-mode</a></li>
</ul>
</div>
<div id="outline-container-orga556b70" class="outline-3">
<h3 id="orga556b70">Setup Matlab Mode</h3>
<div class="outline-text-3" id="text-orga556b70">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> matlab-shell-command <span class="org-string">"/home/thomas/bin/matlab"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> matlab-shell-command-switches <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-string">"-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> 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/bin/mlint"</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-org9a5923a" class="outline-3">
<h3 id="org9a5923a">Setup Flycheck</h3>
<div class="outline-text-3" id="text-org9a5923a">
<div class="org-src-container">
<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/bin/mlint"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<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>
<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>
<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>
</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">defadvice</span> <span class="org-function-name">org-edit-src-code</span> <span class="org-rainbow-delimiters-depth-2">(</span>around set-buffer-file-name activate compile<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>file-name <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> <span class="org-comment-delimiter">;; </span><span class="org-comment">(1)</span>
ad-do-it <span class="org-comment-delimiter">;; </span><span class="org-comment">(2)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">buffer-file-name</span> file-name<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">(3)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org3d0effc" class="outline-3">
<h3 id="org3d0effc"><span class="todo TODO">TODO</span> Setup Company - not working</h3>
<div class="outline-text-3" id="text-org3d0effc">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">(add-to-list 'company-backends 'company-matlab)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org22063fd" class="outline-3">
<h3 id="org22063fd"><span class="todo TODO">TODO</span> Beautify code</h3>
<div class="outline-text-3" id="text-org22063fd">
<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">matlab-beautify-buffer</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Beautify Current 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-rainbow-delimiters-depth-2">(</span><span class="org-function-name">save-buffer</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"MBeautify.formatFile(\""</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-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>
</pre>
</div>
</div>
</div>
<div id="outline-container-org8c111a1" class="outline-3">
<h3 id="org8c111a1">Key Bindings</h3>
<div class="outline-text-3" id="text-org8c111a1">
<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">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>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"dbstop in "</span> <span class="org-rainbow-delimiters-depth-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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">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>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"dbclear in "</span> <span class="org-rainbow-delimiters-depth-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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">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>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"dbstatus "</span> <span class="org-rainbow-delimiters-depth-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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">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>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"dbclear in "</span> <span class="org-rainbow-delimiters-depth-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>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">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>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"cd "</span> <span class="org-rainbow-delimiters-depth-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>
</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">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">matlab-mode-map</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">matlab-go-to-file-directory</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">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">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">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">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-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf28fce3" class="outline-3">
<h3 id="orgf28fce3">Wrong highlight of comments</h3>
<div class="outline-text-3" id="text-orgf28fce3">
<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-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">matlab-mode-hook</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">`</span><span class="org-comment"><span class="org-constant">highlight-numbers-mode</span></span><span class="org-comment">' breaks MATLAB comment coloring --</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">`</span><span class="org-comment"><span class="org-constant">highlight-numbers-mode</span></span><span class="org-comment">' is mostly redundant with</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">`</span><span class="org-comment"><span class="org-constant">rainbow-identifiers-mode</span></span><span class="org-comment">' anyway</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-variable-name">highlight-numbers-mode</span> <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-comment-delimiter">;; </span><span class="org-comment">We must append the above *after* `</span><span class="org-comment"><span class="org-constant">spacemacs/run-prog-mode-hooks</span></span><span class="org-comment">'</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">in `</span><span class="org-comment"><span class="org-constant">matlab-mode-hook</span></span><span class="org-comment">', since the former hook enables</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">`</span><span class="org-comment"><span class="org-constant">highlight-numbers-mode</span></span><span class="org-comment">'. Note that</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">`</span><span class="org-comment"><span class="org-constant">spacemacs/run-prog-mode-hooks</span></span><span class="org-comment">' is manually added to</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">`</span><span class="org-comment"><span class="org-constant">matlab-mode-hook</span></span><span class="org-comment">' by Spacemacs since the upstream `</span><span class="org-comment"><span class="org-constant">matlab-mode</span></span><span class="org-comment">'</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">package does not derive `</span><span class="org-comment"><span class="org-constant">matlab-mode</span></span><span class="org-comment">' from `</span><span class="org-comment"><span class="org-constant">prog-mode</span></span><span class="org-comment">' (oddly --</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">IIRC the author refused to do so for compatibility with XEmacs).</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">append</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgc9f203c" class="outline-2">
<h2 id="orgc9f203c"><span class="todo TODO">TODO</span> Mails With Mu4e</h2>
<div class="outline-text-2" id="text-orgc9f203c">
<ul class="org-ul">
<li><a href="https://github.com/kzar/davemail">https://github.com/kzar/davemail</a></li>
<li><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><a href="http://spacemacs.org/layers/+email/mu4e/README.html">http://spacemacs.org/layers/+email/mu4e/README.html</a></li>
<li><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><a href="https://notanumber.io/2016-10-03/better-email-with-mu4e/">https://notanumber.io/2016-10-03/better-email-with-mu4e/</a></li>
<li><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><a href="http://www.brool.com/post/using-mu4e/">http://www.brool.com/post/using-mu4e/</a></li>
<li><a href="https://www.reddit.com/r/emacs/comments/8q84dl/tip_how_to_easily_manage_your_emails_with_mu4e/">https://www.reddit.com/r/emacs/comments/8q84dl/tip_how_to_easily_manage_your_emails_with_mu4e/</a></li>
<li><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>
</ul>
</div>
<div id="outline-container-org6c54d87" class="outline-3">
<h3 id="org6c54d87">Set default mail user agent to mu4e</h3>
<div class="outline-text-3" id="text-org6c54d87">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">mail-user-agent</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">mu4e-user-agent</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orga2126a4" class="outline-3">
<h3 id="orga2126a4">Default config</h3>
<div class="outline-text-3" id="text-orga2126a4">
</div>
<div id="outline-container-org5d80b48" class="outline-4">
<h4 id="org5d80b48">Default behavior</h4>
<div class="outline-text-4" id="text-org5d80b48">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-maildir <span class="org-string">"~/.mail"</span>
mu4e-update-interval nil
mu4e-compose-signature-auto-include t
mu4e-view-show-images t
mu4e-view-show-addresses t<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgdf61747" class="outline-4">
<h4 id="orgdf61747">Default folders</h4>
<div class="outline-text-4" id="text-orgdf61747">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-sent-folder <span class="org-string">"/gmail/Sent"</span>
mu4e-drafts-folder <span class="org-string">"/gmail/Drafts"</span>
mu4e-trash-folder <span class="org-string">"/gmail/Trash"</span>
mu4e-refile-folder <span class="org-string">"/gmail/Archive"</span>
mu4e-compose-signature <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-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf57030d" class="outline-4">
<h4 id="orgf57030d">Default signature and email address</h4>
<div class="outline-text-4" id="text-orgf57030d">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-compose-signature <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-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgad9cf03" class="outline-4">
<h4 id="orgad9cf03">Saving the attachment to Downloads directory</h4>
<div class="outline-text-4" id="text-orgad9cf03">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-attachment-dir <span class="org-string">"~/Downloads"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgda5d5f6" class="outline-4">
<h4 id="orgda5d5f6">A list of user&rsquo;s e-mail addresses</h4>
<div class="outline-text-4" id="text-orgda5d5f6">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-user-mail-address-list <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"dehaeze.thomas@gmail.com"</span> <span class="org-string">"thomas.dehaeze@esrf.fr"</span> <span class="org-string">"thomas.dehaeze@doct.ulg.ac.be"</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-orgfe31f50" class="outline-4">
<h4 id="orgfe31f50">Mail directory shortcuts</h4>
<div class="outline-text-4" id="text-orgfe31f50">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-maildir-shortcuts
<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">"/gmail/Inbox"</span> . ?g<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"/esrf/Inbox"</span> . ?e<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"/ulg/Inbox"</span> . ?u<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgf6a8676" class="outline-3">
<h3 id="orgf6a8676"><span class="todo TODO">TODO</span> Contexts - Email accounts</h3>
<div class="outline-text-3" id="text-orgf6a8676">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-contexts
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-2">(</span> ,<span class="org-rainbow-delimiters-depth-3">(</span>make-mu4e-context
<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-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span>mu4e-message <span class="org-string">"Entering Gmail context"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:leave-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span>mu4e-message <span class="org-string">"Leaving Gmail context"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:match-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">(</span>msg<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> msg
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">string-match-p</span> <span class="org-string">"^/gmail"</span> <span class="org-rainbow-delimiters-depth-1">(</span>mu4e-message-field msg <span class="org-builtin">:maildir</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-builtin">:vars</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-sent-messages-behavior . <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">delete</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-variable-name">user-mail-address</span> . <span class="org-string">"dehaeze.thomas@gmail.com"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-sent-folder . <span class="org-string">"/gmail/Sent"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-trash-folder . <span class="org-string">"/gmail/Trash"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-drafts-folder . <span class="org-string">"/gmail/Drafts"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-refile-folder . <span class="org-string">"/gmail/Archive"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-compose-signature .
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span>
<span class="org-string">"Thomas Dehaeze\n"</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-3">(</span>make-mu4e-context
<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-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span>mu4e-message <span class="org-string">"Entering ESRF context"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:leave-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span>mu4e-message <span class="org-string">"Leaving ESRF context"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:match-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">(</span>msg<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> msg
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">string-match-p</span> <span class="org-string">"^/esrf"</span> <span class="org-rainbow-delimiters-depth-1">(</span>mu4e-message-field msg <span class="org-builtin">:maildir</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-builtin">:vars</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">user-mail-address</span> . <span class="org-string">"thomas.dehaeze@esrf.fr"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-sent-folder . <span class="org-string">"/esrf/Sent"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-trash-folder . <span class="org-string">"/esrf/Trash"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-drafts-folder . <span class="org-string">"/esrf/Drafts"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-refile-folder . <span class="org-string">"/esrf/Archive"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-compose-signature .
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span>
<span class="org-string">"Thomas Dehaeze\n"</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-3">(</span>make-mu4e-context
<span class="org-builtin">:name</span> <span class="org-string">"ulg"</span>
<span class="org-builtin">:enter-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span>mu4e-message <span class="org-string">"Entering ULG context"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:leave-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span>mu4e-message <span class="org-string">"Leaving ULG context"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:match-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">(</span>msg<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> msg
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">string-match-p</span> <span class="org-string">"^/ulg"</span> <span class="org-rainbow-delimiters-depth-1">(</span>mu4e-message-field msg <span class="org-builtin">:maildir</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-builtin">:vars</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">user-mail-address</span> . <span class="org-string">"thomas.dehaeze@doct.ulg.ac.be"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-sent-folder . <span class="org-string">"/ulg/Sent"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-trash-folder . <span class="org-string">"/ulg/Trash"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-drafts-folder . <span class="org-string">"/ulg/Drafts"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-refile-folder . <span class="org-string">"/ulg/Archive"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-compose-signature .
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span>
<span class="org-string">"Thomas Dehaeze\n"</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-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-context-policy <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">pick-first</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf1ec656" class="outline-3">
<h3 id="orgf1ec656">Receiving emails - Mbsync</h3>
<div class="outline-text-3" id="text-orgf1ec656">
<p>
Let systemd get the mail, then pressing <code>U</code> will just run <code>mu</code> to reindex everything.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-get-mail-command <span class="org-string">"true"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<p>
Fix for mbsync found <a href="http://pragmaticemacs.com/emacs/fixing-duplicate-uid-errors-when-using-mbsync-and-mu4e/">here</a>.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-change-filenames-when-moving t<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org93aa81c" class="outline-3">
<h3 id="org93aa81c">Sending emails - Msmtp</h3>
<div class="outline-text-3" id="text-org93aa81c">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> smtpmail-default-smtp-server <span class="org-string">"smtp.gmail.com"</span>
smtpmail-smtp-server <span class="org-string">"smtp.gmail.com"</span>
smtpmail-smtp-service <span class="org-highlight-numbers-number">587</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">message-send-mail-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">message-send-mail-with-sendmail</span>
sendmail-program <span class="org-string">"msmtp"</span>
<span class="org-variable-name">user-full-name</span> <span class="org-string">"Thomas Dehaeze"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org56fed03" class="outline-3">
<h3 id="org56fed03">Bookmarks</h3>
<div class="outline-text-3" id="text-org56fed03">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-bookmarks
<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">"flag:unread AND NOT flag:trashed"</span> <span class="org-string">"Unread messages"</span> ?u<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"date:today..now"</span> <span class="org-string">"Today's messages"</span> ?t<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"date:7d..now"</span> <span class="org-string">"Last 7 days"</span> ?w<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"mime:image/*"</span> <span class="org-string">"Messages with images"</span> ?p<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-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">mapcar</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">(</span>maildir<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"maildir:"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> maildir<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
mu4e-maildir-shortcuts<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-string">" OR "</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-string">"All inboxes"</span> ?i<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf03113f" class="outline-3">
<h3 id="orgf03113f"><span class="todo TODO">TODO</span> Notifications</h3>
<div class="outline-text-3" id="text-orgf03113f">
<div class="org-src-container">
<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">mu4e-alert</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-alert-set-default-style <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-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>mu4e-alert-enable-notifications<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<p>
Mode-line notifications
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-enable-mode-line t<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orge85d0b3" class="outline-3">
<h3 id="orge85d0b3">Use Org-Mode Tables In Emails</h3>
<div class="outline-text-3" id="text-orge85d0b3">
<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-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">message-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">turn-on-orgtbl</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">message-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">turn-on-orgstruct++</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orge21bdce" class="outline-3">
<h3 id="orge21bdce"><span class="todo TODO">TODO</span> Integration with Org-Mode</h3>
<div class="outline-text-3" id="text-orge21bdce">
<p>
Store link to message if in header view, not to header query
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-mu4e-link-query-in-headers-mode nil<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgab99aec" class="outline-3">
<h3 id="orgab99aec"><span class="todo TODO">TODO</span> When putting something on the Trash, it will be in the archive folder on gmail</h3>
<div class="outline-text-3" id="text-orgab99aec">
<p>
Even when totally deleting it. It will stay on gmail. How to fix that?
</p>
</div>
</div>
<div id="outline-container-orgb7198c3" class="outline-3">
<h3 id="orgb7198c3"><span class="todo TODO">TODO</span> Verify that sending mails with gmail account works and that there is no duplicate</h3>
<div class="outline-text-3" id="text-orgb7198c3">
<p>
Should check this variable: mu4e-sent-messages-behavior
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-sent-messages-behavior <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">delete</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<p>
And <a href="https://www.djcbsoftware.nl/code/mu/mu4e/Gmail-configuration.html">here</a>.
If I put it to delete, it works for gmail but not for the other ones&#x2026;
Check <a href="https://github.com/djcb/mu/issues/179">here</a>.
</p>
</div>
</div>
<div id="outline-container-org95b0dd9" class="outline-3">
<h3 id="org95b0dd9"><span class="todo TODO">TODO</span> Cheatsheet</h3>
<div class="outline-text-3" id="text-org95b0dd9">
<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>
</div>
<div id="outline-container-org2844b83" class="outline-2">
<h2 id="org2844b83">PDF-Tools</h2>
<div class="outline-text-2" id="text-org2844b83">
<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-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">pdf-view-mode-hook</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">linum-mode</span> <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>
</pre>
</div>
</div>
</div>
<div id="outline-container-org5aa0513" class="outline-2">
<h2 id="org5aa0513">Custom command and leader keys</h2>
<div class="outline-text-2" id="text-org5aa0513">
</div>
<div id="outline-container-org5375daf" class="outline-3">
<h3 id="org5375daf">Watch LaTeX file using latexmk</h3>
<div class="outline-text-3" id="text-org5375daf">
<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/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>
<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>
<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">org-mode-map</span>
<span class="org-builtin">:n</span> <span class="org-string">",ow"</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">",ok"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/latex/watch/kill</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-11 22:22:46 +01:00
<div id="outline-container-org5558146" class="outline-3">
<h3 id="org5558146">Helm-Bibtex</h3>
<div class="outline-text-3" id="text-org5558146">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">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">",ob"</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">",of"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">helm-bibtex-favorites</span>
<span class="org-builtin">:n</span> <span class="org-string">",or"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">helm-resume</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org41e47d1" class="outline-3">
<h3 id="org41e47d1">Open terminal in current directory</h3>
<div class="outline-text-3" id="text-org41e47d1">
<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/open-terminal-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-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>
<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">org-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">",ot"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/open-terminal-in-workdir</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org5ed8af0" class="outline-3">
<h3 id="org5ed8af0">Open ranger in current directory</h3>
<div class="outline-text-3" id="text-org5ed8af0">
<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">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>
<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">org-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">",oo"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">open-ranger-in-workdir</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org608a8a8" class="outline-2">
<h2 id="org608a8a8">Yassnippets</h2>
<div class="outline-text-2" id="text-org608a8a8">
<div class="org-src-container">
<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>
</pre>
</div>
</div>
</div>
<div id="outline-container-org31414b1" class="outline-2">
<h2 id="org31414b1">Path for Shell</h2>
<div class="outline-text-2" id="text-org31414b1">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">(when (memq window-system '(mac ns x))</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(exec-path-from-shell-initialize))</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb2770dd" class="outline-2">
<h2 id="orgb2770dd">Proxy</h2>
<div class="outline-text-2" id="text-orgb2770dd">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">url-proxy-services</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">"http"</span> . <span class="org-string">"proxy.esrf.fr:3128"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"https"</span> . <span class="org-string">"proxy.esrf.fr:3128"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"no_proxy"</span> . <span class="org-string">"^.*esrf.fr"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org65e9b0d" class="outline-2">
<h2 id="org65e9b0d"><span class="todo TODO">TODO</span> Slack</h2>
<div class="outline-text-2" id="text-org65e9b0d">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span>slack-register-team
<span class="org-builtin">:name</span> <span class="org-string">"emacs-slack"</span>
<span class="org-builtin">:default</span> t
<span class="org-builtin">:client-id</span> <span class="org-string">"299050134212.316863429523"</span>
<span class="org-builtin">:client-secret</span> <span class="org-string">"7168a660375090e517fe812ea2d136e5"</span>
<span class="org-builtin">:token</span> <span class="org-string">"xoxp-299050134212-299063259042-715794254097-7c319fdd63315620e86f1fad42c126a2"</span>
<span class="org-builtin">:subscribed-channels</span> <span class="org-highlight-quoted-quote">'</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-function-name">advice-add</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">slack-counts-update</span> <span class="org-builtin">:override</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">ignore</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> slack-prefer-current-team t<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org567fc7b" class="outline-2">
<h2 id="org567fc7b"><span class="todo TODO">TODO</span> Neomutt connection</h2>
<div class="outline-text-2" id="text-org567fc7b">
<p>
<a href="https://mentat.za.net/blog/2018/10/31/using-org-mode-with-neomutt/">https://mentat.za.net/blog/2018/10/31/using-org-mode-with-neomutt/</a>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">org-protocol</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Call this function, which spawns neomutt, whenever org-mode</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">tries to open a link of the form mutt:message-id+goes_here@mail.gmail.com</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/mutt-open-message</span> <span class="org-rainbow-delimiters-depth-2">(</span>message-id<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"In neomutt, open the email with the the given Message-ID"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let*</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>message-id <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">"^/*"</span> <span class="org-string">""</span> message-id<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>mail-file
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">replace-regexp-in-string</span>
<span class="org-string">"\n$"</span> <span class="org-string">""</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">shell-command-to-string</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"mu find -n 1 -f l i:%s"</span> message-id<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>mail-dir <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">"/</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">cur</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">new</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">tmp</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">/$"</span> <span class="org-string">""</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">file-name-directory</span> mail-file<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>message-id-escaped <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">regexp-quote</span> message-id<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>mutt-keystrokes
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> <span class="org-string">"L~i %s\n\n"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">shell-quote-argument</span> message-id-escaped<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>mutt-command <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-string">"neomutt"</span> <span class="org-string">"-R"</span> <span class="org-string">"-f"</span> mail-dir
<span class="org-string">"-e"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"push '%s'"</span> mutt-keystrokes<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">message</span> <span class="org-string">"Launching neomutt for message %s"</span> message-id<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">call-process</span> <span class="org-string">"setsid"</span> nil nil
<span class="org-string">"-f"</span> <span class="org-string">"termite"</span> <span class="org-string">"-e"</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"neomutt -R -f "</span> mail-dir <span class="org-string">" -e \""</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> <span class="org-string">"push '%s a l'\""</span> mutt-keystrokes<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-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">Hook up `message:...` style URLs</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-add-link-type</span> <span class="org-string">"message"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/mutt-open-message</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org217ae13" class="outline-2">
<h2 id="org217ae13">Abbreviations</h2>
<div class="outline-text-2" id="text-org217ae13">
<p>
Type the abbreviation and use <code>C-x a -</code> to create a new abbreviation.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq-default</span> <span class="org-variable-name">abbrev-mode</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">save abbreviations upon exiting xemacs</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">save-abbrevs</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">set the file storing the abbreviations</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">abbrev-file-name</span> <span class="org-string">"~/.config/doom/my-abbreviations.el"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">reads the abbreviations file on startup</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">quietly-read-abbrev-file</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org9485a30" class="outline-2">
<h2 id="org9485a30">Other</h2>
<div class="outline-text-2" id="text-org9485a30">
<p>
Here are some additional functions/macros that could help you configure Doom:
</p>
<ul class="org-ul">
<li>`load!&rsquo; for loading external *.el files relative to this one</li>
<li>`use-package&rsquo; for configuring packages</li>
<li>`after!&rsquo; for running code after a package has loaded</li>
<li>`add-load-path!&rsquo; for adding directories to the `load-path&rsquo;, where Emacs
looks when you load packages with `require&rsquo; or `use-package&rsquo;.</li>
<li>`map!&rsquo; for binding new keys</li>
</ul>
<p>
To get information about any of these functions/macros, move the cursor over
the highlighted symbol at press &rsquo;K&rsquo; (non-evil users must press &rsquo;C-c g k&rsquo;).
This will open documentation for it, including demos of how they are used.
</p>
<p>
You can also try &rsquo;gd&rsquo; (or &rsquo;C-c g d&rsquo;) to jump to their definition and see how
they are implemented.
</p>
</div>
</div>
<div id="outline-container-orgfe6edb2" class="outline-2">
<h2 id="orgfe6edb2">Snippets</h2>
<div class="outline-text-2" id="text-orgfe6edb2">
</div>
2020-01-11 22:22:46 +01:00
<div id="outline-container-org045da24" class="outline-3">
<h3 id="org045da24">LaTeX</h3>
<div class="outline-text-3" id="text-org045da24">
2020-01-11 22:04:45 +01:00
</div>
<div id="outline-container-orge7be203" class="outline-4">
<h4 id="orge7be203">Coordinate</h4>
<div class="outline-text-4" id="text-orge7be203">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :coordinate</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
\coordinate[${<span class="org-highlight-numbers-number">1</span>:-&gt;}] (${<span class="org-highlight-numbers-number">2</span>:name}) at (${<span class="org-highlight-numbers-number">3</span>:pointcoordinate});
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-org85fe854" class="outline-4">
<h4 id="org85fe854">Draw</h4>
<div class="outline-text-4" id="text-org85fe854">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :draw</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
\draw[${<span class="org-highlight-numbers-number">1</span>:-&gt;}] (${<span class="org-highlight-numbers-number">2</span>:point1}) -- (${<span class="org-highlight-numbers-number">3</span>:point2});
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-org20756a3" class="outline-4">
<h4 id="org20756a3">Node</h4>
<div class="outline-text-4" id="text-org20756a3">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :node</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
node[${<span class="org-highlight-numbers-number">1</span>:below right}] (${<span class="org-highlight-numbers-number">2</span>:name}) {${<span class="org-highlight-numbers-number">3</span>:label}};
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc1d5a0e" class="outline-4">
<h4 id="orgc1d5a0e">Path</h4>
<div class="outline-text-4" id="text-orgc1d5a0e">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :path</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
\path[${<span class="org-highlight-numbers-number">1</span>}] (${<span class="org-highlight-numbers-number">2</span>:point1}) -- (${<span class="org-highlight-numbers-number">3</span>:point2});
$0
</pre>
</div>
</div>
</div>
</div>
2020-01-11 22:22:46 +01:00
<div id="outline-container-org98458a3" class="outline-3">
<h3 id="org98458a3">Matlab</h3>
<div class="outline-text-3" id="text-org98458a3">
2020-01-11 22:04:45 +01:00
</div>
<div id="outline-container-org7c48930" class="outline-4">
<h4 id="org7c48930">Clear</h4>
<div class="outline-text-4" id="text-org7c48930">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :clear and close all</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
clear; close all; clc;
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-org2014103" class="outline-4">
<h4 id="org2014103">Function</h4>
<div class="outline-text-4" id="text-org2014103">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :function</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-variable-name">function </span>[${<span class="org-highlight-numbers-number">4</span>:outputs}] = ${<span class="org-highlight-numbers-number">1</span>:functionName}(${<span class="org-highlight-numbers-number">2</span>:inputs}, ${<span class="org-highlight-numbers-number">3</span>:opts_param})
% $1 - Description
%
% Syntax: $1($2, $3)
%
% Inputs:
% - $2 -
% - $3 - Optionals parameters: structure with the following fields:
% -
%
% Outputs:
% - $4 -
%% Default value for opts
<span class="org-variable-name">opts</span> = struct(...
<span class="org-string">'${5:outputs}'</span>, ${<span class="org-highlight-numbers-number">6</span>:default_value} ...
);
if exist(<span class="org-string">'opts_param'</span>,<span class="org-string">'var'</span>)
<span class="org-variable-name">for opt</span> = fieldnames($3)<span class="org-string">'</span>
<span class="org-string"> if sum(strcmp(fieldnames(opts), opt{1})) == 1</span>
<span class="org-string"> opts.(opt{1}) = $3.(opt{1});</span>
<span class="org-string"> else</span>
<span class="org-string"> warning(sprintf('</span>%s is not a valid option.<span class="org-string">', opt{1}));</span>
<span class="org-string"> end</span>
<span class="org-string"> end</span>
<span class="org-string">end</span>
<span class="org-string">$0</span>
</pre>
</div>
</div>
</div>
</div>
2020-01-11 22:22:46 +01:00
<div id="outline-container-org7c4e9b0" class="outline-3">
<h3 id="org7c4e9b0">Org Mode</h3>
<div class="outline-text-3" id="text-org7c4e9b0">
2020-01-11 22:04:45 +01:00
</div>
<div id="outline-container-orga2e53df" class="outline-4">
<h4 id="orga2e53df">Begin</h4>
<div class="outline-text-4" id="text-orga2e53df">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :LaTeX Environment</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
\begin{${<span class="org-highlight-numbers-number">1</span>:equation}}
$0
\end{$1}
</pre>
</div>
</div>
</div>
<div id="outline-container-org72aba26" class="outline-4">
<h4 id="org72aba26">Block</h4>
<div class="outline-text-4" id="text-org72aba26">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Org-Mode Block</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">key: block</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter"><span class="org-type">#</span></span><span class="org-comment"><span class="org-type">+begin_$</span></span><span class="org-comment">{1:$$(let ((type (yas-choose-value '("src" "example" "quote" "verse" "center" "latex" "html" "ascii"))))</span>
(if type (concat type (if (equal type <span class="org-string">"src"</span>)
(concat <span class="org-string">" "</span> (yas-choose-value <span class="org-string">'("emacs-lisp" "latex" "python" "sh" "matlab")))))))}</span>
<span class="org-string">$0</span>
<span class="org-string">#+end_${1:$(car (split-string yas-text))}</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf93a88e" class="outline-4">
<h4 id="orgf93a88e">Custom Box</h4>
<div class="outline-text-4" id="text-orgf93a88e">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Custom Box</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :options [$1]{${2:blue}}{${3:ams nodisplayskip}}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_cbox</span>
$0
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_cbox</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org9bc409b" class="outline-4">
<h4 id="org9bc409b">Latex Class</h4>
<div class="outline-text-4" id="text-org9bc409b">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">name: latex-class</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">key: lc</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">expand-env: ((classes (mapcar 'car org-latex-classes)))</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+latex_class: ${1:$$(yas-choose-value classes)}</span>
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-org53dd3a0" class="outline-4">
<h4 id="org53dd3a0">Name Caption Figure</h4>
<div class="outline-text-4" id="text-org53dd3a0">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">name: name-caption-figure</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">key: ncf</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+name: fig:${1:name}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+caption: ${2:Caption}</span>
[[${<span class="org-highlight-numbers-number">3</span>:`(read-file-name <span class="org-string">"File: "</span>)`}]]
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-org3b14c56" class="outline-4">
<h4 id="org3b14c56">Bibliography with completion</h4>
<div class="outline-text-4" id="text-org3b14c56">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">name: bibliography with completion</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">key: bib</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
bibliography:${<span class="org-highlight-numbers-number">1</span>:$$(yas-choose-value (org-ref-find-bibliography))}
</pre>
</div>
</div>
</div>
<div id="outline-container-org1219714" class="outline-4">
<h4 id="org1219714">Cite</h4>
<div class="outline-text-4" id="text-org1219714">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">name: org-ref cite link</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">key: cite</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
cite:${<span class="org-highlight-numbers-number">1</span>:$$(completing-read
<span class="org-string">"bibtex key: "</span>
(let ((bibtex-files (org-ref-find-bibliography)))(bibtex-global-key-alist)))}
</pre>
</div>
</div>
</div>
<div id="outline-container-org41c8702" class="outline-4">
<h4 id="org41c8702">Ref</h4>
<div class="outline-text-4" id="text-org41c8702">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">name: org-ref ref link with completion</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">key: ref</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
ref:${<span class="org-highlight-numbers-number">1</span>:$$(completing-read <span class="org-string">"label: "</span> (org-ref-get-labels))}
</pre>
</div>
</div>
</div>
<div id="outline-container-org2f6e626" class="outline-4">
<h4 id="org2f6e626">Beamer - CBOX</h4>
<div class="outline-text-4" id="text-org2f6e626">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Beamer Custom Box</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
*** ${<span class="org-highlight-numbers-number">1</span>:@@latex:@@} :B_cbox:
,:PROPERTIES:
:BEAMER_env: cbox
:BEAMER_opt: {${<span class="org-highlight-numbers-number">2</span>:blue}}{${<span class="org-highlight-numbers-number">3</span>:ams nodisplayskip}}
:END:
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-org9081798" class="outline-4">
<h4 id="org9081798">Code</h4>
<div class="outline-text-4" id="text-org9081798">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Code</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+caption: ${1:Listing Caption}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+label: lst:${2:listing_name}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src ${3:listing_language}</span>
$0
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orga87f155" class="outline-4">
<h4 id="orga87f155">Equation</h4>
<div class="outline-text-4" id="text-orga87f155">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Equation</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+name: eq:${1:equation_name}</span>
\begin{equation}
$0
\end{equation}
</pre>
</div>
</div>
</div>
<div id="outline-container-org3ea2dea" class="outline-4">
<h4 id="org3ea2dea">Figure</h4>
<div class="outline-text-4" id="text-org3ea2dea">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Figure</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+name: fig:${1:figure_name}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+caption: ${2:Figure caption}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :${3:scale 1}</span>
[[file:${<span class="org-highlight-numbers-number">4</span>:figs/}$1.${<span class="org-highlight-numbers-number">5</span>:pdf}]]
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-org703a145" class="outline-4">
<h4 id="org703a145">Frac</h4>
<div class="outline-text-4" id="text-org703a145">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :LaTeX Fraction</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
\frac{$1}{$2} $0
</pre>
</div>
</div>
</div>
<div id="outline-container-org58438c7" class="outline-4">
<h4 id="org58438c7">Left</h4>
<div class="outline-text-4" id="text-org58438c7">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Left Right mathematical delimitations</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
\left$1 $0 \right$2
</pre>
</div>
</div>
</div>
<div id="outline-container-org92d0938" class="outline-4">
<h4 id="org92d0938">Mconfig</h4>
<div class="outline-text-4" id="text-org92d0938">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Matlab-Configuration-Header</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab :session *MATLAB*</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :tangle ${1:filename}.m</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :comments org</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :exports both</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :results none</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :eval no-export</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :noweb yes</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :mkdirp yes</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :output-dir ${2:figs}</span>
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-org13add5e" class="outline-4">
<h4 id="org13add5e">Mdescription</h4>
<div class="outline-text-4" id="text-org13add5e">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Measurement-Description</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
* Measurement description
** Setup :ignore:
*Setup*:
** Goal :ignore:
*Goal*:
** Measurements :ignore:
*Measurements*:
Three measurements are done:
| Measurement File | Description |
|-------------------------+------------------------------|
<span class="org-variable-name">|</span> =mat/data_${<span class="org-highlight-numbers-number">1</span>:<span class="org-highlight-numbers-number">001</span>}.mat= | $2 |
<span class="org-variable-name">Each of the measurement</span> =mat= file contains one =data= array with <span class="org-highlight-numbers-number">3</span> columns:
| Column number | Description |
|---------------+-------------------|
| <span class="org-highlight-numbers-number">1</span> | $3 |
| <span class="org-highlight-numbers-number">2</span> | $4 |
| <span class="org-highlight-numbers-number">3</span> | Time |
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-org417fc63" class="outline-4">
<h4 id="org417fc63">Mfigure</h4>
<div class="outline-text-4" id="text-org417fc63">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Matlab-Figure</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+HEADER: :tangle no :exports results :results none :noweb yes</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src matlab :var filepath="${2:figs}/$1.pdf" :var figsize="${3:full-tall}" :post pdf2svg(file=*this*, ext="png")</span>
&lt;&lt;plt-matlab&gt;&gt;$0
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+NAME: fig:$1</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+CAPTION: ${4:caption}${5: ([[./figs/$1.png][png]], [[./figs/$1.pdf][pdf]])}</span>
[<span class="org-type">[file:$2/$1.png]</span>]
</pre>
</div>
</div>
</div>
<div id="outline-container-org6a37b47" class="outline-4">
<h4 id="org6a37b47">Mfunction</h4>
<div class="outline-text-4" id="text-org6a37b47">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Matlab-Function</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
* ${<span class="org-highlight-numbers-number">1</span>:Function Name}
:PROPERTIES:
:header-args:matlab+: :tangle src/${<span class="org-highlight-numbers-number">2</span>:matlab_file_name}.m
:header-args:matlab+: :comments none :mkdirp yes :eval no
:END:
&lt;&lt;sec:$2&gt;&gt;
This Matlab function is accessible [[file:src/$2.m][here]].
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src matlab</span>
<span class="org-variable-name">function </span>[${<span class="org-highlight-numbers-number">4</span>:in_data}] = $2(${<span class="org-highlight-numbers-number">3</span>:in_data})
% $2 - $0
%
<span class="org-variable-name">% Syntax: </span>[<span class="org-constant">$4</span>] = $2($3)
%
% Inputs:
% - $3 -
%
% Outputs:
% - $4 -
end
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org7b94a12" class="outline-4">
<h4 id="org7b94a12">Mheader</h4>
<div class="outline-text-4" id="text-org7b94a12">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Matlab-Header</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
* ${<span class="org-highlight-numbers-number">1</span>:Heading Name}
:PROPERTIES:
:header-args:matlab+: :tangle matlab/${<span class="org-highlight-numbers-number">2</span>:matlab_file_name}.m
:header-args:matlab+: :comments org :mkdirp yes
:END:
&lt;&lt;sec:$2&gt;&gt;
** ZIP file containing the data and matlab files :ignore:
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src bash :exports none :results none</span>
if [ matlab/$2.m -nt data/$2.zip ]; then
cp matlab/$2.m $2.m;
zip data/$2 \
mat/data.mat \
$2.m
rm $2.m;
fi
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_note</span>
All the files (data and Matlab scripts) are accessible [[file:data/$2.zip][here]].
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_note</span>
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-org417513f" class="outline-4">
<h4 id="org417513f">Minipage</h4>
<div class="outline-text-4" id="text-org417513f">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :minipage</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+BEGIN_EXPORT latex</span>
\begin{figure}[htbp]
\centering
\begin{minipage}[t]{<span class="org-highlight-numbers-number">0.49</span>\linewidth}
<span class="org-comment-delimiter">#</span><span class="org-comment">+END_EXPORT</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :float nil :width 0.95\linewidth</span>
$0
<span class="org-comment-delimiter">#</span><span class="org-comment">+BEGIN_EXPORT latex</span>
\end{minipage}%
\hfill%
\begin{minipage}[t]{<span class="org-highlight-numbers-number">0.49</span>\linewidth}
<span class="org-comment-delimiter">#</span><span class="org-comment">+END_EXPORT</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :float nil :width 0.95\linewidth</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+BEGIN_EXPORT latex</span>
\end{minipage}
\end{figure}
<span class="org-comment-delimiter">#</span><span class="org-comment">+END_EXPORT</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgd3bfb9a" class="outline-4">
<h4 id="orgd3bfb9a">Minit</h4>
<div class="outline-text-4" id="text-orgd3bfb9a">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Matlab-Init</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
** Matlab Init :noexport:ignore:
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name)</span>
&lt;&lt;matlab-dir&gt;&gt;
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src matlab :exports none :results silent :noweb yes</span>
&lt;&lt;matlab-init&gt;&gt;
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc6f45a3" class="outline-4">
<h4 id="orgc6f45a3">Mtable</h4>
<div class="outline-text-4" id="text-orgc6f45a3">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Matlab-Table</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)</span>
data2orgtable(${<span class="org-highlight-numbers-number">1</span>:data}, {${<span class="org-highlight-numbers-number">2</span>:<span class="org-string">'rowlabel'</span>}}, {${<span class="org-highlight-numbers-number">3</span>:<span class="org-string">'collabel'</span>}}, <span class="org-string">' %.1f '</span>);
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-orgecc8e5f" class="outline-4">
<h4 id="orgecc8e5f">Multicolumn</h4>
<div class="outline-text-4" id="text-orgecc8e5f">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Multcolumn</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :float multicolumn</span>
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-org923ba96" class="outline-4">
<h4 id="org923ba96">Subfigure</h4>
<div class="outline-text-4" id="text-org923ba96">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Subfigure</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+name: fig:${1:figure_name}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+caption: ${2:figure caption}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :environment subfigure :width 0.49\linewidth :align c</span>
| file:${<span class="org-highlight-numbers-number">3</span>:sub_fig_name}.${<span class="org-highlight-numbers-number">4</span>:pdf} | file:${<span class="org-highlight-numbers-number">5</span>:sub_fig_name}.${<span class="org-highlight-numbers-number">6</span>:pdf} |
| &lt;&lt;fig:$3&gt;&gt; ${<span class="org-highlight-numbers-number">7</span>:sub figure caption} | &lt;&lt;fig:$5&gt;&gt; ${<span class="org-highlight-numbers-number">8</span>:sub figure caption} |
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-org40f613b" class="outline-4">
<h4 id="org40f613b">Table</h4>
<div class="outline-text-4" id="text-org40f613b">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Table</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+name: tab:${1:table_name}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+caption: ${2:Table caption}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :environment tabularx :width ${3:\linewidth} :align ${4:lXX}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :center t :booktabs t :float t</span>
| $0 | | |
|---+---+---|
| | | |
</pre>
</div>
</div>
</div>
<div id="outline-container-org2e611fc" class="outline-4">
<h4 id="org2e611fc">Tikz</h4>
<div class="outline-text-4" id="text-org2e611fc">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Tikz figure</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src latex :file ${1:figure_name}.pdf :post pdf2svg(file=*this*, ext="png") :exports both</span>
\begin{tikzpicture}
$0
\end{tikzpicture}
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org5fc10a4" class="outline-4">
<h4 id="org5fc10a4">Tikzfig</h4>
<div class="outline-text-4" id="text-org5fc10a4">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Tikz Figure</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+NAME: fig:${1:figure_name}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+HEADER: :headers '("\\\\usepackage{tikz}" "\\\\usepackage{import}" "\\\\import{$HOME/Cloud/thesis/LaTeX/}{config.tex}")</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+HEADER: :imagemagick t :fit yes :iminoptions -scale 100% -density 150 :imoutoptions -quality 100</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+HEADER: :results raw replace :buffer no :eval no-export :exports both :mkdirp yes</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+HEADER: :output-dir ${2:figs}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src latex :file $1.pdf :post pdf2svg(file=*this*, ext="png") :exports both</span>
\begin{tikzpicture}
$0
\end{tikzpicture}
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+NAME: fig:$1</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+CAPTION: ${3:Caption}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+RESULTS: fig:$1</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgae9990f" class="outline-4">
<h4 id="orgae9990f">Tikzheader</h4>
<div class="outline-text-4" id="text-orgae9990f">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Tikz Header</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
* ${<span class="org-highlight-numbers-number">1</span>:Title/Description of the figure}
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src latex :file ${2:figure_name}.pdf :tangle figs/$2.tex :exports ${3:both}</span>
\begin{tikzpicture}
$0
\end{tikzpicture}
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+name: fig:$2</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+caption: $1 ([[./figs/$2.png][png]], [[./figs/$2.pdf][pdf]], [[./figs/$2.tex][tex]]).</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+RESULTS:</span>
[<span class="org-type">[file:./figs/$2.png]</span>]
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb79a363" class="outline-4">
<h4 id="orgb79a363">User-config</h4>
<div class="outline-text-4" id="text-orgb79a363">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter"># </span><span class="org-comment">-*- mode: snippet -*-</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">name: user-config</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">key: uc</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src emacs-lisp :tangle user-config.el</span>
$1
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb563f74" class="outline-4">
<h4 id="orgb563f74">User-init</h4>
<div class="outline-text-4" id="text-orgb563f74">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter"># </span><span class="org-comment">-*- mode: snippet -*-</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">name: user-init</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">key: ui</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src emacs-lisp :tangle user-init.el</span>
$1
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org8723da7" class="outline-4">
<h4 id="org8723da7">Wrap</h4>
<div class="outline-text-4" id="text-org8723da7">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Wrap</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :float wrap</span>
$0
</pre>
</div>
</div>
</div>
<div id="outline-container-org41d3ff5" class="outline-4">
<h4 id="org41d3ff5">Latex</h4>
<div class="outline-text-4" id="text-org41d3ff5">
</div>
<div id="outline-container-org30f241c" class="outline-5">
<h5 id="org30f241c">Integral</h5>
<div class="outline-text-5" id="text-org30f241c">
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter"># </span><span class="org-comment">-*- mode: snippet -*-</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">name: latex integral</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">key: int</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">contributor: John Kitchin <a href="mailto:jkitchin%40andrew.cmu.edu">&lt;jkitchin@andrew.cmu.edu&gt;</a></span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
\int_{$1}^{$2} $3d$4$0
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
2020-01-11 22:22:46 +01:00
<p class="date">Created: 2020-01-11 sam. 22:22</p>
2020-01-11 22:04:45 +01:00
</div>
</body>
</html>