<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Emacs on Thanos Apollo</title>
    <link>https://thanosapollo.org/tags/emacs/</link>
    <description>Recent content in Emacs on Thanos Apollo</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Thu, 20 Aug 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://thanosapollo.org/tags/emacs/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>My Emacs Agentic Workflow</title>
      <link>https://thanosapollo.org/posts/emacs-agentic-workflow/</link>
      <pubDate>Thu, 20 Aug 2026 00:00:00 +0000</pubDate>
      <guid>https://thanosapollo.org/posts/emacs-agentic-workflow/</guid>
      <description>&lt;p&gt;Two years ago I was a skeptic about GenAI.  Now I don&amp;rsquo;t write code at
all.  Agents do, and Emacs is the glass I watch them through.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Two years ago I was a skeptic about GenAI.  Now I don&rsquo;t write code at
all.  Agents do, and Emacs is the glass I watch them through.</p>
<h2 id="harness">Harness</h2>
<p>My favorite harness right now is <a href="https://github.com/nousresearch/hermes-agent">hermes-agent</a>, which is probably the
<em>&ldquo;emacs of agent harnesses&rdquo;</em> with how easy it is to configure
and extend, while not being &ldquo;just an agent harness.&rdquo;  Hermes supports
messaging gateways, so you have first-class support for mobile as
well.  All you have to do is <code>/handoff &lt;platform&gt;</code> to continue your
session via a mobile messaging app.</p>
<figure>
    <img loading="lazy" src="/images/hermes-dashboard-01.png"/> 
</figure>

<p>To interact with hermes via emacs, I&rsquo;m using <a href="https://elpa.nongnu.org/nongnu/hermes.html">emacs-hermes, which is
available via NonGNU ELPA.</a></p>
<p>Sometimes I also use <a href="https://github.com/openai/codex">codex</a> via <a href="https://elpa.nongnu.org/nongnu/codex-ide.html">emacs-codex-ide</a>.  But it&rsquo;s not as
token-efficient as my hermes setup, and it&rsquo;s not where I am most
productive.  Unlike most harnesses, hermes supports codex native
compaction, which is the &ldquo;killer&rdquo; feature of codex.</p>
<h2 id="models">Models</h2>
<p>I currently use <code>gpt-5.6-sol</code> for most tasks through my codex
subscription.  It is exceptionally good at long-running goals.  It can
easily keep going for 20h+ trying to complete its task, and I have
found the quality of its work more than adequate.</p>
<blockquote>
<p>TIP: to save tokens with hermes, adjust the <code>auxiliary.approval</code> model
to a cheap open-weight one, such as deepseek-v4-flash, which is
practically free on nous portal.  This has cut my usage by more than
35%.</p>
</blockquote>
<p>I&rsquo;m also surprised by the recent leap x.ai made with Grok, which
is currently the best value-for-money model by far.  The benchmarks
place it close to gpt-5.6-sol and fable.</p>
<figure>
    <img loading="lazy" src="https://cdn.sanity.io/images/6vfeftx9/articles/5be9320cb6edf4847a0ab5beaf98244c1d5da13d-2228x912.png"
         alt="Figure 1: Artificial Analysis Intelligence Index"/> <figcaption>
            <p><span class="figure-number">Figure 1: </span>Artificial Analysis Intelligence Index</p>
        </figcaption>
</figure>

