<?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>hi, it&#39;s mike</title>
    <link>https://mike.puddingtime.org/tags/mu4e/</link>
    <description>Recent content on hi, it&#39;s mike</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>mike@puddingtime.org (mike)</managingEditor>
    <webMaster>mike@puddingtime.org (mike)</webMaster>
    <copyright>© 2026, mike</copyright>
    <lastBuildDate>Sun, 14 May 2023 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://mike.puddingtime.org/tags/mu4e/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Daily Notes for 2023-05-14</title>
      <link>https://mike.puddingtime.org/posts/2023-05-14-daily-notes/</link>
      <pubDate>Sun, 14 May 2023 00:00:00 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2023-05-14-daily-notes/</guid>
      <description>org-mode evolution, fixing mu4e/Doom&amp;rsquo;s busted leader key, Guardians Vol. 3, not taking pictures lately</description>
      <content:encoded><![CDATA[<h2 id="guardians-of-the-galaxy-vol-dot-3">Guardians of the Galaxy, Vol. 3</h2>
<p>This weekend Al and I went down to Eugene to see Ben and have a small getaway, with a trip to the movies, too. We saw <em>Guardians of the Galaxy Vol. 3</em> and walked out of it feeling like we&rsquo;d seen a good conclusion to the trilogy. I always appreciate a good trailer fakeout, and the one they did for this one was sort of a double head-fake, making you think you&rsquo;d seen the high-stakes thing, then pulling that rug out from under in the first five minutes, then making the stakes high again.</p>
<p>It was a darker, more violent movie than the previous <em>Guardians</em> installments, maybe to raise the stakes high enough to make it all feel like a good sendoff. Parts of it are heart-rending. There&rsquo;s a little <em>Wizard of Oz</em> stuff going on at the end I choose to give a pass, because James Gunn appears to be decamping from the MCU to go do DC stuff and I get the need to provide a little closure I&rsquo;m not sure anyone was asking for.</p>
<p>I was a pretty big Howard the Duck fan as a grade schooler, so I&rsquo;ve always appreciated the way Cosmic Marvel balances the, er, cosmic stakes with a little silliness. <em>Guardians Vol. 3</em> keeps the silliness, pulls the stakes in a little, and manages more darkness than usual. It was an interesting balacing act that seemed to work.</p>
<p>We couldn&rsquo;t go to a normal showing so we had to do a 3D show, and that didn&rsquo;t do much for my opinion of 3D. Always seems like the screen is a little more dim and some detail is lost for not a ton of benefit.  I&rsquo;ll be happy to see it at home when it starts streaming.</p>
<p>Also, Portland movie-going audiences are, on balance, better than the Eugene one we dealt with. Lots more people in their phones, more chatter in the audience. The glare of the phones is worse than the chatter, which was at least sort of participatory and topical vs., like, random couple behind you is processing their relationship for 140 minutes (my <em>Magnolia</em> experience years ago). OTOH, it was Saturday night of the second week of the run. We tend to do the movies that matter to us at quiet matinees and don&rsquo;t go to many weekend evening shows anymore, so maybe the crowds we&rsquo;re used to are not going because it&rsquo;s a social event.</p>
<h2 id="dug-out-my-old-org-mode-config">Dug out my old org-mode config</h2>
<p>Maybe seven or eight years ago I was working in a group that had an intense progeress reporting culture. I was entrenched in org-mode and had things set up such that I could make a status report out of my <code>work.org</code> file with a quick export. It was not a bad way to live: If I was just keeping track of the things my team was doing, my status report was pre-written on Friday morning.</p>
<p>I went digging around in the config I had set up from that period and it&rsquo;s interesting how much weight I was putting on tags for my organization. I&rsquo;ve got a ton of custom agenda views set up for people, teams, and contexts. Now that I look at it again, I guess I was still trying to do gtd in some form or another, because I can also see custom agenda views for <code>NEXT</code> items.</p>
<p>The emphasis on tags was also about the benefit of emergent organization. My custom agenda commands were really simple affairs, organized around a top-level &ldquo;people, teams, contexts&rdquo; scheme. So if I was walking into a 1:1 with, say, &ldquo;Isaac,&rdquo; I could invoke the agenda dispatcher and tap <code>p i</code> (&ldquo;people&rdquo; &ldquo;isaac&rdquo;) to get all our topics. In the context of my weekly status reports, which were director-level things, you could scan down all the work in flight in my group and see the people tags if you wanted to know who was on what.</p>
<p>Anyhow, by making simple configs, like this:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span class="line"><span class="cl"><span class="p">(</span><span class="s">&#34;g&#34;</span> <span class="o">.</span>  <span class="s">&#34;Groups&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="s">&#34;gd&#34;</span> <span class="s">&#34;Docs&#34;</span> <span class="nv">tags-todo</span> <span class="s">&#34;docs&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="s">&#34;gD&#34;</span> <span class="s">&#34;DIO&#34;</span> <span class="nv">tags-todo</span> <span class="s">&#34;DIO&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="s">&#34;gs&#34;</span> <span class="s">&#34;Staff&#34;</span> <span class="nv">tags-todo</span> <span class="s">&#34;staff&#34;</span><span class="p">)</span></span></span></code></pre></div>
<p>&hellip; I could easily add new tags to the agenda dispatch as they came into prominence, or retire old ones.</p>
<p>This time around, I&rsquo;ve got a lot more up-front organization. I guess I didn&rsquo;t really know about categories back then, because I see no evidence I ever used them. Now, every file has a category, and most of the top-level headings in any of my files have a <code>:CATEGORY:</code> property. It makes the agenda view cleaner (category names, not file names) and  it&rsquo;s easy to quick-filter by category (tap <code>s c</code> to &ldquo;filter on category at point&rdquo;).</p>
<p>Part of what makes that work is also a growing hierarchy of org-capture templates. I was wondering why I didn&rsquo;t do more with that back then until I found a bunch of config around <code>org-remember</code>. That was still the &ldquo;get this thing out of your head&rdquo; option when I first started using org-mode. I can see some generic <code>org-capture</code> stuff I pasted in, but it&rsquo;s rudimentary and I am pretty sure I never really used it. Now, I have a variety of org-capture templates that target specific headings in my org-mode files. I tend to work in transient capture buffers, not within files.</p>
<p>With a more robust org-capture hierarchy, categorization of headings, more active use of the agenda, and increasing use of org-roam, I don&rsquo;t spend much less time in my org-mode files this time around.</p>
<p>Once a week, given my current employment circumstances, I have to go through and read some log entries I capture. When I work on a daily post, I have a capture template to instantiate the entry, but I quickly move it to an indirect buffer. I&rsquo;m writing this subheading in an indirect buffer that started from a &ldquo;blog idea&rdquo; capture template with an <code>IDEA</code> type, to make sure I can see all my blogging ideas in the agenda. When an idea doesn&rsquo;t pan out to my liking but I invested time in it, I atomize it into org-roam with <code>org-roam-extract-subtree</code> and tag it. I need to rewrite some of my PRM functions to operate from the agenda, but I&rsquo;d otherwise never actually touch my <code>contacts.org</code> file, either.</p>
<p>I guess what I&rsquo;m getting at is that the trend feels more and more like atomization and abstraction toward the construction of a plaintext database, and less like &ldquo;working on individual text files.&rdquo;</p>
<p>Which I&rsquo;m really happy about. You can do a ton to make org-mode files look nice and do some auto-formatting, but it&rsquo;s easy to get hung up on everything lining up nicely instead of remembering it&rsquo;s all just data that tends to be readable in its own context, even if it isn&rsquo;t perfectly tidy in a wider context.</p>
<p>It&rsquo;s the smarts I was talking about <a href="/posts/2023-05-12-daily-notes/#my-things-link-to-org-stuff">when I wrote about linking stuff in Things</a> that org-mode running in Emacs gives you that doesn&rsquo;t exist in the org syntax highlighters you get in other editors, and that apps like Ulysses get close to but can&rsquo;t quite manage.</p>
<h2 id="fixing-doom-s-busted-leader-key-in-mu4e">Fixing Doom&rsquo;s busted leader key in mu4e</h2>
<p>I am not using mu4e (much), and one of the reasons it was easy to set aside was some brokenness in the way its keybindings interact with Doom Emacs: The space key stopped being the normal Doom leader key and started being the scroll key. I tried to remap it using what I understood of Doom keymapping, but nothing doing. About three weeks ago I posted a question in the Doom Emacs subreddit and on the Doom Discourse, but the best I got was &ldquo;yeah, upstream&rsquo;s broken.&rdquo;</p>
<p>Yesterday <a href="https://old.reddit.com/r/DoomEmacs/comments/12t98y6/using_mu4e_in_doom_how_can_i_get_the_spacebar/jk132gw/">someone on the subreddit finally replied</a> with a recipe:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span class="line"><span class="cl"><span class="p">(</span><span class="nv">after!</span> <span class="nv">mu4e</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="nv">evil-define-key*</span> <span class="o">&#39;</span><span class="p">(</span><span class="nv">emacs</span><span class="p">)</span> <span class="nv">mu4e-main-mode-map</span> <span class="p">(</span><span class="nv">kbd</span> <span class="s">&#34;SPC&#34;</span><span class="p">)</span> <span class="ss">&#39;doom/leader</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="nv">evil-define-key*</span> <span class="o">&#39;</span><span class="p">(</span><span class="nv">emacs</span><span class="p">)</span> <span class="nv">mu4e-headers-mode-map</span> <span class="p">(</span><span class="nv">kbd</span> <span class="s">&#34;SPC&#34;</span><span class="p">)</span> <span class="ss">&#39;doom/leader</span><span class="p">))</span></span></span></code></pre></div>
<p>That syntax is &hellip; <em>impossible</em> &hellip; to me. But it works.</p>
<h2 id="picture-taking-dot-i-m-not-doing-it-much-dot">Picture taking. I&rsquo;m not doing it much.</h2>
<p>After months of constant photography, I just stopped taking pictures. I know my Fujifilm has a few dozen pictures sitting on the card, and I haven&rsquo;t even taken pictures on the phone except to do things like grab a picture of a receipt or remember which floor of a parking garage I&rsquo;m on.</p>
<p>I remember the morning Al and I were going to head out the door for a coffee walk and I grabbed the camera, then thought about the photos I hadn&rsquo;t even processed still sitting on the card, and just put it down. I also remember taking it with me to Astoria and just not wanting to shoot anything: I left it in the hotel and maybe took a phone picture or two that I promptly forgot.</p>
<p>I go through periodic no-pictures phases. This one has lasted a while. Looking in Lightroom, this is the last picture I took that really mattered much to me, from February:</p>
<figure><img src="/img/blizzard.jpg"
    alt="Monochrome. Two people cross a street at night during a snowstorm."><figcaption>
      <h4>Late February snow storm</h4>
    </figcaption>
</figure>

<p>And in that picture is probably what passes for &ldquo;the issue.&rdquo;  That was an interesting evening I was excited to get out into and shoot. The camera ended up being caked in snow and ice and it was a miserable experience to be out walking around in it.</p>
<p>Since then and up until the past week or so, it has mostly been &ldquo;normal Portland late winter and early spring,&rdquo; so, flat and kinda gray. We haven&rsquo;t traveled at all.</p>
<p>But the other part of it is that I&rsquo;ve been happy to let things be that way. The last time I went on a long hiatus from regular shooting I felt sort of weird and guilty about it. Like I was not being Mr. Picture Guy, and that meant something was wrong with me because I&rsquo;m supposed to be Mr. Picture Guy.</p>
<p>This time around I thought about it after a few weeks of feeling weird about it and remembered something a writing professor once suggested to me about the times I wasn&rsquo;t being Mr. Writing Guy, which is that it&rsquo;s fine to go through periods where that sense of drive and need isn&rsquo;t there, and that it&rsquo;s even good to let a sense of pressure and drive build up a little before giving it voice.</p>
<p>This weekend I saw some things in Eugene that left me wishing I had a camera besides my phone handy. I paused and watched those scenes and thought about what I was missing &hellip; what I could be capturing &hellip; and felt a twinge of regret that I hadn&rsquo;t grabbed a camera on the way out the door.</p>
<p>Nice to have that feeling.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Quick mu4e notes</title>
      <link>https://mike.puddingtime.org/posts/2023-04-20-quick-mu4e-notes/</link>
      <pubDate>Thu, 20 Apr 2023 00:00:00 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2023-04-20-quick-mu4e-notes/</guid>
      <description>The bear dances! And it dances &amp;hellip; pretty good?</description>
      <content:encoded><![CDATA[<p><a href="https://www.djcbsoftware.nl/code/mu/mu4e.html">mu4e</a> is pretty good!</p>
<p>I went into giving mu a shot giving myself a giant side-eye for doing anything that involved running some MDA on a laptop, which is the minimum to use something like mu.</p>
<p>The intensity of the irritation with myself just deepened when my first pick for delivery &ndash; offlineimap &ndash; didn&rsquo;t pan out and I found myself configuring <a href="https://isync.sourceforge.io/">isync</a> to see if that would do any better. But isync (dba mbsync) works pretty well. It was easy to configure, I figured out how to gpg-encrypt my credentials, and I got it all set up in <a href="https://github.com/lra/mackup">mackup</a> such that I only have to configure/reconfigure in one place.</p>
<p>Most of my aversion to fiddling around with mail comes down to the MDA part, either because of the fragility of the component itself, or the flakiness of running these things on a laptop and how they&rsquo;ll cope with being daemonized in an environment that&rsquo;s not awake all the time. isync itself seems fine after several days, and it seems to be okay running as a <a href="https://github.com/Homebrew/homebrew-services">homebrew service</a> (with one minor caveat).</p>
<p>So that&rsquo;s getting mail down to the machine.</p>
<p><a href="https://github.com/djcb/mu">mu</a> itself &ndash; the indexing/search service for the maildir that isync creates &ndash; is pretty good. I&rsquo;ve got ~231,000 messages indexed in it, and it&rsquo;s super fast. As I&rsquo;ve been working on cleaning up my contacts list it&rsquo;s been great for just <code>mu find &quot;someone&quot;</code> from the command line. In some ways it&rsquo;s almost too helpful given the volume of messages, because you get stuff like multiple reply-to&rsquo;s in headers from Google+ email notifications or whatever, so one name can return 20 or 30 results in an address search.</p>
<p>So that brings us to mu4e.</p>
<p>Most of my aversion to running anything to do with &rsquo;net activity on Emacs comes down to blocking the whole app on a slow operation. I used to use GNUS for both IMAP and Usenet, and remember sometimes just having to get up and walk away during a sync until something finally got around to downloading. It was no way to live and I swore off anything to do with mail on Emacs unless I was willing to do it with an MDA of some kind in place (with all the attendant reasons I did not want to do that applying).</p>
<p>mu4e doesn&rsquo;t even really interact with whatever we could consider a &ldquo;physical&rdquo; mail message, though. I mean, yes &hellip; when you write a message with it, it is creating a tmp of something that is eventually handed off to an MTA, but for reading and processing it is not touching Maildir messages in the filesystem &ndash; it is instead interacting with the mu database as a set of queries. It&rsquo;s super fast. Fast the way Spotlight <em>can</em> be in Apple Mail, or search <em>can</em> be in Gmail, but consistently so.</p>
<p>UI-wise, mu4e is initially puzzling.</p>
<p>It starts from a place of &ldquo;every list of mail is just a database query, not a list of files in a <code>Maildir</code> directory.&rdquo; That&rsquo;s fine. Lots of things in computing exist as vectorized representations of an object in filesystem. The difference between mu4e and some of these other styles of digital information is that not a ton of work has been done to re-translate these vectorized abstractions back into their old metaphor. So the menus, etc. talk in terms of &ldquo;lists of headers&rdquo; and not &ldquo;folders of messages.&rdquo;</p>
<p>Broadly, you can tell mu4e started from mu &ndash;  &ldquo;let&rsquo;s make a mail search engine&rdquo; &ndash;  and then found expression as an Emacs MUA. While other MUAs <em>include</em> the idea of marking and operating but tend to start from a place of direct operation on a message (mutt&rsquo;s an exception), mu4e starts from the assumption you&rsquo;re going to mark and operate. So you don&rsquo;t &ldquo;delete a message,&rdquo; you mark it for deletion (or moving, or whatever) then either execute your marks with the <code>x</code> keystroke, or sign off on executing them when you leave a given header list (i.e. what everyone else calls a folder).</p>
<p>It&rsquo;s &hellip; I hate to even make it sound like this is a thing. If you have room in your life for setting up an MDA, a search engine for mail, and an Emacs MUA, you have whatever it is one needs to interact with a thin layer of abstraction over that whole pile of other abstractions. In some ways, mu4e feels to me like what might have happened if we chucked every innovation in mail interfaces that occurred after <a href="https://en.wikipedia.org/wiki/MH_Message_Handling_System">mh</a> and went straight to &ldquo;nah, dawg, your mail is still there on disk, but it also lives in The Matrix.&rdquo; There&rsquo;s just a little ramp for your muscle memory, is all.</p>
<p>So, what do you get in exchange, I guess?</p>
<p>First, it overcomes the core objection to running an MUA on Emacs at all: Everything except composing a message is a database operation, so everything is pretty fast.</p>
<p>People report being slowed down when trying to send messages with large attachments, and the proposed workaround (an async method you can configure) reportedly flakes out now and then. A dedicated MUA like Apple Mail might just step over that by backgrounding the send operation and letting you go on your way. Some webmail apps will give you the AJAX-y spinner until they&rsquo;re done receiving the attachment, but not otherwise lock you out of using your browser. Conceivably, a big attachment with mu4e will still cost you the use of your text editor for the duration of the attachment. People who refuse to use their text editors for things besides just editing text will find that unacceptable and weird, but also know it&rsquo;s a problem they&rsquo;ll never have.  People who think it&rsquo;s right and proper to use their text editors to catch up on Mastodon, read RSS, send mail, do their calendaring, track their todos, browse the web &hellip; aaaaaaand <em>sometimes</em> edit a text file may be more put off.</p>
<p>By default, at least in Doom, it also hooks its <code>update</code> function into firing off your MDA so it can make sure the database has the latest messages. So when you check your mail with it, it wants to kick off an <code>mbsync</code> run. That doesn&rsquo;t block it. I think it&rsquo;s possible to configure it to just prompt a reindexing of your Maildir instead of a whole MDA run. I need to do a little more in-depth investigation of how well isync is working for me because right now I think mu4e and the Homebrew daemonization fight with each other, but the net effect is that one process gets isync to download my mail instead of the other.</p>
<p><em>Otherwise</em> it is very, very fast, and its keyboard-centric UI is built toward getting at stuff quickly with a bunch of terse keystrokes to navigate to bookmarked mailboxes and canned search queries. Once you get the hang of marking/operating on a list of headers (with equally efficient keystrokes you can also customize) it&rsquo;s a mail processing machine.</p>
<p>No, sorry, excuse me &ndash; it is a mail database processing machine.</p>
<p>I&rsquo;ve previously named a few of these, but besides speed and efficiency, it offers a few other benefits:</p>
<p>First, I love composing mail in org mode markup. I sent myself a few test mails and loved, for instance, that an org mode src block was correctly colorized. org markup is a little more verbose than Markdown in some places. For instance, a blockquote isn&rsquo;t done with a leading <code>&gt;</code> but with a <code>+begin_quote</code> and <code>+end_quote</code> block.</p>
<p>Second, it&rsquo;s easily hooked into <code>org-capture</code>. Here&rsquo;s a capture template for putting a message in your inbox, marked for action within two days:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span class="line"><span class="cl"><span class="o">&#39;</span><span class="p">(</span><span class="s">&#34;M&#34;</span> <span class="s">&#34;process-soon&#34;</span> <span class="nv">entry</span> <span class="p">(</span><span class="nv">file+headline</span> <span class="s">&#34;inbox.org&#34;</span> <span class="s">&#34;Messages&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">        <span class="s">&#34;* TODO %:fromname: %a %?\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \&#34;+2d\&#34;))&#34;</span><span class="p">)</span></span></span></code></pre></div>
<p>In Doom Emacs, you get at that with <code>SPC X M</code>. When it&rsquo;s time to deal with the message, just tap <code>enter</code> on the heading and mu4e opens the message. Excuse me, no, it retrieves the header from the database.</p>
<p>In terms of drawbacks, setup time and learning curve aside, it has a few downsides:</p>
<p>At least one keymapping doesn&rsquo;t play well with Doom Emacs. In mu4e, the <code>SPC</code> key is mapped to <code>scroll-up-command</code> to serve as a pager, whereas that&rsquo;s the leader key for Doom everywhere else. The workaround is to use <code>OPT SPC</code> to get to Doom&rsquo;s menu, but I&rsquo;m still baking that into my muscle memory.</p>
<p>While orgmail-mode is cool and all, it interacts weirdly with the rest of the package sometimes, and I wish I could toggle its HTML mail features on and off now and then.</p>
<p>Its HTML mail presentation is as woeful as any mail client that starts from plaintext land, and the remedy is the same as it is in mutt: Learn the shortcut for opening HTML mail of any complexity straight into your browser.</p>
<p>Finally, it doesn&rsquo;t interact as well with <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Window-Convenience.html#index-winner_002dmode">winner mode</a> as I&rsquo;d like, leaving frames in a weird state after some operations. I did convince ChatGPT to write a hook for me to get mail composer frames to close instead of leaving the view split:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span class="line"><span class="cl"><span class="p">(</span><span class="nv">after!</span> <span class="nv">mu4e</span>
</span></span><span class="line"><span class="cl"><span class="p">(</span><span class="nb">defun</span> <span class="nv">my-mu4e-close-frame-after-send</span> <span class="p">()</span>
</span></span><span class="line"><span class="cl">  <span class="s">&#34;Close the frame after sending a message in mu4e.&#34;</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="nb">when</span> <span class="p">(</span><span class="nb">and</span> <span class="p">(</span><span class="nf">eq</span> <span class="nv">major-mode</span> <span class="ss">&#39;mu4e-compose-mode</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">             <span class="p">(</span><span class="nv">not</span> <span class="p">(</span><span class="nv">mu4e~message-autopgp-p</span><span class="p">)))</span>
</span></span><span class="line"><span class="cl">    <span class="p">(</span><span class="nf">delete-frame</span><span class="p">)))</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="p">(</span><span class="nv">add-hook</span> <span class="ss">&#39;message-sent-hook</span> <span class="nf">#&#39;</span><span class="nv">my-mu4e-close-frame-after-send</span><span class="p">))</span></span></span></code></pre></div>
<p>org-mail also seems to leave behind spare buffers it uses to put together the plaintext part of its multipart messages.</p>
<p>Net, though, it&rsquo;s so fast and efficient that I can see past most of that. I&rsquo;m sort of curious about connecting mutt to notmuch to see how that works, mostly because I know mutt very, very well and feel a little more fluent when it comes to customizing it. Some of the stuff I&rsquo;ve got set up in mu4e could be done with a little utility scripting in mutt.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Extending the plaintext CRM to mail contacts</title>
      <link>https://mike.puddingtime.org/posts/2023-04-18-extending-the-plaintext-crm-to-mail-contacts/</link>
      <pubDate>Tue, 18 Apr 2023 00:00:00 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2023-04-18-extending-the-plaintext-crm-to-mail-contacts/</guid>
      <description>Added a little automation to contacts.org with a function that auto-populates a message buffer in mu4e.</description>
      <content:encoded><![CDATA[<p>I did some menu cleanup and refactor today to get my plaintext CRM into a slightly more mnemonic state. Here are the mappings, which are readable enough:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span class="line"><span class="cl"><span class="p">(</span><span class="nv">map!</span> <span class="nb">:mode</span> <span class="nv">org</span>
</span></span><span class="line"><span class="cl">      <span class="nb">:leader</span>
</span></span><span class="line"><span class="cl">     <span class="p">(</span><span class="nb">:prefix-map</span> <span class="p">(</span><span class="s">&#34;C&#34;</span> <span class="o">.</span> <span class="s">&#34;CRM&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">        <span class="nb">:desc</span> <span class="s">&#34;Schedule Contact&#34;</span> <span class="s">&#34;s&#34;</span> <span class="nf">#&#39;</span><span class="nv">org-schedule-heading</span>
</span></span><span class="line"><span class="cl">        <span class="nb">:desc</span> <span class="s">&#34;Clear TODO states&#34;</span> <span class="s">&#34;z&#34;</span> <span class="nf">#&#39;</span><span class="nv">my/org-remove-todo</span>
</span></span><span class="line"><span class="cl">        <span class="nb">:desc</span> <span class="s">&#34;Update CONTACTED to today&#34;</span> <span class="s">&#34;t&#34;</span> <span class="nf">#&#39;</span><span class="nv">org-set-contacted-today</span>
</span></span><span class="line"><span class="cl">        <span class="nb">:desc</span> <span class="s">&#34;Update CONTACTED to ...&#34;</span> <span class="s">&#34;d&#34;</span> <span class="nf">#&#39;</span><span class="nv">org-set-contacted-date</span>
</span></span><span class="line"><span class="cl">        <span class="nb">:desc</span> <span class="s">&#34;SCHEDULE a date&#34;</span> <span class="s">&#34;S&#34;</span> <span class="nf">#&#39;</span><span class="p">(</span><span class="nb">lambda</span> <span class="p">()</span> <span class="p">(</span><span class="nb">interactive</span><span class="p">)</span> <span class="p">(</span><span class="nv">my/org-set-heading-state-and-time</span> <span class="s">&#34;&#34;</span> <span class="mi">30</span> <span class="ss">&#39;s</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">        <span class="nb">:desc</span> <span class="s">&#34;Mail this contact&#34;</span> <span class="s">&#34;m&#34;</span> <span class="nf">#&#39;</span><span class="nv">my-org-contacts-email</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">     <span class="p">(</span><span class="nb">:prefix-map</span> <span class="p">(</span><span class="s">&#34;C r&#34;</span><span class="o">.</span> <span class="s">&#34;Remember to ...&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">       <span class="nb">:desc</span> <span class="s">&#34;... write within 7 days&#34;</span> <span class="s">&#34;w&#34;</span> <span class="nf">#&#39;</span><span class="p">(</span><span class="nb">lambda</span> <span class="p">()</span> <span class="p">(</span><span class="nb">interactive</span><span class="p">)</span> <span class="p">(</span><span class="nv">my/org-set-heading-state-and-time</span> <span class="s">&#34;WRITE&#34;</span> <span class="mi">7</span> <span class="ss">&#39;d</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">       <span class="nb">:desc</span> <span class="s">&#34;... followup in 3 days&#34;</span> <span class="s">&#34;f&#34;</span> <span class="nf">#&#39;</span><span class="p">(</span><span class="nb">lambda</span> <span class="p">()</span> <span class="p">(</span><span class="nb">interactive</span><span class="p">)</span> <span class="p">(</span><span class="nv">my/org-set-heading-state-and-time</span> <span class="s">&#34;FOLLOWUP&#34;</span> <span class="mi">3</span> <span class="ss">&#39;s</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">       <span class="nb">:desc</span> <span class="s">&#34;... ping within 7 days&#34;</span> <span class="s">&#34;p&#34;</span> <span class="nf">#&#39;</span><span class="p">(</span><span class="nb">lambda</span> <span class="p">()</span> <span class="p">(</span><span class="nb">interactive</span><span class="p">)</span> <span class="p">(</span><span class="nv">my/org-set-heading-state-and-time</span> <span class="s">&#34;PING&#34;</span> <span class="mi">3</span> <span class="ss">&#39;d</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">       <span class="nb">:desc</span> <span class="s">&#34;... invite within 3 days&#34;</span> <span class="s">&#34;i&#34;</span> <span class="nf">#&#39;</span><span class="p">(</span><span class="nb">lambda</span> <span class="p">()</span> <span class="p">(</span><span class="nb">interactive</span><span class="p">)</span> <span class="p">(</span><span class="nv">my/org-set-heading-state-and-time</span> <span class="s">&#34;INVITE&#34;</span> <span class="mi">3</span> <span class="ss">&#39;d</span><span class="p">)))</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span></span></span></code></pre></div>
<p>It&rsquo;s a bunch of &ldquo;tap the leader key, tap &ldquo;<code>C</code>&rdquo; for &ldquo;CRM,&rdquo; then do some common stuff,&rdquo; like setting deadlines to write someone, or update the <code>:CONTACTED:</code> property, or just set the <code>SCHEDULED:</code> date on a record. This is the <code>my/org-set-heading-state-and-time</code> function:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span class="line"><span class="cl"><span class="p">(</span><span class="nb">defun</span> <span class="nv">my/org-set-heading-state-and-time</span> <span class="p">(</span><span class="nv">state</span> <span class="nv">days</span> <span class="kp">&amp;optional</span> <span class="nv">time-type</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="s">&#34;Sets the TODO state and deadline or scheduled date of the current heading.
</span></span></span><span class="line"><span class="cl"><span class="s">   STATE is the new TODO state to set, and DAYS is the number
</span></span></span><span class="line"><span class="cl"><span class="s">   of days from the current date to set the new time. If TIME-TYPE
</span></span></span><span class="line"><span class="cl"><span class="s">   is &#39;d&#39;, sets a deadline; if &#39;s&#39;, sets a scheduled date; otherwise,
</span></span></span><span class="line"><span class="cl"><span class="s">   prompts the user for the time type. Removes any existing schedules
</span></span></span><span class="line"><span class="cl"><span class="s">   or deadlines before setting the new time.&#34;</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="nb">interactive</span> <span class="p">(</span><span class="nf">list</span> <span class="s">&#34;WRITE&#34;</span> <span class="mi">7</span> <span class="no">nil</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="nv">org-entry-put</span> <span class="no">nil</span> <span class="s">&#34;TODO&#34;</span> <span class="nv">state</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="nb">when</span> <span class="p">(</span><span class="nv">org-entry-get</span> <span class="no">nil</span> <span class="s">&#34;DEADLINE&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="p">(</span><span class="nv">org-entry-delete</span> <span class="no">nil</span> <span class="s">&#34;DEADLINE&#34;</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="nb">when</span> <span class="p">(</span><span class="nv">org-entry-get</span> <span class="no">nil</span> <span class="s">&#34;SCHEDULED&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="p">(</span><span class="nv">org-entry-delete</span> <span class="no">nil</span> <span class="s">&#34;SCHEDULED&#34;</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="nb">let</span> <span class="p">((</span><span class="nv">new-time</span> <span class="p">(</span><span class="nf">format-time-string</span> <span class="s">&#34;&lt;%Y-%m-%d %a&gt;&#34;</span>
</span></span><span class="line"><span class="cl">                                      <span class="p">(</span><span class="nf">time-add</span> <span class="p">(</span><span class="nf">current-time</span><span class="p">)</span> <span class="p">(</span><span class="nv">days-to-time</span> <span class="nv">days</span><span class="p">)))))</span>
</span></span><span class="line"><span class="cl">    <span class="p">(</span><span class="nb">cond</span> <span class="p">((</span><span class="nf">equal</span> <span class="nv">time-type</span> <span class="ss">&#39;d</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">           <span class="p">(</span><span class="nv">org-deadline</span> <span class="no">nil</span> <span class="nv">new-time</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">          <span class="p">((</span><span class="nf">equal</span> <span class="nv">time-type</span> <span class="ss">&#39;s</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">           <span class="p">(</span><span class="nv">org-schedule</span> <span class="no">nil</span> <span class="nv">new-time</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">          <span class="p">(</span><span class="no">t</span>
</span></span><span class="line"><span class="cl">           <span class="p">(</span><span class="nb">setq</span> <span class="nv">time-type</span> <span class="p">(</span><span class="nf">completing-read</span> <span class="s">&#34;Set time type (d/s): &#34;</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">           <span class="p">(</span><span class="nv">my/org-set-heading-state-and-time</span> <span class="nv">state</span> <span class="nv">days</span> <span class="p">(</span><span class="nb">if</span> <span class="p">(</span><span class="nv">string=</span> <span class="nv">time-type</span> <span class="s">&#34;d&#34;</span><span class="p">)</span> <span class="ss">&#39;d</span> <span class="ss">&#39;s</span><span class="p">))))))</span></span></span></code></pre></div>
<p>It&rsquo;s written with the menu system in mind. It&rsquo;d be too clunky to use interactively &ndash; too many possible states to remember, etc. but as part of a bunch of canned menu options you can get to with one or two taps it saves a bunch of typing and cursor motion for common operations.</p>
<p>Then I thought, &ldquo;it&rsquo;d be handy to just visit a record and have an option to compose a mail,&rdquo; so <code>my-org-contacts-email</code> was born:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span class="line"><span class="cl"><span class="p">(</span><span class="nb">defun</span> <span class="nv">my-org-contacts-email</span> <span class="p">()</span>
</span></span><span class="line"><span class="cl">  <span class="s">&#34;Open am email message to the email address in the EMAIL property of the current org-contacts heading.&#34;</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="nb">interactive</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="nb">when</span> <span class="p">(</span><span class="nf">eq</span> <span class="nv">major-mode</span> <span class="ss">&#39;org-mode</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="p">(</span><span class="nb">let</span> <span class="p">((</span><span class="nv">email</span> <span class="p">(</span><span class="nv">org-entry-get</span> <span class="p">(</span><span class="nf">point</span><span class="p">)</span> <span class="s">&#34;EMAIL&#34;</span><span class="p">)))</span>
</span></span><span class="line"><span class="cl">      <span class="p">(</span><span class="nb">if</span> <span class="nv">email</span>
</span></span><span class="line"><span class="cl">          <span class="p">(</span><span class="nb">progn</span>
</span></span><span class="line"><span class="cl">            <span class="p">(</span><span class="nb">unless</span> <span class="p">(</span><span class="nb">featurep</span> <span class="ss">&#39;mu4e</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">              <span class="p">(</span><span class="nv">mu4e</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">            <span class="p">(</span><span class="nv">mu4e-compose-new</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">            <span class="p">(</span><span class="nv">message-goto-to</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">            <span class="p">(</span><span class="nf">insert</span> <span class="nv">email</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">            <span class="p">(</span><span class="nv">message-goto-body</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">            <span class="p">(</span><span class="nf">insert</span> <span class="s">&#34;\n\n&#34;</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">        <span class="p">(</span><span class="nf">message</span> <span class="s">&#34;No email address found.&#34;</span><span class="p">)))))</span></span></span></code></pre></div>
<p>It has some behavioral issues I need to straighten out, but if mu4e is running and I tap <code>SPC C m</code> while positioned over a contact, it opens and pre-addresses a new message in mu4e.</p>
<p>I think it&rsquo;s beyond the ken of <code>org-caldav</code>, but I suppose a call out to AppleScript could create similar functionality for scheduling things with a contact.</p>
<p>I really like the Doom menu system (and I suppose I&rsquo;d like Spacemacs&rsquo; as well). The last time I was all-in on org mode I had so much trouble with all the Emacs chords that I ended up setting up <a href="https://gitlab.com/phillord/org-drill/">org-drill</a> to periodically train. With Doom&rsquo;s menus, there are decent mnemonics up front, then visual reminders along the way. It still takes time to learn everything, but you get reminders and you can stop to study the menu if you forget. I don&rsquo;t know how many times I have mashed <code>CTRL g</code> when I lost track of my fingers during a complex vanilla Emacs sequence.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Succumbed to mu.</title>
      <link>https://mike.puddingtime.org/posts/2023-04-17-succumbed-to-mu-dot/</link>
      <pubDate>Mon, 17 Apr 2023 00:00:00 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2023-04-17-succumbed-to-mu-dot/</guid>
      <description>This had to happen eventually.</description>
      <content:encoded><![CDATA[<p>I had some futzing time before writing time this morning, so I succumbed to what I initially thought was just getting <a href="https://www.offlineimap.org/">OfflineIMAP</a> going so I could get some speed improvements from mutt. Then I noticed lbdb had a <a href="https://github.com/djcb/mu">mu</a> backend, which would mean address lookup for 20 years of email. And that meant my <code>packages.el</code> file had that <code>;;(mu4e +org)</code> just sitting there, waiting to be uncommented.</p>
<p>I have a little self-control, so I made myself wait until I had mutt working before trying out <a href="https://www.djcbsoftware.nl/code/mu/mu4e.html">mu4e</a>.</p>
<p>And at that point, there was a yak capering about in my living room, and it had to be shaved:</p>
<ul>
<li>mu</li>
<li>msmtp</li>
<li>mu4e</li>
<li>&hellip; and isync</li>
</ul>
<p>isync because I found a bug in OfflineIMAP, which was inevitable given the 20-year-old email corpus I&rsquo;ve been lugging around between mail servers. It was killing Homebrew&rsquo;s ability to run offlineimap daemonized, so down that rabbit hole I went to satisfy myself the problem was widespread enough that it was worth considering alternatives, and isync has some good press.</p>
<p>Initial impressions:</p>
<ul>
<li>mu is pretty cool on its own. Very curious to play with my 20 years of email with it.</li>
<li>I haven&rsquo;t really tested mu&rsquo;s performance under mutt with search. But it is nice having very fast address lookup.</li>
<li>msmtp is &hellip; fine? I was using built-in SMTP for mutt, msmtp is there for mu4e&rsquo;s benefit so I just use it for both clients now.</li>
<li>isync seems fast enough and works well once the initial mail store is read into maildir.</li>
</ul>
<p>Tomorrow I&rsquo;ll move the data and databases over to my desktop</p>
<p>Oh &hellip; mu4e.</p>
<p>It is weird, but it&rsquo;s my kind of weird. Very high concept. Super fast. The &ldquo;squee&rdquo; factor is being able to compose mail in org-mode markup, which it turns into multipart mail. If you read the HTML version of your mail, mu4e messages look like rich text. If you read the plaintext version, it applies some plaintext styling:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">Heading
</span></span><span class="line"><span class="cl">═══════
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">*Bold* and /italics/ and [a link].
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">[a link] &lt;https://mike.puddingtime.org&gt;
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Subheading
</span></span><span class="line"><span class="cl">──────────</span></span></code></pre></div>
<p>Search is superfast, navigating between folders is keyboard-centric, and because the mail retrieval stuff is happening outside of an Emacs thread, it doesn&rsquo;t block. I think you can set it up to run isync async inside Emacs, but I just noticed someone&rsquo;s config a few minutes ago and it&rsquo;s bedtime.</p>
<p>I am not sure what its future will be. I really like my mutt setup. I wonder if there&rsquo;s a way to get the org-mode mail composition using Emacs as my mutt mail editor. Science needs to be done.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