<p>It&rsquo;s currently my fallback model when I reach my usage limit on codex.
It&rsquo;s the fastest &ldquo;frontier&rdquo; model I&rsquo;ve tried.</p>
<p>I avoid using models from Anthropic.  Models like opus-5 and fable are
good for coding tasks, but I found them subpar for my studies even
compared to grok-4.6, plus overpriced.  The API prices are insane, and
their subscription only supports their proprietary harness.</p>
<h3 id="what-about-open-models">What about open models?</h3>
<p>A friend and I tried to self-host our &ldquo;AI Homelab&rdquo;, repurposing an old
ethereum mining rig plus a couple of new Nvidia GPUs.  The performance
was not ideal with models like GLM-5.2 compared to subscriptions by a
long shot.  Forget subagent workflows if you ever attempt it.  Not to
mention that my electricity bill was the same as I&rsquo;d pay for a
subscription plan.</p>
<p>A lot of people in the &ldquo;GNU/Linux&rdquo; sphere are looking for &ldquo;free&rdquo;
models.  <strong>Even if</strong> there were a 6T+ &ldquo;free&rdquo; model that outperforms
frontiers, there is no &ldquo;free hardware&rdquo; that could run it, and <strong>even if</strong>
there were a FOSS Nvidia alternative, would it be financially worth it
for most people as an investment?  Would your average hobbyist rather
pay $20/month or buy the next gen &ldquo;free&rdquo; DGX Spark for $5,000?</p>
<h2 id="extra-goodies-and-skills">Extra goodies &amp; Skills</h2>
<h3 id="memory">Memory</h3>
<p>No matter your setup, the biggest upgrade for me has been <a href="https://github.com/vectorize-io/hindsight">hindsight</a>.
It&rsquo;s an agent memory system that you can share across harnesses, and
it helps your agents remember your preferences and workflow details.</p>
<p>It&rsquo;s free and easy to self-host.</p>
<h3 id="skills">Skills</h3>
<p>Skills are how my opinions get into the agents.  Instead of explaining
the same preferences and workflow every session, I put them in
<code>SKILL.md</code> files that Hermes loads depending on the task.  I have
skills for how I want elisp written and reviewed, and even for drafts
like this post.</p>
<p>Everyone takes a different approach, from GSD/BMAD/Spec-driven
workflows that automate most of the work to &ldquo;real engineering&rdquo; skills
that want you to babysit the agent.  I prefer smaller skills I can mix
together instead of one framework owning my whole workflow.</p>
<p>If you are just starting out, browse <a href="https://www.skills.sh/">skills.sh</a> for anything that &ldquo;looks
cool&rdquo;, experiment with it, then start writing your own.  The two I
recommend to most people are <a href="https://www.skills.sh/cursor/plugins/unslop">unslop</a> and <a href="https://www.skills.sh/mattpocock/skills/grill-me">grill-me</a>.</p>
<h3 id="other-tools-and-environments">Other tools and environments</h3>
<p>As of now, the only other tools I&rsquo;d recommend are web tools like
<a href="https://www.firecrawl.dev/">firecrawl</a> and <a href="https://github.com/searxng/searxng">searxng</a>.</p>
<h2 id="current-state-of-my-ai-psychosis">Current state of my &ldquo;AI Psychosis&rdquo;</h2>
<p>The past year the value I have gained from GenAI tools is <strong>insane</strong>.  I
had not dreamed, even in my wildest dreams, that I would have such
tools in my lifetime.</p>
<p>Tasks that used to bottleneck my workflow, such as adjusting a
software tool to help me study, are now cheap to solve.  Software is
more of a commodity now, no longer a moat.  Anything you like can be
built easily.  You can see that even in
projects like hermes, which copied the &ldquo;Grok Bot&rdquo; &ldquo;killer-feature&rdquo; in
less than 24h and made it open source in their harness.</p>
<p>Grunt work like notes for my syllabus based on my university lecture
slides used to take me weeks.  Now it&rsquo;s just a <code>/goal</code> prompt, go for a
walk for 2h, and come back and they are ready in the same exact format
the rest of my notes already have.  All that is left is for me to study
them.</p>
<p>That&rsquo;s how I think about software now.  I keep a <a href="/posts/ai-and-foss/">software aquarium</a>:
harness, models, memory and skills, all running on my opinions.  The
agents write, review and maintain the code.  I decide what I want and
fix the water when something comes out wrong.  I don&rsquo;t think anyone
should be hand-writing code anymore, the same way nobody hand-copies
books.</p>
<p><strong><em>We live in exciting times.</em></strong></p>]]></content:encoded>
    </item>
    <item>
      <title>Gnosis 0.8.0 Release Notes</title>
      <link>https://thanosapollo.org/posts/gnosis-version-0-8-0/</link>
      <pubDate>Thu, 05 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://thanosapollo.org/posts/gnosis-version-0-8-0/</guid>
      <description>Gnosis 0.8.0 Release Overview</description>
      <content:encoded><![CDATA[<p>I&rsquo;m excited to announce the release of version 0.8.0 for <a href="/projects/gnosis/">gnosis</a>.</p>
<p>Finally this project is now evolving into the <em>&ldquo;all-in-one&rdquo;</em> knowledge
system I&rsquo;ve envisioned.  This version allows for viewing of linked
nodes of <code>org-gnosis</code> and their linked themata in a tabulated-list via
the <code>gnosis-dashboard</code> with excellent performance.</p>
<p>No more external browsers needed to view my collection.  This means
the <code>org-gnosis-ui</code> project should be considered deprecated.  All
functionalities can now be performed within Emacs.</p>
<p>Additionally, I&rsquo;ve published a <code>gnosis-deck</code> specifically designed for
fellow medical students, called <a href="https://codeberg.org/thanosapollo/gnosis-unking">Unking</a>, based on the <strong>last free
version</strong> of the <a href="https://www.ankihub.net/step-deck">Anking deck</a>, Anking V11.  This deck is quite
comprehensive, featuring over 40,000 themata.</p>
<p>As Gnosis already fulfills my original intentions and beyond, further
development will primarily be focused on bug fixes and general
maintenance rather than new major features.  My priority will now
shift towards using the system for my exams rather than continuing
active development.</p>
<p>It has been really fun and rewarding working on this project.  My goal
for learning to program has been to make a knowledge system and to not
rely on any 3rd parties for my studying.</p>
<p>Which I&rsquo;ve finally achieved:) This wouldn&rsquo;t be possible without all
the work that many of you have put into the Emacs ecosystem, so I just
want to I extend my heartfelt gratitude to all of you, thank you!</p>
<h2 id="new-features">New features</h2>
<ul>
<li>Auto input-method detection: gnosis detects the script of the
expected answer (Greek, Cyrillic, etc.) and activates the
appropriate input method during review.
Configured via <code>gnosis-script-input-method-alist</code>.</li>
<li>Change thema type and deck via <code>gnosis-update-thema</code>.</li>
<li>Dashboard bulk-link action for currently displayed themata.</li>
<li>Dashboard header-line with entry count and context.</li>
<li>Asynchronous deck import with <code>gnosis-import-deck-async</code>.</li>
<li>Demo deck included in <code>decks/demo.org</code>.</li>
</ul>
<h2 id="performance">Performance</h2>
<ul>
<li>New <code>gnosis-tl</code> module replaces <code>tabulated-list-print</code> for
dashboard rendering (3-4x faster).</li>
<li>Progressive async rendering for large dashboards.</li>
<li>Batch-fetch review data instead of per-thema queries.</li>
</ul>
<h2 id="bug-fixes">Bug fixes</h2>
<ul>
<li>Fix anagnosis event calculation in the algorithm.</li>
<li>Fix cloze tag removal for edge cases and mc-cloze type.</li>
<li>Fix <code>vc-pull</code> to run migrations after pull.</li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title>(Video) Emacs Notmuch with Multiple Addresses &amp; Auto Encryption</title>
      <link>https://thanosapollo.org/posts/emacs-notmuch-video-guide/</link>
      <pubDate>Thu, 18 Dec 2025 00:00:00 +0000</pubDate>
      <guid>https://thanosapollo.org/posts/emacs-notmuch-video-guide/</guid>
      <description>Video guide for managing emails with Emacs, using notmuch &amp;amp; isync.</description>
      <content:encoded><![CDATA[<p>This guide provides a quick setup for configuring Notmuch with GNU
Emacs to handle multiple email addresses and enable automatic
encryption.</p>
<p>Notmuch has been incredibly useful for me over the past year, and I
hope this guide helps new users overcome initial challenges.</p>
<center>
<p><i>Emacs Notmuch with Multiple Addresses & Auto Encryption</i><p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/P42C5wEQK-Y?si=wbDx5y3zH5Wd23gE" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</center>
<blockquote>
<p>Video notes:</p>
</blockquote>
<h2 id="summary">Summary</h2>
<ul>
<li>Emacs email workflow demo using <code>notmuch.el</code>.
<ul>
<li>Sending mails from multiple addresses, using <a href="%5C%2Asmtpmail">smtpmail</a>.</li>
<li>Auto encrypt emails, if a pgp key is available, using <a href="%5C%2Amml-sec">mml-sec</a>.</li>
</ul>
</li>
</ul>
<h2 id="why-notmuch">Why notmuch</h2>
<ul>
<li>Builtin Emacs support, with <code>notmuch.el</code>.
<ul>
<li>Packages such as <a href="https://github.com/tarsius/ol-notmuch">ol-notmuch</a> bring integration with the rest of
the Emacs ecosystem.</li>
</ul>
</li>
<li>Notmuch is a <code>tag based system</code>.  You do not rely on your email
provider for filter rules etc to organize your emails into separate
mailboxes.
<ul>
<li>Which is inefficient to begin with when working with thousands++ of emails.</li>
<li>This also makes moving to a new email provider easier.</li>
</ul>
</li>
<li>Locally storing mail.</li>
<li>Great performance for filtering and searching through hundred of thousand mails.</li>
</ul>
<h2 id="assumptions-that-i-make-for-this-video">Assumptions that I make for this video</h2>
<h3 id="you-have-a-working-emacs-configuration">You have a working Emacs configuration</h3>
<h3 id="your-mail-providers-has-support-for-retrieving-and-sending-mail-via-3rd-party-apps">Your mail providers has support for retrieving and sending mail via 3rd party apps</h3>
<ul>
<li>You already know how to setup <code>isync/mbsync</code> to retrieve emails from remote server.</li>
<li>Your mail provider offers <code>smtp</code> credentials to use third party applications.
<ul>
<li>I personally recommend trying out <code>purelymail.com</code> <strong>only costs 10$/year and offers good service</strong>.</li>
</ul>
</li>
</ul>
<p><em>Example isyncrc configuration</em> <code>~/.config/isyncrc</code></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-cfg" data-lang="cfg"><span style="display:flex;"><span><span style="color:#a6e22e">IMAPAccount gmail</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">Host imap.gmail.com</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">Port 993</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">User user@gmail.com # Change this to your username.</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">PassCmd &#34;pass gmail/account&#34; # Change this to a command that returns your password.</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">TLSType IMAPS</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">TLSVersions +1.2</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">CertificateFile /etc/ssl/certs/ca-certificates.crt</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">IMAPStore gmail-remote</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">Account gmail</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">MaildirStore gmail-local</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">Path ~/Mail/gmail/</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">Inbox ~/Mail/gmail/Inbox</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">Trash ~/Mail/gmail/Trash</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">SubFolders Verbatim</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">Channel gmail</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">Far :gmail-remote:</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">Near :gmail-local:</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">Patterns *</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">Expunge None</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">CopyArrivalDate yes</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">Sync All</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">Create Both</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">SyncState *</span>
</span></span></code></pre></div><p>After adjusting the above configuration, run <code>mbsync -a</code> to sync your remote mailbox locally.</p>
<h2 id="setting-up-a-notmuch">Setting up a notmuch</h2>
<h3 id="first-time-installation">First time installation</h3>
<ul>
<li>After installing notmuch for the first time, run <code>notmuch setup</code> for an interactive setup.</li>
</ul>
<h3 id="create-dot-scripts-notmuch-hook-dot-sh">Create <code>~/.scripts/notmuch-hook.sh</code></h3>
<ul>
<li>Bash script which will filter/tag your mail</li>
</ul>
<p>Example:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e">#!/bin/sh
</span></span></span><span style="display:flex;"><span>notmuch new
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Add +inbox tag to a specific alias/address</span>
</span></span><span style="display:flex;"><span>notmuch tag +inbox -- to:main@address.org
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">#Sent messages, change this to your mail addresses</span>
</span></span><span style="display:flex;"><span>notmuch tag -unread -new -inbox +sent -- from:*@mydomain.org or from:*@mydomain.com or from:user@gmail.com
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Example for Emacs-devel</span>
</span></span><span style="display:flex;"><span>notmuch tag +emacs-devel -new -inbox -- from:emacs-devel@gnu.org or to:emacs-devel@gnu.org
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Example for Github</span>
</span></span><span style="display:flex;"><span>notmuch tag +github -- from:*github.com
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Filter based on other tags, such as drafts</span>
</span></span><span style="display:flex;"><span>notmuch tag -inbox -sent -inbox -- tag:draft
</span></span></code></pre></div><h2 id="emacs-configuration">Emacs configuration</h2>
<h3 id="notmuch">Notmuch</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(use-package notmuch
</span></span><span style="display:flex;"><span>  :config
</span></span><span style="display:flex;"><span>  (defun thanos/notmuch-update--command (new-buffer)
</span></span><span style="display:flex;"><span>    (let ((default-directory <span style="color:#e6db74">&#34;~/.scripts/&#34;</span>)) <span style="color:#75715e">;; Directory where notmuch script is located.</span>
</span></span><span style="display:flex;"><span>      (async-shell-command <span style="color:#e6db74">&#34;mbsync -a; ./notmuch-hook.sh&#34;</span> new-buffer)))
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  (defun thanos/notmuch-update ()
</span></span><span style="display:flex;"><span>    (interactive)
</span></span><span style="display:flex;"><span>    (let* ((buffer (generate-new-buffer <span style="color:#e6db74">&#34;*notmuch update*&#34;</span>))
</span></span><span style="display:flex;"><span>           (height (<span style="color:#a6e22e">max</span> <span style="color:#ae81ff">5</span> (<span style="color:#a6e22e">truncate</span> (<span style="color:#a6e22e">*</span> (frame-height) <span style="color:#ae81ff">0.1</span>))))
</span></span><span style="display:flex;"><span>           (window (split-window-vertically (<span style="color:#a6e22e">-</span> height))))
</span></span><span style="display:flex;"><span>      (with-selected-window window
</span></span><span style="display:flex;"><span>        (switch-to-buffer buffer)
</span></span><span style="display:flex;"><span>        (let ((proc (thanos/notmuch-update--command buffer)))
</span></span><span style="display:flex;"><span>          (<span style="color:#a6e22e">set-process-sentinel</span>
</span></span><span style="display:flex;"><span>           (<span style="color:#a6e22e">get-buffer-process</span> buffer)
</span></span><span style="display:flex;"><span>           (lambda (process event)
</span></span><span style="display:flex;"><span>             (when (<span style="color:#a6e22e">memq</span> (<span style="color:#a6e22e">process-status</span> process) <span style="color:#f92672">&#39;</span>(exit <span style="color:#a6e22e">signal</span>))
</span></span><span style="display:flex;"><span>               (delete-window (<span style="color:#a6e22e">get-buffer-window</span> (<span style="color:#a6e22e">process-buffer</span> process)))
</span></span><span style="display:flex;"><span>               (<span style="color:#a6e22e">kill-buffer</span> (<span style="color:#a6e22e">process-buffer</span> process)))))))))
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  (defun thanos/notmuch-search ()
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;Custom notmuch-search wrapper, that makes sure we have newest mail first.&#34;</span>
</span></span><span style="display:flex;"><span>    (interactive)
</span></span><span style="display:flex;"><span>    (let ((query (notmuch-read-query <span style="color:#e6db74">&#34;Notmuch search: &#34;</span>)))
</span></span><span style="display:flex;"><span>      (notmuch-search query <span style="color:#66d9ef">nil</span>)))
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">;; Configure saved searches to your liking, here&#39;s an example:</span>
</span></span><span style="display:flex;"><span>  (setf notmuch-saved-searches
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">`</span>((:name <span style="color:#e6db74">&#34;Week&#39;s Inbox&#34;</span> :query <span style="color:#e6db74">&#34;tag:inbox date:7d..today&#34;</span> :sort-order newest-first
</span></span><span style="display:flex;"><span>                 :key <span style="color:#f92672">,</span>(kbd <span style="color:#e6db74">&#34;i&#34;</span>))
</span></span><span style="display:flex;"><span>          (:name <span style="color:#e6db74">&#34;Inbox&#34;</span> :query <span style="color:#e6db74">&#34;tag:inbox&#34;</span> :sort-order newest-first :key <span style="color:#f92672">,</span>(kbd <span style="color:#e6db74">&#34;I&#34;</span>))
</span></span><span style="display:flex;"><span>          (:name <span style="color:#e6db74">&#34;Unread&#34;</span> :query <span style="color:#e6db74">&#34;tag:unread&#34;</span> :sort-order newest-first :key <span style="color:#f92672">,</span>(kbd <span style="color:#e6db74">&#34;u&#34;</span>))
</span></span><span style="display:flex;"><span>          (:name <span style="color:#e6db74">&#34;Today&#39;s message&#34;</span> :query <span style="color:#e6db74">&#34;tag:inbox date:today&#34;</span>
</span></span><span style="display:flex;"><span>                 :sort-order newest-first :key <span style="color:#f92672">,</span>(kbd <span style="color:#e6db74">&#34;t&#34;</span>))
</span></span><span style="display:flex;"><span>          (:name <span style="color:#e6db74">&#34;sent&#34;</span> :query <span style="color:#e6db74">&#34;tag:sent&#34;</span> :sort-order newest-first :key <span style="color:#f92672">,</span>(kbd <span style="color:#e6db74">&#34;s&#34;</span>))
</span></span><span style="display:flex;"><span>          (:name <span style="color:#e6db74">&#34;drafts&#34;</span> :query <span style="color:#e6db74">&#34;tag:draft&#34;</span> :sort-order newest-first :key <span style="color:#f92672">,</span>(kbd <span style="color:#e6db74">&#34;d&#34;</span>))
</span></span><span style="display:flex;"><span>          (:name <span style="color:#e6db74">&#34;all mail&#34;</span> :query <span style="color:#e6db74">&#34;*&#34;</span> :sort-order oldest-first :key <span style="color:#f92672">,</span>(kbd <span style="color:#e6db74">&#34;a&#34;</span>))))
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">;; Tag format configuration</span>
</span></span><span style="display:flex;"><span>  (setf notmuch-tag-formats
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&#39;</span>((<span style="color:#e6db74">&#34;unread&#34;</span> (<span style="color:#a6e22e">propertize</span> tag <span style="color:#e6db74">&#39;face</span> <span style="color:#e6db74">&#39;notmuch-tag-unread</span>))))
</span></span><span style="display:flex;"><span>  :bind ((<span style="color:#e6db74">&#34;C-x m&#34;</span> <span style="color:#f92672">.</span> notmuch-hello)
</span></span><span style="display:flex;"><span>         :map notmuch-hello-mode-map
</span></span><span style="display:flex;"><span>         (<span style="color:#e6db74">&#34;u&#34;</span> <span style="color:#f92672">.</span> notmuch-hello-update)
</span></span><span style="display:flex;"><span>         (<span style="color:#e6db74">&#34;U&#34;</span> <span style="color:#f92672">.</span> thanos/notmuch-update)
</span></span><span style="display:flex;"><span>         (<span style="color:#e6db74">&#34;s&#34;</span> <span style="color:#f92672">.</span> thanos/notmuch-search)
</span></span><span style="display:flex;"><span>         :map notmuch-search-mode-map
</span></span><span style="display:flex;"><span>         (<span style="color:#e6db74">&#34;u&#34;</span> <span style="color:#f92672">.</span> notmuch-refresh-all-buffers)))
</span></span></code></pre></div><h3 id="smtpmail">smtpmail</h3>
<ul>
<li>This configuration is used to send email from multiple addresses,
make sure you have your authentication password saved in
<code>~/.authinfo.gpg</code> which emacs is going to use by default.</li>
</ul>
<!--listend-->
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(use-package smtpmail
</span></span><span style="display:flex;"><span>  :config
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">;; Default credentials</span>
</span></span><span style="display:flex;"><span>  (setf smtpmail-smtp-user (auth-source-pass-get <span style="color:#e6db74">&#34;user&#34;</span> <span style="color:#e6db74">&#34;gmail/user&#34;</span>) <span style="color:#75715e">;; This is not your password, just the username.  Emacs will search for your pw in ~/.authinfo.gpg.</span>
</span></span><span style="display:flex;"><span>        smtpmail-smtp-server <span style="color:#e6db74">&#34;smtp.gmail.com&#34;</span>
</span></span><span style="display:flex;"><span>        smtpmail-smtp-service <span style="color:#ae81ff">465</span> <span style="color:#75715e">;; Adjust this to your mail provider port if needed</span>
</span></span><span style="display:flex;"><span>        smtpmail-stream-type <span style="color:#e6db74">&#39;ssl</span>
</span></span><span style="display:flex;"><span>        message-send-mail-function <span style="color:#e6db74">&#39;smtpmail-send-it</span>
</span></span><span style="display:flex;"><span>        message-signature <span style="color:#e6db74">&#34;My signature&#34;</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  (defun thanos/mail-config-hook ()
</span></span><span style="display:flex;"><span>    (let ((from (mail-fetch-field <span style="color:#e6db74">&#34;From&#34;</span>))
</span></span><span style="display:flex;"><span>          (public <span style="color:#e6db74">&#34;&lt;public@thanosapollo.org&gt;&#34;</span>)
</span></span><span style="display:flex;"><span>          (gmail <span style="color:#e6db74">&#34;&lt;104111@students.mu-sofia.bg&gt;&#34;</span>))
</span></span><span style="display:flex;"><span>      (cond ((<span style="color:#a6e22e">string-match</span> public from)
</span></span><span style="display:flex;"><span>             (setf smtpmail-smtp-user (auth-source-pass-get <span style="color:#e6db74">&#34;user&#34;</span> <span style="color:#e6db74">&#34;purelymail/thanosapollo&#34;</span>)
</span></span><span style="display:flex;"><span>                   smtpmail-smtp-server <span style="color:#e6db74">&#34;smtp.purelymail.com&#34;</span>))
</span></span><span style="display:flex;"><span>            ((<span style="color:#a6e22e">string-match</span> gmail from)
</span></span><span style="display:flex;"><span>             (setf smtpmail-smtp-user <span style="color:#e6db74">&#34;104111@students.mu-sofia.bg&#34;</span>
</span></span><span style="display:flex;"><span>                   smtpmail-smtp-server <span style="color:#e6db74">&#34;smtp.gmail.com&#34;</span>)))))
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">;; You can use :hook instead, but I prefer add-hook under :config personally.</span>
</span></span><span style="display:flex;"><span>  (add-hook <span style="color:#e6db74">&#39;message-send-hook</span> <span style="color:#a6e22e">#&#39;</span>thanos/mail-config-hook))
</span></span></code></pre></div><h3 id="mml-sec">mml-sec</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(use-package mml-sec
</span></span><span style="display:flex;"><span>  :config
</span></span><span style="display:flex;"><span>  (defun gpg-list-emails-available ()
</span></span><span style="display:flex;"><span>  <span style="color:#e6db74">&#34;Return a list of trusted emails.
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">Parses output of `gpg --list-keys --with-colons&#39; command into a
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">list of emails.&#34;</span>
</span></span><span style="display:flex;"><span>  (let* ((command <span style="color:#e6db74">&#34;gpg --list-keys --with-colons&#34;</span>)
</span></span><span style="display:flex;"><span>         (output (shell-command-to-string command))
</span></span><span style="display:flex;"><span>         (lines (split-string output <span style="color:#e6db74">&#34;\n&#34;</span> <span style="color:#66d9ef">t</span>))
</span></span><span style="display:flex;"><span>         (emails <span style="color:#f92672">&#39;</span>()))
</span></span><span style="display:flex;"><span>    (dolist (line lines)
</span></span><span style="display:flex;"><span>      (when (string-prefix-p <span style="color:#e6db74">&#34;uid:&#34;</span> line)
</span></span><span style="display:flex;"><span>        (when (<span style="color:#a6e22e">string-match</span> <span style="color:#e6db74">&#34;&lt;\\([^&gt;]+\\)&gt;&#34;</span> line)
</span></span><span style="display:flex;"><span>          (let ((email (<span style="color:#a6e22e">downcase</span> (string-trim (match-string <span style="color:#ae81ff">1</span> line)))))
</span></span><span style="display:flex;"><span>            (push email emails)))))
</span></span><span style="display:flex;"><span>    (delete-dups emails)))
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  (defun thanos/mail-list-recipients-from-buffer ()
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;Get the list of recipients from the current email buffer.&#34;</span>
</span></span><span style="display:flex;"><span>    (save-excursion
</span></span><span style="display:flex;"><span>      (<span style="color:#a6e22e">goto-char</span> (<span style="color:#a6e22e">point-min</span>))
</span></span><span style="display:flex;"><span>      (let ((to (or (mail-fetch-field <span style="color:#e6db74">&#34;To&#34;</span>) <span style="color:#e6db74">&#34;&#34;</span>))
</span></span><span style="display:flex;"><span>            (cc (or (mail-fetch-field <span style="color:#e6db74">&#34;Cc&#34;</span>) <span style="color:#e6db74">&#34;&#34;</span>))
</span></span><span style="display:flex;"><span>            (bcc (or (mail-fetch-field <span style="color:#e6db74">&#34;Bcc&#34;</span>) <span style="color:#e6db74">&#34;&#34;</span>))
</span></span><span style="display:flex;"><span>            recipients)
</span></span><span style="display:flex;"><span>        (setq recipients (<span style="color:#a6e22e">concat</span> to <span style="color:#e6db74">&#34;, &#34;</span> cc <span style="color:#e6db74">&#34;, &#34;</span> bcc))
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">;; Remove empty strings from the result</span>
</span></span><span style="display:flex;"><span>        (<span style="color:#a6e22e">delq</span> <span style="color:#66d9ef">nil</span>
</span></span><span style="display:flex;"><span>              (<span style="color:#a6e22e">mapcar</span> (lambda (addr)
</span></span><span style="display:flex;"><span>                        (let ((clean-addr (string-trim addr)))
</span></span><span style="display:flex;"><span>                          (when (not (string-empty-p clean-addr))
</span></span><span style="display:flex;"><span>                            (<span style="color:#a6e22e">downcase</span>
</span></span><span style="display:flex;"><span>                             (if (<span style="color:#a6e22e">string-match</span> <span style="color:#e6db74">&#34;&lt;\\([^&gt;]+\\)&gt;&#34;</span> clean-addr)
</span></span><span style="display:flex;"><span>                                 (string-trim (match-string <span style="color:#ae81ff">1</span> clean-addr))
</span></span><span style="display:flex;"><span>                               clean-addr)))))
</span></span><span style="display:flex;"><span>                      (split-string recipients <span style="color:#e6db74">&#34;,&#34;</span> <span style="color:#66d9ef">t</span>))))))
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  (defun thanos/mail-sign-encrypt ()
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;Auto-encrypt if all recipients have keys, else just sign.&#34;</span>
</span></span><span style="display:flex;"><span>    (let ((trusted-emails (gpg-list-emails-available))
</span></span><span style="display:flex;"><span>          (recipients (thanos/mail-list-recipients-from-buffer)))
</span></span><span style="display:flex;"><span>      (if (cl-every (lambda (r) (<span style="color:#a6e22e">member</span> r trusted-emails)) recipients)
</span></span><span style="display:flex;"><span>          (progn
</span></span><span style="display:flex;"><span>            (<span style="color:#a6e22e">message</span> <span style="color:#e6db74">&#34;Encrypting message.&#34;</span>)
</span></span><span style="display:flex;"><span>            (mml-secure-message-sign-encrypt))
</span></span><span style="display:flex;"><span>        (progn
</span></span><span style="display:flex;"><span>          (<span style="color:#a6e22e">message</span> <span style="color:#e6db74">&#34;Just signing message.&#34;</span>)
</span></span><span style="display:flex;"><span>          (mml-secure-message-sign)))))
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  (add-hook <span style="color:#e6db74">&#39;message-send-hook</span> <span style="color:#a6e22e">#&#39;</span>thanos/mail-sign-encrypt)
</span></span><span style="display:flex;"><span>  :custom
</span></span><span style="display:flex;"><span>  (mml-secure-openpgp-signers <span style="color:#f92672">&#39;</span>(<span style="color:#e6db74">&#34;62B758D0F6719938BC09CECA339F736C3A720928&#34;</span>))) <span style="color:#75715e">;; Change this to your own key!</span>
</span></span></code></pre></div>]]></content:encoded>
    </item>
    <item>
      <title>Major update for Gnosis: 0.5.0 release</title>
      <link>https://thanosapollo.org/posts/gnosis-0-5-0-release/</link>
      <pubDate>Tue, 17 Jun 2025 00:00:00 +0000</pubDate>
      <guid>https://thanosapollo.org/posts/gnosis-0-5-0-release/</guid>
      <description>Gnosis just got a major update with this new release.  With the long promised support of org-mode being added along with other major changes.</description>
      <content:encoded><![CDATA[<p>Gnosis just got a major update with this new release. With the long
promised support of <strong>org-mode</strong> being added along with support for
linking notes to
<a href="https://thanosapollo.org/projects/org-gnosis/">org-gnosis</a> nodes.</p>
<h2 id="org-mode-support">Org Mode Support</h2>
<p>After hacking on org-gnosis and gaining a better
understanding of how org-mode works, I decided to use org-mode for
creating and exporting gnosis notes.</p>
<p>Notes, no matter their note type, will now be as follows:</p>
<blockquote>
<p>Cloze type example.</p>
</blockquote>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-org" data-lang="org"><span style="display:flex;"><span>*<span style="font-weight:bold"> Thema                     </span><span style="font-style:italic"> :pharmacology:antimicrobials:penicillin:</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">:PROPERTIES:
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">:GNOSIS_ID: NEW
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">:GNOSIS_TYPE: cloze
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">:END:</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">**</span> Keimenon
</span></span><span style="display:flex;"><span>What is the treatment for Actinomyces infection?
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Penicillin
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">**</span> Hypothesis
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">- </span>drug type
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">**</span> Answer
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">- </span>Penicillin
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">**</span> Parathema
</span></span><span style="display:flex;"><span>Sulfonamides → Nocardia
</span></span><span style="display:flex;"><span>Actinomyces → [[<span style="color:#a6e22e">id:680ca944-8ee9-4513-92d6-25696ee01f48</span>][<span style="color:#f92672">Penicillin</span>]]
</span></span><span style="display:flex;"><span>(treatment is a SNAP)
</span></span></code></pre></div><blockquote>
<p>Note that anki-like syntax is still supported for clozes.</p>
</blockquote>
<!--quoteend-->
<blockquote>
<p>MCQ example</p>
</blockquote>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-org" data-lang="org"><span style="display:flex;"><span>*<span style="font-weight:bold"> Thema                                                           </span><span style="font-style:italic"> :clinical:</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">:PROPERTIES:
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">:GNOSIS_ID: NEW
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">:GNOSIS_TYPE: mcq
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">:END:</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">**</span> Keimenon
</span></span><span style="display:flex;"><span>A 60-year-old man comes to the physician with chills, nausea, and
</span></span><span style="display:flex;"><span>diffuse muscle aches for 3 days. His niece had similar symptoms 2
</span></span><span style="display:flex;"><span>weeks ago and H3N2 influenza strain was isolated from her respiratory
</span></span><span style="display:flex;"><span>secretions. He received his influenza vaccination 2 months ago. His
</span></span><span style="display:flex;"><span>temperature is 38.5°C. A rapid influenza test is
</span></span><span style="display:flex;"><span>positive. Which of the following mechanisms best explains this
</span></span><span style="display:flex;"><span>patient&#39;s infection despite vaccination?
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">**</span> Hypothesis
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">- </span>Random point mutations within viral genome
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">- </span>Complementing with functional viral proteins
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">- </span>Exchange of viral genes between chromosomes
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">- </span>Reassortment of viral RNA segments
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">- </span>Acquisition of viral surface proteins
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">**</span> Answer
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">- </span>Random point mutations within viral genome
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">**</span> Parathema
</span></span><span style="display:flex;"><span>Random point mutations within the viral genome are responsible for
</span></span><span style="display:flex;"><span>antigenic drift, which creates a new virus strain.
</span></span></code></pre></div><p>Each note is a <strong>thema</strong> consisting of the following components:</p>
<ul>
<li><strong>Keimenon</strong>; The main text or question.</li>
<li><strong>Hypothesis</strong>; Assumptions/hints for the text to guide to the right answer
<ul>
<li>For example this is used as hints for cloze type or as choices in MCQs</li>
</ul>
</li>
<li><strong>Answer</strong>; The correct response or solution to the keimenon.</li>
<li><strong>Parathema</strong>; expansion of keimenon, that can include links to e.g
org-gnosis topics or even files, serving as a way to link org-gnosis
topics to current thema.</li>
</ul>
<p>Optionally, you can use also add tags for each note.</p>
<p>Notes/themas can have multiple hypotheses and answers (<em>depending on
their type</em>), separated by <code>gnosis-export-separator</code>, which defaults to
<code>&quot;\n-&quot;</code> (a new line followed by a dash).</p>
<h2 id="support-for-exporting-decks">Support for exporting decks</h2>
<p>Support for exporting decks as org files via <code>gnosis-export-deck</code> has
been added.</p>
<h2 id="support-for-org-gnosis-notes">Support for org-gnosis notes</h2>
<blockquote>
<p>With this update org-gnosis is finally part of gnosis. The goal is
not to just have a spaced repetition tool, but an all-in-one
learning tool.</p>
</blockquote>
<p>With this new update you can do reviews for specific <strong>org-gnosis</strong>
topics.</p>
<ul>
<li>Use <code>M-x gnosis-review-topic</code> to select a topic from your org-gnosis
notes to review all linked themas.</li>
<li>You can link a thema to an org-gnosis topic by adding an org id
link to either the parathema <em>(recommended)</em> or keimenon, using
<code>M-x org-gnosis-insert</code>.</li>
</ul>
<blockquote>
<p>Future versions will further expand on this functionality.</p>
</blockquote>
<h2 id="deprecated-support-for-images">Deprecated support for images</h2>
<ul>
<li>Image support will be rewritten in the next minor version
<ul>
<li>Support to display file links of images will be added.</li>
</ul>
</li>
</ul>
<h2 id="deprecated-support-for-y-or-n-notes">Deprecated support for y-or-n notes</h2>
<p>With this update your current <code>y-or-n</code> notes will be converted into MCQ
type, with &ldquo;Yes&rdquo; &amp; &ldquo;No&rdquo; choices.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Rewriting Gnosis: 0.4.0 release</title>
      <link>https://thanosapollo.org/posts/gnosis-0-4-0-release/</link>
      <pubDate>Wed, 07 Aug 2024 00:00:00 +0000</pubDate>
      <guid>https://thanosapollo.org/posts/gnosis-0-4-0-release/</guid>
      <description>Gnosis (γνῶσις), a spaced repetition system implementation for GNU Emacs</description>
      <content:encoded><![CDATA[<p>What&rsquo;s the most important thing for storing knowledge?</p>
<p>I&rsquo;d say proper organization of said knowledge, such as with decks for
each subject and meaningful tags linking related concepts together across
decks, making it easily searchable and accessible.</p>
<p>As I started adding more and more notes into gnosis, I found myself
wanting to adjust the review algorithm not only for decks but for tags
as well. This led me to overhaul the underlying architecture and
reimplement key concepts.</p>
<h2 id="key-changes-made">Key Changes Made</h2>
<ul>
<li>Redesigned <code>gnosis-dashboard</code> with a <em>home-page-like</em> buffer
displaying current activity stats such as review streak and today&rsquo;s
due notes.
<img loading="lazy" src="/images/gnosis-dashboard-03.png"></li>
<li>Rewritten gnosis algorithm:
<ul>
<li>Added <strong>gnosis-score</strong>, the current knowledge score for a note.</li>
<li>Added <strong>epignosis</strong> value, that indicates the knowledge accuracy
for a given note, as well as <strong>agnoia</strong> to indicate the lack of
knowledge for a note, those values will be used in <strong>anagnosis
events</strong>. <em>The &ldquo;indication&rdquo; is the translation of those words
from greek.</em></li>
<li>Added special review events; <strong>Anagnosis</strong> &amp; <strong>Lethe</strong>
<ul>
<li><strong>Anagnosis</strong> refers to the recognition &amp; understanding of a
context, anagnosis events are triggered by either consecutive
failed or successful recalls. Depending on how it&rsquo;s triggered,
<strong>epignosis</strong> or <strong>agnoia</strong> will be applied to <strong>gnosis-score</strong></li>
<li><strong>Lethe</strong> refers to the forgetting of knowledge, it&rsquo;s triggered
by consecutive failures to recall an answer, upon this event the
next interval is set to 0</li>
</ul>
</li>
<li>Added <strong>amnesia</strong>, upon failing to recall a note, amnesia value is
used to determine the next interval.</li>
<li>Added <strong>proto</strong>, a list that consist of integers, indicating the
value for the first intervals. Proto list does not have a limit
on length.</li>
</ul>
</li>
<li>Re-implement the configuration for the above deck values, and added
the ability to do the same for tags. Tag configuration takes
priority over deck configuration.</li>
</ul>
<p><em>Example:</em></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(setq gnosis-custom-values
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&#39;</span>((:deck <span style="color:#e6db74">&#34;demo&#34;</span> (:proto (<span style="color:#ae81ff">0</span> <span style="color:#ae81ff">1</span> <span style="color:#ae81ff">3</span>) :anagnosis <span style="color:#ae81ff">3</span> :epignosis <span style="color:#ae81ff">0.5</span> :agnoia <span style="color:#ae81ff">0.3</span> :amnesia <span style="color:#ae81ff">0.5</span> :lethe <span style="color:#ae81ff">3</span>))
</span></span><span style="display:flex;"><span>    (:tag <span style="color:#e6db74">&#34;demo-concept&#34;</span> (:proto (<span style="color:#ae81ff">1</span> <span style="color:#ae81ff">2</span>) :anagnosis <span style="color:#ae81ff">3</span> :amnesia <span style="color:#ae81ff">0.7</span>))))
</span></span></code></pre></div><p>A note under the deck <em>demo</em> tagged with <em>demo-concept</em> will have the
demo deck values with the exception of:</p>
<ul>
<li><code>proto</code> value set to <code>(1 2)</code></li>
<li><code>amnesia</code> value set to <code>0.7</code></li>
</ul>
<p>For notes that have multiple tags, the maximum value is retained for
most parameters. However, <code>anagnosis</code> and <code>lethe</code> will retain the
minimum value.</p>
<h2 id="next-features-on-the-horizon">Next features on the horizon</h2>
<ul>
<li>Org mode integration</li>
<li>Deck export &amp; import</li>
</ul>
]]></content:encoded>
    </item>
    <item>
      <title>Emacs Email Management | Setup Guide for mu4e &amp; isync</title>
      <link>https://thanosapollo.org/posts/mu4e-guide/</link>
      <pubDate>Mon, 29 Jan 2024 00:00:00 +0000</pubDate>
      <guid>https://thanosapollo.org/posts/mu4e-guide/</guid>
      <description>Managing emails with emacs, using mu4e &amp;amp; isync.</description>
      <content:encoded><![CDATA[<p>Email, hate it or love it, we all have to deal with it. Thankfully,
thanks to Emacs &amp; <a href="https://github.com/djcb/mu">mu4e</a> you can have a
productive and, dare I say, fun time working with emails.</p>
<h2 id="about">About</h2>
<p>In this guide I will guide you through setting up mu4e with multiple
accounts, using isync &amp; mu, as well as the basics of how to
incorporate mu4e into your workflow, plus tips &amp; tricks like using
mu4e actions to apply git patches.</p>
<p>To follow this guide, make sure to enable IMAP/SMTP access for your
email account. The steps to enable this may vary depending on your
specific email provider, so I won&rsquo;t cover that in this guide.</p>
<h2 id="why-mu4e">Why mu4e?</h2>
<p>There are multiple options available in GNU Emacs for managing emails,
such as rmail, gnus, notmuch, and mu4e.</p>
<p>Each of these options has its own complexities, depending on your
specific use case.</p>
<p>In my personal experience, I find mu4e to be preferable due to its
ease of setup, particularly when dealing with multiple accounts.</p>
<h2 id="installing-mu-isync">Installing MU &amp; isync</h2>
<p>To get started, install <strong>mu</strong> &amp; <strong>isync</strong></p>
<ul>
<li>Arch Linux</li>
</ul>
<!--listend-->
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>$ sudo pacman -S mu isync
</span></span></code></pre></div><ul>
<li>Gentoo</li>
</ul>
<!--listend-->
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>$ sudo emerge -av mu isync
</span></span></code></pre></div><p><code>NOTE</code>: Make sure you to use <code>emacs</code> USEFLAG for mu</p>
<p>If <code>mu</code> is not packaged for your distro, I recommend changing to a new
one. But if you insist, you might have success installing mu from
source, using
<a href="https://github.com/radian-software/straight.el">straight.el</a>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(straight-use-package <span style="color:#e6db74">&#39;mu4e</span>)
</span></span></code></pre></div><h2 id="setting-up-mbsync">Setting up mbsync</h2>
<p>Edit your configuration: <code>~/.mbsyncrc</code></p>
<h3 id="example-setup-for-fastmail">Example setup for Fastmail:</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>IMAPAccount fastmail
</span></span><span style="display:flex;"><span>Host imap.fastmail.com
</span></span><span style="display:flex;"><span>Port 993
</span></span><span style="display:flex;"><span>User myaccount@fastmail.com
</span></span><span style="display:flex;"><span>PassCmd &#34;emacsclient -e &#39;(password-store-get-field \&#34;fastmail.com/myaccount@fastmail.com\&#34; \&#34;smtp\)&#39;&#34;
</span></span><span style="display:flex;"><span>SSLType IMAPS
</span></span><span style="display:flex;"><span>SSLVersions TLSv1.2
</span></span><span style="display:flex;"><span>CertificateFile /etc/ssl/certs/ca-certificates.crt
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>IMAPStore fastmail-remote
</span></span><span style="display:flex;"><span>Account fastmail
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>MaildirStore fastmail-local
</span></span><span style="display:flex;"><span>Path ~/Mail/Fastmail/
</span></span><span style="display:flex;"><span>Inbox ~/Mail/Fastmail/Inbox
</span></span><span style="display:flex;"><span>Trash ~/Mail/Fastmail/Trash/
</span></span><span style="display:flex;"><span>SubFolders Verbatim
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Channel fastmail
</span></span><span style="display:flex;"><span>Far :fastmail-remote:
</span></span><span style="display:flex;"><span>Near :fastmail-local:
</span></span><span style="display:flex;"><span>Patterns *
</span></span><span style="display:flex;"><span>Expunge None
</span></span><span style="display:flex;"><span>CopyArrivalDate yes
</span></span><span style="display:flex;"><span>Sync All
</span></span><span style="display:flex;"><span>Create Both
</span></span><span style="display:flex;"><span>SyncState *
</span></span></code></pre></div><h3 id="example-setup-for-gmail">Example setup for Gmail:</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>IMAPAccount gmail
</span></span><span style="display:flex;"><span>Host imap.gmail.com
</span></span><span style="display:flex;"><span>Port 993
</span></span><span style="display:flex;"><span>User myaccount@gmail.com
</span></span><span style="display:flex;"><span>PassCmd &#34;pass google/mygmail.com&#34;
</span></span><span style="display:flex;"><span>SSLType IMAPS
</span></span><span style="display:flex;"><span>SSLVersions TLSv1.2
</span></span><span style="display:flex;"><span>CertificateFile /etc/ssl/certs/ca-certificates.crt
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>IMAPStore gmail-remote
</span></span><span style="display:flex;"><span>Account gmail
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>MaildirStore gmail-local
</span></span><span style="display:flex;"><span>Path ~/Mail/Account-GMAIL/
</span></span><span style="display:flex;"><span>SubFolders Verbatim
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Channel gmail
</span></span><span style="display:flex;"><span>Far :gmail-remote:
</span></span><span style="display:flex;"><span>Near :gmail-local:
</span></span><span style="display:flex;"><span>Patterns * ![Gmail]* &#34;[Gmail]/Sent Mail&#34; &#34;[Gmail]/Starred&#34; &#34;[Gmail]/All Mail&#34; &#34;[Gmail]/Trash&#34;
</span></span><span style="display:flex;"><span>Expunge None
</span></span><span style="display:flex;"><span>CopyArrivalDate yes
</span></span><span style="display:flex;"><span>Sync All
</span></span><span style="display:flex;"><span>Create Both
</span></span><span style="display:flex;"><span>SyncState *
</span></span><span style="display:flex;"><span>Settings you should adjust:
</span></span></code></pre></div><ul>
<li><code>PassCmd</code> this should output your account password. I personally use
pass as my password manager.</li>
</ul>
<p>In the fastmail example above I get my password with this emacs
function:</p>
<p><code>(password-store-get-field \&quot;fastmail.com/myaccount@fastmail.com\&quot; \&quot;smtp\)</code></p>
<p><code>password-store</code> is a pass front-end for Emacs.</p>
<p><code>NOTE</code>: You can instead of PassCmd, use Pass that just has your
password in plain text, but I do not recommend this for security
reasons.</p>
<ul>
<li>
<p><code>CertificateFile</code> - This location can vary based on your Linux distribution.</p>
</li>
<li>
<p><code>Patterns</code> - Defines which folders will be synced, I personally just
define my folders manually, similarly to the fastmail example.</p>
</li>
</ul>
<p>Feel free to define multiple accounts this way.</p>
<p>After configuring isync, start the initial sync by running this command:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>$ mbsync -a
</span></span></code></pre></div><h2 id="setting-up-mu-mu4e">Setting up mu &amp; mu4e</h2>
<p>First, you have to run the initial index.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>mu init --maildir=~/Mail --my-address myaccount@fastmail.com
</span></span><span style="display:flex;"><span>mu index
</span></span></code></pre></div><p><code>NOTE</code>: You may add as many <code>--my-address</code> arguments you want.</p>
<p>Now, it&rsquo;s time to create your mu4e configuration for Emacs.</p>
<p>You may create this as a module, or just as part of your :config using use-package. I personally define variables in my init.el like this:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(defvar is-desktop (<span style="color:#a6e22e">equal</span> (<span style="color:#a6e22e">system-name</span>) <span style="color:#e6db74">&#34;desktop-hostname&#34;</span>)) <span style="color:#75715e">;; your $HOSTNAME</span>
</span></span><span style="display:flex;"><span>(defvar is-laptop (<span style="color:#a6e22e">equal</span> (<span style="color:#a6e22e">system-name</span>) <span style="color:#e6db74">&#34;laptop-hostname&#34;</span>))
</span></span></code></pre></div><p>Create <code>~/.emacs.d/modules/thanos-mu4e.el</code> for the mu4e module
configuration. And add this to my init.el</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(add-to-list <span style="color:#e6db74">&#39;load-path</span> <span style="color:#e6db74">&#34;~/.emacs.d/modules&#34;</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>(when (or is-desktop is-laptop)
</span></span><span style="display:flex;"><span>  (require <span style="color:#e6db74">&#39;thanos-mu4e</span>))
</span></span></code></pre></div><p>This way I only load my mu4e configuration only when I&rsquo;m using my
laptop or desktop.</p>
<h2 id="loading-mu4e">Loading Mu4e</h2>
<p>Make sure <code>mu4e</code> is on load-path:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(add-to-list <span style="color:#e6db74">&#39;load-path</span> <span style="color:#e6db74">&#34;/usr/share/emacs/site-lisp/mu4e/&#34;</span>) <span style="color:#75715e">;; path to mu4e</span>
</span></span><span style="display:flex;"><span>(require <span style="color:#e6db74">&#39;mu4e</span>)
</span></span></code></pre></div><h2 id="the-essentials">The essentials</h2>
<p>This is an example configuration to get started with mu4e using multiple accounts:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(setf mu4e-get-mail-command <span style="color:#e6db74">&#34;mbsync -a&#34;</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>(when (and is-desktop (server-running-p))
</span></span><span style="display:flex;"><span>  (setf mu4e-update-interval (<span style="color:#a6e22e">*</span> <span style="color:#ae81ff">10</span> <span style="color:#ae81ff">60</span>)))
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">;; Snippet from EmacsWiki</span>
</span></span><span style="display:flex;"><span>(defun set-mu4e-context (context-name full-name mail-address signature)
</span></span><span style="display:flex;"><span>  <span style="color:#e6db74">&#34;Return a mu4e context named CONTEXT-NAME with :match-func matching
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">    folder name CONTEXT-NAME in Maildir. The context&#39;s </span><span style="color:#e6db74">`user-mail-address&#39;</span><span style="color:#e6db74">,
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">    </span><span style="color:#e6db74">`user-full-name&#39;</span><span style="color:#e6db74"> and </span><span style="color:#e6db74">`mu4e-compose-signature&#39;`smtpmail-smpt-server&#39;</span><span style="color:#e6db74"> is set to MAIL-ADDRESS
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">    FULL-NAME SIGNATURE and SERVER respectively.
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">    Special folders are set to context specific folders.&#34;</span>
</span></span><span style="display:flex;"><span>  (let ((dir-name (<span style="color:#a6e22e">concat</span> <span style="color:#e6db74">&#34;/&#34;</span> context-name)))
</span></span><span style="display:flex;"><span>    (make-mu4e-context
</span></span><span style="display:flex;"><span>     :name context-name
</span></span><span style="display:flex;"><span>     <span style="color:#75715e">;; we match based on the maildir of the message</span>
</span></span><span style="display:flex;"><span>     :match-func
</span></span><span style="display:flex;"><span>     <span style="color:#f92672">`</span>(lambda (msg)
</span></span><span style="display:flex;"><span>    (when msg
</span></span><span style="display:flex;"><span>      (string-match-p
</span></span><span style="display:flex;"><span>       <span style="color:#f92672">,</span>(<span style="color:#a6e22e">concat</span> <span style="color:#e6db74">&#34;^&#34;</span> dir-name)
</span></span><span style="display:flex;"><span>       (mu4e-message-field msg :maildir))))
</span></span><span style="display:flex;"><span>     :vars
</span></span><span style="display:flex;"><span>     <span style="color:#f92672">`</span>((user-mail-address    <span style="color:#f92672">.</span> <span style="color:#f92672">,</span>mail-address)
</span></span><span style="display:flex;"><span>       (<span style="color:#a6e22e">user-full-name</span>       <span style="color:#f92672">.</span> <span style="color:#f92672">,</span>full-name)
</span></span><span style="display:flex;"><span>       (mu4e-sent-folder     <span style="color:#f92672">.</span> <span style="color:#f92672">,</span>(<span style="color:#a6e22e">concat</span> dir-name <span style="color:#e6db74">&#34;/Sent&#34;</span>))
</span></span><span style="display:flex;"><span>       (mu4e-drafts-folder   <span style="color:#f92672">.</span> <span style="color:#f92672">,</span>(<span style="color:#a6e22e">concat</span> dir-name <span style="color:#e6db74">&#34;/Drafts&#34;</span>))
</span></span><span style="display:flex;"><span>       (mu4e-trash-folder    <span style="color:#f92672">.</span> <span style="color:#f92672">,</span>(<span style="color:#a6e22e">concat</span> dir-name <span style="color:#e6db74">&#34;/Trash&#34;</span>))
</span></span><span style="display:flex;"><span>       (mu4e-trash-folder    <span style="color:#f92672">.</span> <span style="color:#f92672">,</span>(<span style="color:#a6e22e">concat</span> dir-name <span style="color:#e6db74">&#34;/Starred&#34;</span>))
</span></span><span style="display:flex;"><span>       (mu4e-refile-folder   <span style="color:#f92672">.</span> <span style="color:#f92672">,</span>(<span style="color:#a6e22e">concat</span> dir-name <span style="color:#e6db74">&#34;/Archive&#34;</span>))
</span></span><span style="display:flex;"><span>       (mu4e-compose-signature <span style="color:#f92672">.</span> <span style="color:#f92672">,</span>signature)))))
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">;;Fixing duplicate UID errors when using mbsync and mu4e</span>
</span></span><span style="display:flex;"><span>(setf mu4e-change-filenames-when-moving <span style="color:#66d9ef">t</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>(setf mu4e-maildir-shortcuts
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&#39;</span>((<span style="color:#e6db74">&#34;/Fastmail/Inbox&#34;</span> <span style="color:#f92672">.</span> <span style="color:#e6db74">?f</span>)
</span></span><span style="display:flex;"><span>    (<span style="color:#e6db74">&#34;/Drafts&#34;</span> <span style="color:#f92672">.</span> <span style="color:#e6db74">?d</span>)
</span></span><span style="display:flex;"><span>    (<span style="color:#e6db74">&#34;/Sent&#34;</span> <span style="color:#f92672">.</span> <span style="color:#e6db74">?s</span>)
</span></span><span style="display:flex;"><span>    (<span style="color:#e6db74">&#34;/Gmail-Account/[Gmail]/All Mail&#34;</span> <span style="color:#f92672">.</span> <span style="color:#e6db74">?g</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>(setf mu4e-contexts
</span></span><span style="display:flex;"><span>      (<span style="color:#a6e22e">list</span>
</span></span><span style="display:flex;"><span>       (make-mu4e-context
</span></span><span style="display:flex;"><span>    :name <span style="color:#e6db74">&#34;fastmail&#34;</span>
</span></span><span style="display:flex;"><span>    :match-func
</span></span><span style="display:flex;"><span>    (lambda (msg)
</span></span><span style="display:flex;"><span>      (when msg
</span></span><span style="display:flex;"><span>        (string-prefix-p <span style="color:#e6db74">&#34;/Fastmail&#34;</span> (mu4e-message-field msg :maildir))))
</span></span><span style="display:flex;"><span>    :vars <span style="color:#f92672">&#39;</span>((user-mail-address <span style="color:#f92672">.</span> <span style="color:#e6db74">&#34;username@fastmail.com&#34;</span>)
</span></span><span style="display:flex;"><span>        (<span style="color:#a6e22e">user-full-name</span>    <span style="color:#f92672">.</span> <span style="color:#e6db74">&#34;User Name&#34;</span>)
</span></span><span style="display:flex;"><span>        (smtpmail-smtp-server <span style="color:#f92672">.</span> <span style="color:#e6db74">&#34;smtp.fastmail.com&#34;</span>)
</span></span><span style="display:flex;"><span>        (smtpmail-smtp-service <span style="color:#f92672">.</span> <span style="color:#ae81ff">465</span>)
</span></span><span style="display:flex;"><span>        (smtpmail-stream-type <span style="color:#f92672">.</span> ssl)
</span></span><span style="display:flex;"><span>        (mu4e-drafts-folder  <span style="color:#f92672">.</span> <span style="color:#e6db74">&#34;/Drafts&#34;</span>)
</span></span><span style="display:flex;"><span>        (mu4e-sent-folder  <span style="color:#f92672">.</span> <span style="color:#e6db74">&#34;/Sent&#34;</span>)
</span></span><span style="display:flex;"><span>        (mu4e-refile-folder  <span style="color:#f92672">.</span> <span style="color:#e6db74">&#34;/Archive&#34;</span>)
</span></span><span style="display:flex;"><span>        (mu4e-trash-folder  <span style="color:#f92672">.</span> <span style="color:#e6db74">&#34;/Trash&#34;</span>)))
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">;; You can comment out the second account.</span>
</span></span><span style="display:flex;"><span>       (make-mu4e-context
</span></span><span style="display:flex;"><span>    :name <span style="color:#e6db74">&#34;gmail&#34;</span>
</span></span><span style="display:flex;"><span>    :match-func
</span></span><span style="display:flex;"><span>    (lambda (msg)
</span></span><span style="display:flex;"><span>      (when msg
</span></span><span style="display:flex;"><span>        (string-prefix-p <span style="color:#e6db74">&#34;/Gmail-Account&#34;</span> (mu4e-message-field msg :maildir))))
</span></span><span style="display:flex;"><span>    :vars <span style="color:#f92672">&#39;</span>((user-mail-address <span style="color:#f92672">.</span> <span style="color:#e6db74">&#34;username@gmail.com&#34;</span>)
</span></span><span style="display:flex;"><span>        (<span style="color:#a6e22e">user-full-name</span>    <span style="color:#f92672">.</span> <span style="color:#e6db74">&#34;User Name&#34;</span>)
</span></span><span style="display:flex;"><span>        (smtpmail-smtp-server <span style="color:#f92672">.</span> <span style="color:#e6db74">&#34;smtp.gmail.com&#34;</span>)
</span></span><span style="display:flex;"><span>        (smtpmail-smtp-service <span style="color:#f92672">.</span> <span style="color:#ae81ff">465</span>)
</span></span><span style="display:flex;"><span>        (smtpmail-stream-type <span style="color:#f92672">.</span> ssl)))))
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>(setf message-send-mail-function <span style="color:#e6db74">&#39;smtpmail-send-it</span>
</span></span><span style="display:flex;"><span>      mu4e-compose-signature <span style="color:#e6db74">&#34;My Signature&#34;</span>
</span></span><span style="display:flex;"><span>      mu4e-compose-context-policy <span style="color:#e6db74">&#39;ask</span>)
</span></span></code></pre></div><h2 id="extras">Extras</h2>
<h3 id="mu4e-actions">Mu4e actions</h3>
<p>Mu4e actions makes it really simple to work with git patches, this is
an example configuration you may like to use:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(setf mu4e-view-actions
</span></span><span style="display:flex;"><span>      (delete-dups
</span></span><span style="display:flex;"><span>       (<span style="color:#a6e22e">append</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&#39;</span>((<span style="color:#e6db74">&#34;gapply git patches&#34;</span> <span style="color:#f92672">.</span> mu4e-action-git-apply-patch)
</span></span><span style="display:flex;"><span>      (<span style="color:#e6db74">&#34;mgit am patch&#34;</span> <span style="color:#f92672">.</span> mu4e-action-git-apply-mbox)))))
</span></span></code></pre></div><h3 id="sign-your-emails-using-pgp">Sign your emails using pgp</h3>
<p>If you have setup your own pgp key, you may sign automatically all your emails using this hook:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(add-hook <span style="color:#e6db74">&#39;message-send-hook</span> <span style="color:#e6db74">&#39;mml-secure-message-sign-pgpmime</span>)
</span></span></code></pre></div><p>Take a look at the functions defined for <code>mml-mode-map</code> for more.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Gnosis (γνῶσις) First Release</title>
      <link>https://thanosapollo.org/posts/gnosis-release/</link>
      <pubDate>Tue, 16 Jan 2024 00:00:00 +0000</pubDate>
      <guid>https://thanosapollo.org/posts/gnosis-release/</guid>
      <description>Gnosis (γνῶσις), a spaced repetition system implementation for GNU Emacs</description>
      <content:encoded><![CDATA[<p>Gnosis (γνῶσις) is a <a href="https://en.wikipedia.org/wiki/Spaced_repetition">spaced
repetition</a> system
(SRS) implementation for note taking and self testing, for <a href="https://www.gnu.org/software/emacs/">GNU
Emacs</a>.</p>
<p>Gnosis does not use flashcard type learning, instead it uses a binary
value to rate user input. Meaning you either know the right answer, or
you do not, no rating of your own is involved.</p>
<h2 id="about">About</h2>
<p>On my last post, <a href="http://thanosapollo.org/post/spaced-repetition-software-gripes/">Spaced Repetition Software
Gripes</a>,
I outlined a blueprint for what I consider to be the optimal design of
an SRS, that caters to <strong>my personal</strong> preferences.</p>
<p>So, I&rsquo;ve developed my own SRS, gnosis (γνῶσις), pronounced &ldquo;GNU-sis&rdquo;,
<em>meaning knowledge in Greek</em>. This SRS addresses the concerns that I
previously highlighted. Currently, I have found it to be highly
beneficial and, as a result, I decided to share it with all of you.</p>
<h3 id="differences-with-other-srs">Differences with other SRS</h3>
<p>Gnosis does not implement flashcard type review sessions where the
user rates his own answer on an arbitrary scale. Instead implements
&ldquo;note&rdquo; types that require user input. Some of these note types, like
the <code>MCQ</code> <em>multiple choice question</em>, even allow for simulating
real-life exams.</p>
<p>Unlike other SRS implementations for GNU Emacs, gnosis does not rely
on <code>org-mode</code>, which I&rsquo;ve found not to be an ideal option for a
database replacement. Instead opting for an
<a href="https://www.sqlite.org/index.html">sqlite</a> database with
<a href="https://en.wikipedia.org/wiki/Git">git</a> to track any changes made,
enabling efficient data management, manipulation and data integrity.</p>
<p>Furthermore, since Gnosis is built upon Emacs, with Emacs Lisp, it
offers a convenient and (hopefully) enjoyable experience for
customization according to your individual preferences.</p>
<p>However, one drawback of using Gnosis is that it is not currently
supported on mobile devices, as Emacs has yet to extend its
compatibility to such platforms.</p>
<h2 id="installation">Installation</h2>
<p>You can get gnosis from my personal git server
<a href="https://git.thanosapollo.org/gnosis">here</a> or using this <a href="https://git.sr.ht/~thanosapollo/gnosis">sourcehut
mirror</a>.</p>
<h3 id="straight.el">Straight.el</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(straight-use-package
</span></span><span style="display:flex;"><span> <span style="color:#f92672">&#39;</span>(gnosis :type git
</span></span><span style="display:flex;"><span>          :host <span style="color:#66d9ef">nil</span>
</span></span><span style="display:flex;"><span>          :repo <span style="color:#e6db74">&#34;https://git.thanosapollo.org/gnosis&#34;</span>))
</span></span></code></pre></div><h3 id="manual">Manual</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>$ git clone https://git.thanosapollo.org/gnosis
</span></span></code></pre></div><p><em>Add this to your emacs configuration:</em></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(add-to-list <span style="color:#e6db74">&#39;load-path</span> <span style="color:#e6db74">&#34;/path/to/gnosis&#34;</span>)
</span></span><span style="display:flex;"><span>(load-file <span style="color:#e6db74">&#34;~/path/to/gnosis.el&#34;</span>)
</span></span><span style="display:flex;"><span>(require <span style="color:#e6db74">&#39;gnosis</span>)
</span></span></code></pre></div><h2 id="adding-notes">Adding notes</h2>
<p>Creating notes for gnosis can be done with a simple
<code>M-x gnosis-add-note</code></p>
<p>Everything is done through the mini-buffer. My personal workflow takes
advantage of that by not really leaving <code>gnosis-add-note</code> prompt until
I finish studying a chapter/section, using
<a href="https://github.com/vedang/pdf-tools">pdf-tools</a> or
<a href="https://depp.brause.cc/nov.el/">nov.el</a>.</p>
<p><em>I think you won&rsquo;t need much guidance on creating notes for any note type, except <code>cloze</code>.</em></p>
<h3 id="creating-cloze-type-notes">Creating cloze type notes</h3>
<p>Cloze type note questions are formatted similarly to Anki&rsquo;s syntax, like so:
&gt; {c1:Cyproheptadine} is a(n) {c2:5-HT2} receptor antagonist used to treat {c2:serotonin syndrome}</p>
<p><em>NOTE</em>: You can also format clozes like Anki if you so prefer; e.g
<code>{{c1::Cyproheptadine}}</code></p>
<ul>
<li>
<p>For each <code>cX</code>-tag there will be created a cloze type note, the above
example creates 2 cloze type notes.</p>
</li>
<li>
<p>Each <code>cX</code> tag can have multiple clozes, but each cloze must be a
<em>UNIQUE</em> word (or a unique combination of words) in given note.</p>
</li>
</ul>
<h2 id="customizing-gnosis-algorithm">Customizing gnosis algorithm</h2>
<h3 id="gnosis-algorithm-interval"><code>gnosis-algorithm-interval</code></h3>
<p>This is a list of 2 numbers, for the first 2 intervals after a
successful review. For example:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(setq gnosis-algorithm-interval <span style="color:#f92672">&#39;</span>(<span style="color:#ae81ff">1</span> <span style="color:#ae81ff">3</span>))
</span></span></code></pre></div><p>After first successfully reviewing a note, you will see it again
tomorrow, if you successfully review said note again, the next review
will be after 3 days.</p>
<h3 id="gnosis-algorithm-ef"><code>gnosis-algorithm-ef</code></h3>
<p>This is the value of gnosis &ldquo;easiness factor&rdquo;, it&rsquo;s basically a list
that consists of 3 items. The first item is the increase factor, used
to increase the easiness factor upon successful review. Second item
refers to the decrease factor, used to decrease the easiness factor
upon an unsuccessful review. The third item is the (starting) total
easiness factor, used to calculate the next interval.</p>
<p>The basic&rsquo;s of how this is used is that it&rsquo;s being multiplied with the
last interval, e.g if you last reviewed a note 6 days ago, and the
easiness factor (total) of this note is 2.0, your next interval would
be 6 * 2.0 &amp; the next total ef will be 2.0 + increase-factor.</p>
<p>Example configuration:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(setq gnosis-algorithm-ef <span style="color:#f92672">&#39;</span>(<span style="color:#ae81ff">0.3</span> <span style="color:#ae81ff">0.3</span> <span style="color:#ae81ff">1.3</span>))
</span></span></code></pre></div><h3 id="gnsois-algorithm-ff"><code>gnsois-algorithm-ff</code></h3>
<p>This is the value of gnosis forgetting factor (ff), it needs to be a
floating number below 1. This is used to calculate the next interval
upon an unsuccessful review, by being multiplied with last interval.
If for a note with a value of last-interval of 6 days and a ff of 0.5,
upon an unsuccessful review the next interval will be in 6 * 0.5 days</p>
<p>Example configuration:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(setq gnosis-algorithm-ff <span style="color:#ae81ff">0.5</span>)
</span></span></code></pre></div>]]></content:encoded>
    </item>
    <item>
      <title>Spaced Repetition Software Gripes</title>
      <link>https://thanosapollo.org/posts/spaced-repetition-software-gripes/</link>
      <pubDate>Tue, 09 Jan 2024 00:00:00 +0000</pubDate>
      <guid>https://thanosapollo.org/posts/spaced-repetition-software-gripes/</guid>
      <description>Issues with Spaced Repetition (Learning) Software &amp;amp; Announcement of Gnosis</description>
      <content:encoded><![CDATA[<p>In this post I&rsquo;m essentially publicizing my notes on spaced repetition
software, and announcing that I&rsquo;m working on
<a href="https://git.thanosapollo.org/gnosis">gnosis</a>, a spaced repetition
learning extension/package for GNU Emacs.</p>
<p>I should also note that I consider <a href="https://en.wikipedia.org/wiki/Spaced_repetition">Spaced
Repetition</a> to be a
cheat code for learning, <strong>that should be used by every student</strong>.</p>
<h2 id="what-is-spaced-repetition-learning">What is Spaced Repetition Learning</h2>
<p><a href="https://en.wikipedia.org/wiki/Spaced_repetition">Spaced Repetition</a>
is based on the following premise:
&gt; Repetitive exposure to information contributes to the elongation of memory retention.</p>
<p>Our cognitive faculties are inherently programmed to retain pertinent
information while discarding extraneous details, a process contingent
upon the frequency by which we encounter such information.</p>
<blockquote>
<p>TL;DR: The more frequently you are exposed to information, the longer you retain it</p>
</blockquote>
<h2 id="my-gripes-with-spaced-repetition-software">My &lsquo;gripes&rsquo; with spaced repetition software</h2>
<p>I have chosen to develop my own SRS (Spaced Repetition Software/System) instead
of relying on existing, well-established ones. Through my
implementation called &ldquo;gnosis&rdquo; (GNOH-sis, meaning knowledge in Greek)
I aim to address and overcome the challenges and limitations
associated with current SRS solutions. With gnosis, I hope to resolve
most, if not all, of these issues and provide a more refined and
<strong>advanced</strong> learning experience.</p>
<h3 id="not-libreware">Not libreware</h3>
<p>This refers to <a href="https://en.wikipedia.org/wiki/Proprietary_software">proprietary
software</a> that
implements spaced repetition, some of which are even guilty for
removing the spaced repetition feature that their users paid for. I
had a paid subscription with <a href="https://quizlet.com/">quizlet</a> only to
find out that they removed the spaced repetition feature I had already
paid &amp; was using, rendering my then workflow obsolete.</p>
<p>Do not depend on software you don&rsquo;t own for your work. <strong>You don&rsquo;t
&ldquo;own&rdquo; proprietary software, despite paying for it.</strong></p>
<blockquote>
<p>You should strive to use only <a href="https://en.wikipedia.org/wiki/Free_software">libreware</a> for your workflow.</p>
</blockquote>
<h3 id="lack-of-customization">Lack of customization</h3>
<p>Good software should fit your workflow like a glove, to do that it has
to give <em>a lot of</em> room for user customization. Trivial changes such
as color-scheme changes to more advanced feature customization like
adding your own custom card types and changing the spaced repetition
algorithm should be simple and easy to make. For example, a med
student would use a longer time interval for his algorithm than, let&rsquo;s
say, someone trying to expand their Japanese vocabulary.</p>
<p>Since we already established the need for our ideal software to be
<em>libreware</em>, making changes to the core components would be trivial.
But it should be added that customization to fit different needs &amp;
learning styles should be a primary goal when designing a SRS.</p>
<h3 id="flashcards-are-an-inferior-learning-method.">Flashcards are an inferior learning method.</h3>
<p>Flashcards are quite trivial to make, prototypical spaced repetition
methods utilized physical flashcards. Today&rsquo;s computers allows us for
more sophisticated &lsquo;review&rsquo; methods, <em>such as using user input</em>.</p>
<p>Utilizing user input to assess the effectiveness of a review is
preferable to simply revealing an answer and asking whether it was
known or not. This approach ensures not only the comprehension of the
answer but also the accurate spelling of it. Moreover, it leads to
more efficient retention compared to simply displaying the answer
without any active engagement from the user.</p>
<p>Ideally with <a href="https://git.thanosapollo.org/gnosis">Gnosis</a> I would
also like to implement
<a href="https://en.wikipedia.org/wiki/Multiple_choice">MCQ</a> type to simulate
the <a href="https://en.wikipedia.org/wiki/Usmle">USMLEs</a> exams which I will
<em>hopefully</em> soon be undertaking. <em>This will make it possible to simulate any other MCQ exam</em></p>
<h3 id="no-self-rating">No self-rating</h3>
<p>It is recommended that users do not self-rate their answers. The
review process should involve a binary assessment of success or
failure, where users either recall the answer correctly or not. This
success/failure rating will be used to determine the next interval for
the specific note, optimizing the spaced repetition system for
effective learning.</p>
<h3 id="collaboration">Collaboration</h3>
<p>Most spaced repetition software relies on databases for storage, but
the downside is that databases are not easily readable or editable by
humans, hindering sharing and collaboration.</p>
<p>To address this limitation, I intend to incorporate exporting
capabilities on gnosis. This feature would enable users to export a
deck of notes in a user-friendly format, which can then be easily
shared and collaborated on using tools like
<a href="https://en.wikipedia.org/wiki/Git">git</a> repositories.</p>
<p>This collaborative approach would allow us to work together, share,
and create valuable learning materials that can be used and modified
by everyone involved.</p>
<h3 id="syncing-between-devices">Syncing between devices</h3>
<p>Anki makes syncing between devices a breeze! But it gets terrible slow
if you are syncing a new device when you have a lot of material in
your account, plus you depend on Anki&rsquo;s servers for it to work.</p>
<p>Since on gnosis I will be using
<a href="https://en.wikipedia.org/wiki/Sqlite">sqlite</a> as my database
implementation, I would just be using git to keep my database in sync
between different devices.</p>
<h2 id="gnosis">Gnosis</h2>
<p>You can find gnosis on my git server
<a href="https://git.thanosapollo.org/gnosis">here</a>, <em>read the about section for installation instructions</em>.</p>
<p>It&rsquo;s still not even in alpha version yet, but it has the fundamental
functionality there already for you to test. Feel free to email me if
you have any questions or requests for gnosis.</p>]]></content:encoded>
    </item>
    <item>
      <title>pcomplete-yay | Extensible completions for yay in eshell</title>
      <link>https://thanosapollo.org/posts/pcomplete-yay/</link>
      <pubDate>Fri, 13 Oct 2023 00:00:00 +0000</pubDate>
      <guid>https://thanosapollo.org/posts/pcomplete-yay/</guid>
      <description>Extensible completions for yay in eshell [Emacs Package]</description>
      <content:encoded><![CDATA[<p>Eshell is my favorite shell, but it&rsquo;s not as polished or well
documented for daily tasks. One such example is using completions for
package managers, like yay, to install/remove packages.</p>
<h2 id="about">About</h2>
<p>I&rsquo;m using eshell more than any other shell lately, but it&rsquo;s lacking in
terms of completions when it comes to other shells.</p>
<p>I&rsquo;ve made this simple package to provide completions for installing &amp;
removing packages using <a href="https://github.com/Jguer/yay">yay</a>.</p>
<p>Eshell provides a seamless integration with the rest of the Emacs
ecosystem &amp; thanks to the integration it has with
<a href="https://codeberg.org/akib/emacs-eat">Eat</a> it has no issue with visual
commands as of now, that previously struggled with. All it&rsquo;s missing is
decent completion features, which I believe we will see more of soon.</p>
<h2 id="installation">Installation</h2>
<p>You can get <code>pcomplete-yay</code> by following the instructions on project&rsquo;s
<a href="https://git.thanosapollo.org/pcomplete-yay/about">git repo</a>.</p>]]></content:encoded>
    </item>
  </channel>
</rss>
