<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>Ashish Panigrahi - emacs</title>
  <subtitle>Ashish&#39;s website</subtitle>
  <link rel="self" type="application/atom+xml" href="https://ashishpanigrahi.com/tags/emacs/atom.xml"/>
  <link rel="alternate" type="text/html" href="https://ashishpanigrahi.com"/>
  <generator uri="https://orgmode.org/">Org mode</generator>
  <updated>2026-10-17T00:00:00+00:00</updated>
  <id>https://ashishpanigrahi.com/tags/emacs/atom.xml</id>
  <entry xml:lang="en">
    <title>This website is now built with Org mode</title>
    <published>2026-10-05T00:00:00+00:00</published>
    <updated>2026-10-17T00:00:00+00:00</updated>
    <author><name>Ashish Panigrahi</name></author>
    <link rel="alternate" type="text/html" href="https://ashishpanigrahi.com/blog/orgmode-website-update/"/>
    <id>https://ashishpanigrahi.com/blog/orgmode-website-update/</id>
    <content type="html" xml:base="https://ashishpanigrahi.com/blog/orgmode-website-update/">&lt;p&gt;
&lt;a href=&quot;/blog/zola-website&quot;&gt;Since moving to Zola as my static site generator&lt;/a&gt;, I have had a nice
setup for my website. However, a recent update to zola (v0.22 -&amp;gt;
v0.23) broke my website (it apparently had something to do with the
&lt;a href=&quot;https://keats.github.io/tera/&quot;&gt;Tera&lt;/a&gt; templating engine that zola uses). This forced me to finally make
the move to switching to orgmode as my SSG.
&lt;/p&gt;

&lt;p&gt;
My ultimate goal has always been to build this website purely with
emacs and orgmode&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;https://ashishpanigrahi.com/blog/orgmode-website-update/#fn-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;, and I&#39;m glad now that&#39;s the case. Full
disclosure however, I did take the help of LLMs to implement this over
the weekend. There are still some rough edges to the site, which is
why I have this build on a different branch (instead of &lt;code&gt;main&lt;/code&gt;) on my
website&#39;s &lt;a href=&quot;https://gitlab.com/paniash/website&quot;&gt;source repository&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
The website is generated via &lt;a href=&quot;https://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html&quot;&gt;org-publish&lt;/a&gt; with the following directory
structure for the source code:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;shell&quot;&gt;.
&amp;#9500;&amp;#9472;&amp;#9472; LICENSE
&amp;#9500;&amp;#9472;&amp;#9472; Makefile
&amp;#9500;&amp;#9472;&amp;#9472; README.org
&amp;#9500;&amp;#9472;&amp;#9472; content/
&amp;#9500;&amp;#9472;&amp;#9472; lisp/
&amp;#9500;&amp;#9472;&amp;#9472; publish.el
&amp;#9500;&amp;#9472;&amp;#9472; static/
&amp;#9500;&amp;#9472;&amp;#9472; statichost.yml
&amp;#9500;&amp;#9472;&amp;#9472; style.css
&amp;#9492;&amp;#9472;&amp;#9472; templates/

5 directories, 6 files&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
The key component is &lt;code&gt;publish.el&lt;/code&gt; which exports all of my blogposts (which
are orgmode files now) to html files. I also have the &lt;a href=&quot;https://github.com/emacsorphanage/htmlize/blob/master/htmlize.el&quot;&gt;htmlize.el&lt;/a&gt;
file hosted on the git repo for syntax highlighting.
&lt;/p&gt;

&lt;p&gt;
Feel free to peruse the &lt;a href=&quot;https://gitlab.com/paniash/website/-/tree/orgmode-build&quot;&gt;source code of this build&lt;/a&gt; if you&#39;re interested
in the technical details. At its current state, I&#39;m quite happy with
how it has turned out. A nice little addition (which is the default
behaviour of org-publish) is that I now have a footer entry mentioning
the emacs and orgmode version used to build this website!
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;UPDATE (2026-10-17)&lt;/strong&gt;: I&#39;ve now merged this branch to &lt;code&gt;main&lt;/code&gt;! The current
source code of the repository is now &lt;a href=&quot;https://gitlab.com/paniash/website&quot;&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;section class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;
As is the trend to move all of my computing needs to emacs.
 &lt;a href=&quot;https://ashishpanigrahi.com/blog/orgmode-website-update/#fr-1-1&quot; aria-label=&quot;Back to reference 1&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry xml:lang="en">
    <title>An upgraded workflow on reviewing finished tasks with org-agenda</title>
    <published>2026-09-19T00:00:00+00:00</published>
    <updated>2026-09-21T00:00:00+00:00</updated>
    <author><name>Ashish Panigrahi</name></author>
    <link rel="alternate" type="text/html" href="https://ashishpanigrahi.com/blog/completed-org-items-since-date/"/>
    <id>https://ashishpanigrahi.com/blog/completed-org-items-since-date/</id>
    <content type="html" xml:base="https://ashishpanigrahi.com/blog/completed-org-items-since-date/">&lt;p&gt;
In my &lt;a href=&quot;/blog/done-items-org-agenda/&quot;&gt;last blogpost&lt;/a&gt;, I showcased how I
review tasks finished over the last seven days. It implicitly
assumes that I attend every group meeting&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;https://ashishpanigrahi.com/blog/completed-org-items-since-date/#fn-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt; and that the group
meeting happens during the same time every week&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-2-1&quot;&gt;&lt;a href=&quot;https://ashishpanigrahi.com/blog/completed-org-items-since-date/#fn-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;.
&lt;/p&gt;

&lt;p&gt;
In a more practical sense, it would be nice to generalize this
workflow. I would like to specify a date, since when completed tasks
would be displayed until the current day. This way I would be able to
review my finished agenda items since a particular day in the past.
This date would typically be when the group meeting last occured, but
we are not strictly bound to it.
&lt;/p&gt;
&lt;h2 id=&quot;implementation-in-emacs-lisp&quot;&gt;Implementation in emacs lisp&lt;/h2&gt;
&lt;p&gt;
We write an elisp snippet similar to the one in the previous blogpost.
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;emacs-lisp&quot;&gt;(&lt;span class=&quot;org-keyword&quot;&gt;defvar&lt;/span&gt; &lt;span class=&quot;org-variable-name&quot;&gt;pani/last-group-meeting-date&lt;/span&gt; nil)

(&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; org-agenda-custom-commands
      &#39;((&lt;span class=&quot;org-string&quot;&gt;&quot;v&quot;&lt;/span&gt; &lt;span class=&quot;org-string&quot;&gt;&quot;Finished tasks since last group meeting&quot;&lt;/span&gt;
          tags
          (format &lt;span class=&quot;org-string&quot;&gt;&quot;CLOSED&amp;gt;=\&quot;&amp;lt;%s&amp;gt;\&quot;&quot;&lt;/span&gt;
                  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; pani/last-group-meeting-date
                        (org-read-date nil nil nil &lt;span class=&quot;org-string&quot;&gt;&quot;Last group meeting: &quot;&lt;/span&gt;)))
          ((org-agenda-overriding-header
            (format &lt;span class=&quot;org-string&quot;&gt;&quot;Finished tasks since %s&quot;&lt;/span&gt; pani/last-group-meeting-date))
           (org-agenda-archives-mode t)
           (org-agenda-tag-filter-preset &#39;(&lt;span class=&quot;org-string&quot;&gt;&quot;-emacs&quot;&lt;/span&gt; &lt;span class=&quot;org-string&quot;&gt;&quot;-personal&quot;&lt;/span&gt; &lt;span class=&quot;org-string&quot;&gt;&quot;-email&quot;&lt;/span&gt; &lt;span class=&quot;org-string&quot;&gt;&quot;-misc&quot;&lt;/span&gt;))
           (org-agenda-prefix-format &#39;((tags . &lt;span class=&quot;org-string&quot;&gt;&quot; &quot;&lt;/span&gt;)))
           (org-agenda-remove-tags nil)))))&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
Most of the config options are similar so I won&#39;t be going over in
detail. Let&#39;s instead point out the differences.
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Since we would like emacs to prompt for a date, we use the
&lt;code&gt;org-read-date&lt;/code&gt; function. We also replace &lt;code&gt;CLOSED&amp;gt;=\&quot;&amp;lt;-7d&amp;gt;\&quot;&lt;/code&gt;
with &lt;code&gt;CLOSED&amp;gt;=\&quot;&amp;lt;%s&amp;gt;\&quot;&lt;/code&gt; with &lt;code&gt;%s&lt;/code&gt; being a placeholder for the
specified date. For more details on &lt;code&gt;org-read-date&lt;/code&gt;, read the
&lt;a href=&quot;https://orgmode.org/manual/The-date_002ftime-prompt.html&quot;&gt;official documentation&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;org-agenda-overriding-header&lt;/code&gt; is slightly modified to display
the text &quot;Finished tasks since 2026-09-16&quot; if 16th September is
selected during the date prompt.&lt;/li&gt;
&lt;li&gt;We define a variable &lt;code&gt;pani/last-group-meeting-date&lt;/code&gt; which stores the
value of the date specified. Hence, before the custom org-agenda
view is called, it stores nothing i.e. &lt;code&gt;NIL&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
To invoke this view, we simply run &lt;code&gt;M-x org-agenda&lt;/code&gt; and hit &lt;code&gt;v&lt;/code&gt; to
get into the view.
&lt;/p&gt;
&lt;h3 id=&quot;invoking-custom-org-agenda-views-slightly-faster&quot;&gt;Invoking custom org-agenda views (slightly) faster&lt;/h3&gt;
&lt;p&gt;
Just like in the previous workflow, we write another function to invoke
this custom org-agenda view and bind it to &lt;code&gt;C-c v&lt;/code&gt; to invoke it faster.
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;emacs-lisp&quot;&gt;  (&lt;span class=&quot;org-keyword&quot;&gt;defun&lt;/span&gt; &lt;span class=&quot;org-function-name&quot;&gt;pani/done-items-since-meeting-org-agenda&lt;/span&gt; ()
    &lt;span class=&quot;org-doc&quot;&gt;&quot;Prompt for the date of the last group meeting and show completed tasks since then.
It displays every DONE item closed from the chosen day upto today.&quot;&lt;/span&gt;
    (&lt;span class=&quot;org-keyword&quot;&gt;interactive&lt;/span&gt;)
    (org-agenda nil &lt;span class=&quot;org-string&quot;&gt;&quot;v&quot;&lt;/span&gt;))&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
When invoking the view, we are prompted for a date with a pop-up calendar.
We select a particular date in the past; Typing &quot;-wed&quot; to select last
Wednesday, we are instantly greeted with the following view:
&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/custom-org-agenda-view-since-date-pixelated.png&quot; alt=&quot;My custom org-agenda view&quot; /&gt;&lt;/p&gt;

&lt;p&gt;
With this, we can review tasks not just from the last seven days, but
basically from any day in the past!
&lt;/p&gt;

&lt;div class=&quot;meta&quot;&gt;
Special thanks to &lt;a href=&quot;https://marci.gunyho.com&quot;&gt;Marci&lt;/a&gt; for pointing out typos.
&lt;/div&gt;
&lt;section class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;
I wish I could wake up on time in the morning during winters!
 &lt;a href=&quot;https://ashishpanigrahi.com/blog/completed-org-items-since-date/#fr-1-1&quot; aria-label=&quot;Back to reference 1&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn-2&quot;&gt;
&lt;p&gt;
My supervisor is a busy person, which unfortunately requires the
group meeting to be rescheduled sometimes, albeit infrequently.
 &lt;a href=&quot;https://ashishpanigrahi.com/blog/completed-org-items-since-date/#fr-2-1&quot; aria-label=&quot;Back to reference 2&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry xml:lang="en">
    <title>Reviewing finished tasks from last week in org-agenda and emacs</title>
    <published>2026-07-26T00:00:00+00:00</published>
    <updated>2026-08-12T00:00:00+00:00</updated>
    <author><name>Ashish Panigrahi</name></author>
    <link rel="alternate" type="text/html" href="https://ashishpanigrahi.com/blog/done-items-org-agenda/"/>
    <id>https://ashishpanigrahi.com/blog/done-items-org-agenda/</id>
    <content type="html" xml:base="https://ashishpanigrahi.com/blog/done-items-org-agenda/">&lt;p&gt;
Being a PhD student within a research group entails some structure to
tracking your progress as you proceed with research. Within the
current team that I&#39;m in, we have weekly group meetings where each
member presents the tasks that they&#39;ve completed during the previous
week and discusses any issues they might&#39;ve faced (if any), to our
supervisor.
&lt;/p&gt;

&lt;p&gt;
Usually before the meeting, I jot down things that I&#39;ve finished with
pen and paper. But since I&#39;m in the spirit of integrating my workflow
with emacs and orgmode, I thought why don&#39;t I try implementing this
part of my routine also into orgmode.
&lt;/p&gt;
&lt;h2 id=&quot;enter-org-agenda&quot;&gt;Enter org-agenda&lt;/h2&gt;
&lt;p&gt;
All my todo items are tracked with
&lt;a href=&quot;https://orgmode.org/manual/Agenda-Views.html&quot;&gt;org-agenda&lt;/a&gt; where I
capture every task I need to finish with
&lt;a href=&quot;https://orgmode.org/manual/Capture.html&quot;&gt;org-capture&lt;/a&gt;&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;https://ashishpanigrahi.com/blog/done-items-org-agenda/#fn-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;.
&lt;/p&gt;

&lt;p&gt;
I have a custom org-agenda view just for viewing my daily and weekly
&lt;code&gt;TODO&lt;/code&gt; items, events/meetings scheduled at a certain time and tasks
that have a deadline associated with them. Suffice to say, this
workflow has replaced all my needs for having a calendar over the
cloud, be it Google, Outlook, what have you&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-2-1&quot;&gt;&lt;a href=&quot;https://ashishpanigrahi.com/blog/done-items-org-agenda/#fn-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;. The only downside
that I haven&#39;t figured out (yet) is to incorporate calendar invites
that I receive via email, into my org-agenda automatically instead of
manually capturing an event into the agenda view.
&lt;/p&gt;

&lt;p&gt;
With this custom agenda view, as I finish tasks and mark them &lt;code&gt;DONE&lt;/code&gt;,
they disappear from the current view. This is by design. I figured I
could just review my completed tasks by visiting the relevant files
(&lt;code&gt;tasks.org&lt;/code&gt;, &lt;code&gt;meetings.org&lt;/code&gt;, etc. in my case). But who wants to sift
through all the completed tasks and filter them manually to only note
down the tasks completed during the previous week? Why not automate
this with the power of emacs?
&lt;/p&gt;
&lt;h2 id=&quot;elisp-snippet-that-implements-this-weekly-review&quot;&gt;Elisp snippet that implements this weekly review&lt;/h2&gt;
&lt;p&gt;
The idea is fairly simple. I&#39;d like to look at the tasks that I&#39;ve
completed since the last group meeting. This assumes I review these
tasks on the day of the group meeting (which I do currently&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-3-1&quot;&gt;&lt;a href=&quot;https://ashishpanigrahi.com/blog/done-items-org-agenda/#fn-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;).
&lt;/p&gt;

&lt;p&gt;
We simply then instruct orgmode to filter out the &lt;code&gt;DONE&lt;/code&gt; items from
the last 7 days. The &lt;code&gt;org-agenda-custom-commands&lt;/code&gt; variable is what
we&#39;ll use to define this custom org-agenda view.
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;emacs-lisp&quot;&gt;(&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; org-agenda-custom-commands
      &#39;((&lt;span class=&quot;org-string&quot;&gt;&quot;w&quot;&lt;/span&gt; &lt;span class=&quot;org-string&quot;&gt;&quot;Finished tasks from last week&quot;&lt;/span&gt; tags &lt;span class=&quot;org-string&quot;&gt;&quot;CLOSED&amp;gt;=\&quot;&amp;lt;-7d&amp;gt;\&quot;&quot;&lt;/span&gt;
         ((org-agenda-overriding-header &lt;span class=&quot;org-string&quot;&gt;&quot;Finished tasks from last week&quot;&lt;/span&gt;)
         (org-agenda-archives-mode t)
         (org-agenda-tag-filter-preset &#39;(&lt;span class=&quot;org-string&quot;&gt;&quot;-emacs&quot;&lt;/span&gt; &lt;span class=&quot;org-string&quot;&gt;&quot;-personal&quot;&lt;/span&gt; &lt;span class=&quot;org-string&quot;&gt;&quot;-email&quot;&lt;/span&gt;))
         (org-agenda-prefix-format &#39;((tags . &lt;span class=&quot;org-string&quot;&gt;&quot; &quot;&lt;/span&gt;)))
         (org-agenda-remove-tags nil)))))&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
Let&#39;s go over the various config options one by one:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first line defines the keybinding in the primary org-agenda
dashboard and the associated title for the keybinding.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tags &quot;CLOSED&amp;gt;=\&quot;&amp;lt;-7d&amp;gt;\&quot;&quot;&lt;/code&gt; is pretty self-explanatory. We filter for
items that were completed in the last 7 days.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;org-agenda-overriding-header&lt;/code&gt;: Simply defines the title of the
agenda view.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;org-agenda-archives-mode&lt;/code&gt;: This is set to &lt;code&gt;t&lt;/code&gt; (True) meaning to
also look at the archived entries from last week. I typically archive
my entries frequently so this is helpful.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;org-agenda-tag-filter-preset&lt;/code&gt;: I don&#39;t want personal tasks
appearing in this view, so I remove any items that have the relevant tags.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;org-agenda-prefix-format&lt;/code&gt;: By default, the agenda view contains
information about which file the entries belong to (in my case, it&#39;s
&lt;code&gt;tasks.org&lt;/code&gt;). This appears as &lt;code&gt;tasks:&lt;/code&gt; per entry in the agenda
which unnecessarily clutters the view.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;org-agenda-remove-tags&lt;/code&gt;: I don&#39;t want to remove the tags of the
various entries (they are useful to me) that appear in the right
margin. Hence this variable is set to &lt;code&gt;nil&lt;/code&gt; (False).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
To invoke the view, we can simply run &lt;code&gt;M-x org-agenda&lt;/code&gt; and hit &lt;code&gt;w&lt;/code&gt; to
get into the view. My org-agenda dashboard looks like this:
&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/org-agenda-dashboard.png&quot; alt=&quot;My org-agenda dashboard&quot; /&gt;&lt;/p&gt;

&lt;p&gt;
All the above keys are present in the default view, except my custom
views (depicted by &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;w&lt;/code&gt; keys).
&lt;/p&gt;
&lt;h3 id=&quot;invoking-custom-org-agenda-views-slightly-faster&quot;&gt;Invoking custom org-agenda views (slightly) faster&lt;/h3&gt;
&lt;p&gt;
For my workflow, I mostly deal with just the two org-agenda views
(represented by &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;w&lt;/code&gt;). It&#39;s a good idea to have a global
keybinding to quickly invoke these views. Let&#39;s define the function
and keybinding for it.
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;emacs-lisp&quot;&gt;(&lt;span class=&quot;org-keyword&quot;&gt;defun&lt;/span&gt; &lt;span class=&quot;org-function-name&quot;&gt;pani/done-items-prev-week-org-agenda&lt;/span&gt; ()
  &lt;span class=&quot;org-doc&quot;&gt;&quot;Custom function to immediately jump to my custom org-agenda view.&quot;&lt;/span&gt;
  (&lt;span class=&quot;org-keyword&quot;&gt;interactive&lt;/span&gt;)
  (org-agenda nil &lt;span class=&quot;org-string&quot;&gt;&quot;w&quot;&lt;/span&gt;))&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
To invoke the function, we define the keybinding like via a
&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/use-package.html&quot;&gt;use-package&lt;/a&gt;
macro:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;emacs-lisp&quot;&gt;(&lt;span class=&quot;org-keyword&quot;&gt;use-package&lt;/span&gt; org-agenda
  &lt;span class=&quot;org-builtin&quot;&gt;:ensure&lt;/span&gt; nil
  &lt;span class=&quot;org-comment-delimiter&quot;&gt;;; &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;Don&#39;t need to go through org-agenda template for custom agenda
&lt;/span&gt;  &lt;span class=&quot;org-builtin&quot;&gt;:bind&lt;/span&gt; (&lt;span class=&quot;org-builtin&quot;&gt;:map&lt;/span&gt; global-map
          (&lt;span class=&quot;org-string&quot;&gt;&quot;C-c w&quot;&lt;/span&gt; . pani/done-items-prev-week-org-agenda)))&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
I can then just hit &lt;code&gt;CTRL c w&lt;/code&gt; to bring up this new agenda view.
&lt;/p&gt;

&lt;p&gt;
That&#39;s it! This should make things easier for me during our group&#39;s
weekly meetings.
&lt;/p&gt;

&lt;div class=&quot;meta&quot;&gt;
Special thanks to &lt;a href=&quot;https://marci.gunyho.com&quot;&gt;Marci&lt;/a&gt; and my sister, Alaka Panigrahi for
pointing out grammatical errors and typos.
&lt;/div&gt;
&lt;section class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;
More on this in a future blog-post.
 &lt;a href=&quot;https://ashishpanigrahi.com/blog/done-items-org-agenda/#fr-1-1&quot; aria-label=&quot;Back to reference 1&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn-2&quot;&gt;
&lt;p&gt;
This is fully offline. Between my personal laptop and office PC,
I simply use &lt;a href=&quot;https://syncthing.net&quot;&gt;syncthing&lt;/a&gt; to sync all my orgmode
files via peer-to-peer.
 &lt;a href=&quot;https://ashishpanigrahi.com/blog/done-items-org-agenda/#fr-2-1&quot; aria-label=&quot;Back to reference 2&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn-3&quot;&gt;
&lt;p&gt;
This is perhaps not the best approach but is a good enough starting
point for me.
 &lt;a href=&quot;https://ashishpanigrahi.com/blog/done-items-org-agenda/#fr-3-1&quot; aria-label=&quot;Back to reference 3&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry xml:lang="en">
    <title>Setting up offline email for Microsoft O365 with notmuch and emacs</title>
    <published>2026-06-07T00:00:00+00:00</published>
    <updated>2026-08-01T00:00:00+00:00</updated>
    <author><name>Ashish Panigrahi</name></author>
    <link rel="alternate" type="text/html" href="https://ashishpanigrahi.com/blog/o365-offline-email/"/>
    <id>https://ashishpanigrahi.com/blog/o365-offline-email/</id>
    <content type="html" xml:base="https://ashishpanigrahi.com/blog/o365-offline-email/">&lt;p&gt;
Having to deal with Microsoft&#39;s outlook has been a growing pain with
my computing needs. Of course, this is pertinent only for work email.
For personal email, I use &lt;a href=&quot;https://migadu.com&quot;&gt;Migadu&lt;/a&gt; which has good
standards for email unlike Microsoft&#39;s.
&lt;/p&gt;

&lt;p&gt;
At work, I can only use either the official Outlook webmail or
Thunderbird since those are the only clients that are whitelisted by
the IT department at my university. Thunderbird is slightly better (it
has a few problems of its own but I digress) but I would like to have
an offline copy of all my emails, fully searchable with an indexed
database provided by &lt;a href=&quot;https://notmuchmail.org&quot;&gt;notmuch&lt;/a&gt;, which uses
the excellent &lt;a href=&quot;http://xapian.org/&quot;&gt;Xapian&lt;/a&gt; library for indexing.
Notmuch is shipped as an emacs package in the form of &lt;code&gt;notmuch.el&lt;/code&gt;,
which is exactly what I like given that I&#39;m moving most of my
computing needs into emacs&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-1-1&quot;&gt;&lt;a href=&quot;https://ashishpanigrahi.com/blog/o365-offline-email/#fn-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;.
&lt;/p&gt;

&lt;p&gt;
I&#39;ve taken inspiration from &lt;a href=&quot;https://www.cosroe.com/2025/04/neomutt-notmuch-mbsync.html&quot;&gt;Fergus&#39; excellent
blogpost&lt;/a&gt;
which implements the same in &lt;a href=&quot;https://neomutt.org/&quot;&gt;neomutt&lt;/a&gt;. The
initial setup process is identical to Fergus&#39; blogpost.
&lt;/p&gt;

&lt;p&gt;
It should be noted that notmuch is only a mail indexer. It does not
fetch mail, nor does it send mail. Those are handled by
&lt;a href=&quot;https://isync.sourceforge.io/&quot;&gt;isync&lt;/a&gt; and
&lt;a href=&quot;https://marlam.de/msmtp/&quot;&gt;msmtp&lt;/a&gt;, which are commandline programs.
&lt;/p&gt;
&lt;h2 id=&quot;access-authentication-with-o365&quot;&gt;Access authentication with O365&lt;/h2&gt;
&lt;p&gt;
Since Thunderbird is still allowed to access O365&#39;s authentication, we
will use the client ID provided from it (this is publicly
available from Thunderbird&#39;s source code)&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-2-1&quot;&gt;&lt;a href=&quot;https://ashishpanigrahi.com/blog/o365-offline-email/#fn-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;. For authentication for
IMAP and SMTP, we will use
&lt;a href=&quot;https://learn.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-xoauth/0b717658-4ceb-4401-9da9-7860c9ca2f2f?redirectedfrom=MSDN&quot;&gt;XOAUTH&lt;/a&gt;,
which is a &lt;em&gt;simple authentication and security layer&lt;/em&gt; (SASL) more
suited for email clients.
&lt;/p&gt;

&lt;p&gt;
Tools like isync rely on SASL for authentication, for which we&#39;ll
require an XOAUTH SASL plugin:
&lt;a href=&quot;https://github.com/moriyoshi/cyrus-sasl-xoauth2&quot;&gt;&lt;code&gt;https://github.com/moriyoshi/cyrus-sasl-xoauth2&lt;/code&gt;&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
If you&#39;re on Arch, then this plugin is installable from the AUR:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;shell&quot;&gt;paru -S cyrus-sasl-xoauth2-git&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
If not, then we can build it from source:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;shell&quot;&gt;git clone https://github.com/moriyoshi/cyrus-sasl-xoauth2
&lt;span class=&quot;org-builtin&quot;&gt;cd&lt;/span&gt; cyrus-sasl-xoauth2/
./autogen.sh   &lt;span class=&quot;org-comment-delimiter&quot;&gt;# &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;checks for requirements
&lt;/span&gt;./configure    &lt;span class=&quot;org-comment-delimiter&quot;&gt;# &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;configure (here we use the defaults)
&lt;/span&gt;make           &lt;span class=&quot;org-comment-delimiter&quot;&gt;# &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;compile
&lt;/span&gt;sudo make install     &lt;span class=&quot;org-comment-delimiter&quot;&gt;# &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;install for root user&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;token-generation-for-oauth&quot;&gt;Token generation for OAuth&lt;/h3&gt;
&lt;p&gt;
Microsoft has conditionally allowed API access to clients and the only
way to get access for any client is to register the application in
the Microsot Application portal, which is something only my org&#39;s IT
department can do&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-3-1&quot;&gt;&lt;a href=&quot;https://ashishpanigrahi.com/blog/o365-offline-email/#fn-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;. Fortunately, we can use Thunderbird&#39;s
credentials to generate an access token for our purposes.
&lt;/p&gt;

&lt;p&gt;
Another issue that comes up is the finite lifetime of these access
tokens (typically an hour or two), which is cumbersome to generate
each time one needs to download email. Fortunately,
&lt;a href=&quot;http://www.mutt.org/&quot;&gt;mutt&lt;/a&gt; comes with
&lt;a href=&quot;https://github.com/muttmua/mutt/blob/master/contrib/mutt_oauth2.py&quot;&gt;&lt;code&gt;mutt_oauth2.py&lt;/code&gt;&lt;/a&gt;,
a script to help in the automatic renewal of this token. This script
helps in decrypting the token file and renewing it everytime it is
invoked.
&lt;/p&gt;

&lt;p&gt;
Fetching the initial token is fairly simple but before we do it, there
are certain changes that we need to do to &lt;code&gt;mutt_oauth2.py&lt;/code&gt;.
&lt;/p&gt;

&lt;p&gt;
Look into the &lt;code&gt;ENCRYPTION_PIPE&lt;/code&gt; variable (line 48) and make sure to specify your
gpg key. If you don&#39;t have one, then generate one:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;shell&quot;&gt;gpg --full-generate-key&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
Select the default options (ed25519 cypher if it allows) and make sure
that the expiration of the key is set to 0 (no expiration). This makes
your life easier but of course for security reasons, this is &lt;strong&gt;not a
good practice&lt;/strong&gt;.
&lt;/p&gt;

&lt;p&gt;
Bring up your public key:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;shell&quot;&gt;gpg --list-keys&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
Copy the second line (after the &lt;code&gt;pub&lt;/code&gt; line) and paste it into
&lt;code&gt;mutt_oauth2.py&lt;/code&gt;
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;org-variable-name&quot;&gt;ENCRYPTION_PIPE&lt;/span&gt; &lt;span class=&quot;org-operator&quot;&gt;=&lt;/span&gt; [&lt;span class=&quot;org-string&quot;&gt;&#39;gpg&#39;&lt;/span&gt;, &lt;span class=&quot;org-string&quot;&gt;&#39;--encrypt&#39;&lt;/span&gt;, &lt;span class=&quot;org-string&quot;&gt;&#39;--recipient&#39;&lt;/span&gt;, &lt;span class=&quot;org-string&quot;&gt;&#39;YOUR-GPG-KEY&#39;&lt;/span&gt;]&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
After this, look at line 79. This includes a &lt;code&gt;client_id&lt;/code&gt; for
&lt;code&gt;microsoft&lt;/code&gt;. For Thunderbird, the client id is
&lt;code&gt;9e5f94bc-e8a4-4e73-b8be-63364c29d753&lt;/code&gt;. Leave the &lt;code&gt;client_secret&lt;/code&gt;
value as is. It should look like so:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;org-doc&quot;&gt;&#39;client_id&#39;&lt;/span&gt;: &lt;span class=&quot;org-doc&quot;&gt;&#39;9e5f94bc-e8a4-4e73-b8be-63364c29d753&#39;&lt;/span&gt;,
&lt;span class=&quot;org-doc&quot;&gt;&#39;client_secret&#39;&lt;/span&gt;: &lt;span class=&quot;org-doc&quot;&gt;&#39;&#39;&lt;/span&gt;,&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
Now we are ready to generate the access token. Simply run:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;shell&quot;&gt;./mutt_oauth2.py OUTPUT_TOKEN_FILE --verbose --authorize&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
A series of prompts should appear. Select &lt;code&gt;microsoft&lt;/code&gt;,
&lt;code&gt;localhostauthcode&lt;/code&gt; (or &lt;code&gt;authcode&lt;/code&gt;), followed by your email address, after which you
should automatically be redirected to a browser for adding your
credentials for authentication. Doing so, should reveal the access
token in your terminal. No need to copy it, it is present in your
&lt;code&gt;OUTPUT_TOKEN_FILE&lt;/code&gt; which is encrypted. To obtain the decrypted token,
we run the script again with just the file name as an argument
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;shell&quot;&gt;./mutt_oauth2.py OUTPUT_TOKEN_FILE&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
A nice thing is that running this script with the token file also
checks for expiry and renews it if necessary. This can be done
multiple times without worry.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;UPDATE (2026-06-19)&lt;/strong&gt;: About 20 days after I set this up, for whatever reason the
token file expired on my personal laptop. I&#39;m not entirely sure what
happened but the fix for now was to regenerate the token again. I&#39;ll
need to debug the exact cause to prevent it from happening again.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;UPDATE (2026-07-29)&lt;/strong&gt;: It looks like this problem only appears on my
personal laptop as it&#39;s not an authorized device and as
such, 14 days is the maximum duration before which the token needs
to be reauthorized. My office PC is within this &quot;authorized&quot; devices
whitelist and thus doesn&#39;t need reauthentication after the initial setup.
&lt;/p&gt;
&lt;h2 id=&quot;offline-email-setup&quot;&gt;Offline email setup&lt;/h2&gt;
&lt;p&gt;
Now that we are done with the difficult part, we move onto setting up
isync (the binary is called &lt;code&gt;mbsync&lt;/code&gt;) which is available in most
distributions. This program basically downloads your emails offline
and synchronizes it with your email&#39;s remote IMAP servers. It supports
multiple accounts too. The program is configurable with a
&lt;code&gt;~/.mbsyncrc&lt;/code&gt; file&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-4-1&quot;&gt;&lt;a href=&quot;https://ashishpanigrahi.com/blog/o365-offline-email/#fn-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;. I highly recommend reading the manual for it
via &lt;code&gt;man mbsync&lt;/code&gt;. Here&#39;s a starting template:
&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# -- Global defaults
# These will be applied to all accounts

# Create new mail in either location, so if the remote or local has mail
# and the other does not, then create it
Create Both
# never remote mail from either side
Remove None
# Remove messages marked for deletion from the local side on the
# remote. Do not ever delete local if marked for deletion in the
# remote. Prevents admins from deleting one&#39;s local mail
Expunge Far
Sync All
SyncState *
CopyArrivalDate yes
# No maximum number of messages
MaxMessages 0

# -- First email account
IMAPAccount university
Host outlook.office365.com
Port 993
User my-username@university.edu
AuthMechs XOAUTH2
PassCmd &quot;~/.local/bin/mutt_oauth2.py ~/.local/bin/TOKEN&quot;
# Use TLS
TLSType IMAPS
SystemCertificates yes
Timeout 10

# A store defines a collection of mailboxes, so we associate the
# remote IMAP mailbox with the account we just configured
IMAPStore university-remote
# Associate the store with our account
Account university

# Where are we going to keep the mail associated with this account
MaildirStore university-local
SubFolders Verbatim
Path ~/.local/share/mail/university/
Inbox ~/.local/share/mail/university/INBOX

# Channel to synchronize everything except &quot;Sent&quot; email
Channel uni-main
Far :university-remote:
Near :university-local:
# Which directories to synchronize
Patterns INBOX &quot;Deleted Items&quot; &quot;Drafts&quot;

# Channel to synchronize &quot;Sent&quot; email
Channel uni-sent
Far :university-remote:&quot;Sent Items&quot;
Near :university-local:Sent

# Group the two channels and sync everything with `mbsync NAME`
Group university
Channel uni-main
Channel uni-sent

# -- Second email account
IMAPAccount personal
...&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
Once you have everything configured, we can start downloading all our
email by running:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;shell&quot;&gt;mbsync university&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
The first time &lt;code&gt;mbsync&lt;/code&gt; is run, it will take a fair amount of time,
since you&#39;ll be downloading a lot of email (assuming you&#39;ve been using
your account for a long time). The subsequent runs would be just
incremental downloads, so it&#39;s much faster.
&lt;/p&gt;

&lt;p&gt;
After navigating to your local Maildir directory
(&lt;code&gt;~/.local/share/mail/university&lt;/code&gt; in my case), you should see all your
emails downloaded and categorized into inbox, drafts, sent, and
deleted-items folders.
&lt;/p&gt;

&lt;p&gt;
A way to automate this to run a script periodically. I use
&lt;a href=&quot;https://wiki.archlinux.org/title/Systemd/Timers&quot;&gt;systemd-timers&lt;/a&gt;
where I have a script which is periodically run every 15 mins and
notifies me if there&#39;s new email (I&#39;ll cover this later in the blogpost).
&lt;/p&gt;
&lt;h2 id=&quot;sending-mail-via-smtp&quot;&gt;Sending mail via SMTP&lt;/h2&gt;
&lt;p&gt;
Sending email is done via &lt;a href=&quot;https://marlam.de/msmtp/&quot;&gt;&lt;code&gt;msmtp&lt;/code&gt;&lt;/a&gt;. It
is configured by editing &lt;code&gt;~/.msmtprc&lt;/code&gt;&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-5-1&quot;&gt;&lt;a href=&quot;https://ashishpanigrahi.com/blog/o365-offline-email/#fn-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;.
&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;defaults
auth on
tls on
tls_trust_file system
logfile ~/.cache/msmtp.log
timeout 10

# -- First account
account university
tls_starttls on
host smtp.office365.com
port 587
auth xoauth2
user my-username@university.edu
passwordeval &quot;~/.local/bin/mutt_oauth2.py ~/.local/bin/TOKEN&quot;
from my-username@university.edu

# -- Second account
account personal&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
This is fairly self-explanatory. One thing to note is that
&lt;code&gt;tls_starttls&lt;/code&gt; should be on for this to work. I&#39;m not very familiar
with email security protocols like TLS and STARTTLS but from my
understanding, STARTTLS is an automatic upgrade (if supported) from
the more insecure TLS protocol. TLS however needs to be enabled for
any email service, otherwise it won&#39;t work.
&lt;/p&gt;

&lt;p&gt;
Now, we can test our configuration by sending email directly from the
commandline. Save the contents of a file called &lt;code&gt;example-mail&lt;/code&gt; as follows:
&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;From: my-username@university.edu
To: user@example.com
Subject: Hello World

This is a test for msmtp.&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
And send the email by running:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;shell&quot;&gt;cat example-mail | msmtp -t -a university&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;indexing-email-offline-with-notmuch&quot;&gt;Indexing email offline with notmuch&lt;/h2&gt;
&lt;p&gt;
We have receiving and sending email configured. How about reading and
&quot;using&quot; email via an email client. In more technical terms, an email
client is called a &lt;em&gt;mail user agent&lt;/em&gt; (MUA), which is typically seen in
email headers. This includes clients like Thunderbird, Apple mail,
neomutt, etc. We will configure &lt;code&gt;notmuch&lt;/code&gt; which indexes email and
provides an interface for emacs natively with notmuch.el.
&lt;/p&gt;

&lt;p&gt;
Notmuch is entirely tag based. Basic tags exist like &lt;em&gt;unread&lt;/em&gt;,
&lt;em&gt;inbox&lt;/em&gt;, &lt;em&gt;draft&lt;/em&gt;, &lt;em&gt;sent&lt;/em&gt; but you can customize it with more tags to
filter out emails from a particular email address, from a
particular range of date, etc. Tags are heavily used and it&#39;s a
different paradigm of handling email compared to your typical webmail
interface. I won&#39;t go over the details of tagging in notmuch here for
the sake of brevity (to be covered in another blogpost).
&lt;/p&gt;

&lt;p&gt;
When first setting up notmuch, simply run:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;shell&quot;&gt;notmuch setup&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
This will prompt you for basic information like your name, email address,
Maildir directory, etc. Once this is done, notmuch needs to index your
Maildir. Run the following:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;shell&quot;&gt;notmuch new&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
This should be fairly fast, even if your Maildir is big. Notmuch is
quick like that.
&lt;/p&gt;

&lt;p&gt;
Now you can search an email entry via &lt;code&gt;notmuch search&lt;/code&gt;. For example, I
can search emails from a particular sender like so:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;shell&quot;&gt;notmuch search &lt;span class=&quot;org-string&quot;&gt;&#39;from:friend@university.edu&#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
I would again advise you to go through the man pages (&lt;code&gt;man notmuch-search&lt;/code&gt;) for more details.
&lt;/p&gt;
&lt;h3 id=&quot;emacs-setup-for-notmuch&quot;&gt;Emacs setup for notmuch&lt;/h3&gt;
&lt;p&gt;
Simply running &lt;code&gt;M-x notmuch&lt;/code&gt; should give you a hello screen, where you
can then select tags like &lt;em&gt;inbox&lt;/em&gt;, &lt;em&gt;unread&lt;/em&gt; to view their respective
email. I have a fairly customized config for notmuch.el but below I
provide a fairly good starting point for a more minimal notmuch
interface&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-6-1&quot;&gt;&lt;a href=&quot;https://ashishpanigrahi.com/blog/o365-offline-email/#fn-6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;emacs-lisp&quot;&gt;&lt;span class=&quot;org-comment-delimiter&quot;&gt;;; &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;Notmuch for email
&lt;/span&gt;(&lt;span class=&quot;org-keyword&quot;&gt;use-package&lt;/span&gt; notmuch
  &lt;span class=&quot;org-builtin&quot;&gt;:load-path&lt;/span&gt; &lt;span class=&quot;org-string&quot;&gt;&quot;/usr/share/emacs/site-lisp/&quot;&lt;/span&gt;
  &lt;span class=&quot;org-builtin&quot;&gt;:ensure&lt;/span&gt; nil
  &lt;span class=&quot;org-builtin&quot;&gt;:defer&lt;/span&gt; t
  &lt;span class=&quot;org-builtin&quot;&gt;:commands&lt;/span&gt; (notmuch notmuch-mua-new-mail)
  &lt;span class=&quot;org-builtin&quot;&gt;:init&lt;/span&gt;
  &lt;span class=&quot;org-comment-delimiter&quot;&gt;;; &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;Search
&lt;/span&gt;  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-search-oldest-first nil)
  &lt;span class=&quot;org-builtin&quot;&gt;:config&lt;/span&gt;
  &lt;span class=&quot;org-comment-delimiter&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;General UI
&lt;/span&gt;  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-show-logo nil
    notmuch-column-control 1.0
    notmuch-hello-auto-refresh t
    notmuch-hello-recent-searches-max 20
    notmuch-hello-thousands-separator &lt;span class=&quot;org-string&quot;&gt;&quot;&quot;&lt;/span&gt;
    notmuch-hello-sections &#39;(notmuch-hello-insert-saved-searches)
    notmuch-show-all-tags-list t)

  &lt;span class=&quot;org-comment-delimiter&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;Search
&lt;/span&gt;  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-search-result-format
        &#39;((&lt;span class=&quot;org-string&quot;&gt;&quot;date&quot;&lt;/span&gt; . &lt;span class=&quot;org-string&quot;&gt;&quot;%12s  &quot;&lt;/span&gt;)
          (&lt;span class=&quot;org-string&quot;&gt;&quot;count&quot;&lt;/span&gt; . &lt;span class=&quot;org-string&quot;&gt;&quot;%-7s  &quot;&lt;/span&gt;)
          (&lt;span class=&quot;org-string&quot;&gt;&quot;authors&quot;&lt;/span&gt; . &lt;span class=&quot;org-string&quot;&gt;&quot;%-20s  &quot;&lt;/span&gt;)
          (&lt;span class=&quot;org-string&quot;&gt;&quot;subject&quot;&lt;/span&gt; . &lt;span class=&quot;org-string&quot;&gt;&quot;%-80s  &quot;&lt;/span&gt;)
          (&lt;span class=&quot;org-string&quot;&gt;&quot;tags&quot;&lt;/span&gt; . &lt;span class=&quot;org-string&quot;&gt;&quot;(%s)&quot;&lt;/span&gt;)))
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-tree-result-format
        &#39;((&lt;span class=&quot;org-string&quot;&gt;&quot;date&quot;&lt;/span&gt; . &lt;span class=&quot;org-string&quot;&gt;&quot;%12s  &quot;&lt;/span&gt;)
          (&lt;span class=&quot;org-string&quot;&gt;&quot;authors&quot;&lt;/span&gt; . &lt;span class=&quot;org-string&quot;&gt;&quot;%-20s  &quot;&lt;/span&gt;)
          (((&lt;span class=&quot;org-string&quot;&gt;&quot;tree&quot;&lt;/span&gt; . &lt;span class=&quot;org-string&quot;&gt;&quot;%s&quot;&lt;/span&gt;)
            (&lt;span class=&quot;org-string&quot;&gt;&quot;subject&quot;&lt;/span&gt; . &lt;span class=&quot;org-string&quot;&gt;&quot;%s&quot;&lt;/span&gt;))
           . &lt;span class=&quot;org-string&quot;&gt;&quot; %-80s  &quot;&lt;/span&gt;)
          (&lt;span class=&quot;org-string&quot;&gt;&quot;tags&quot;&lt;/span&gt; . &lt;span class=&quot;org-string&quot;&gt;&quot;(%s)&quot;&lt;/span&gt;)))
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-show-empty-saved-searches t)

  &lt;span class=&quot;org-comment-delimiter&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;Tags
&lt;/span&gt;  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-archive-tags nil &lt;span class=&quot;org-comment-delimiter&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;I don&#39;t archive email
&lt;/span&gt;    notmuch-message-replied-tags &#39;(&lt;span class=&quot;org-string&quot;&gt;&quot;+replied&quot;&lt;/span&gt;)
    notmuch-message-forwarded-tags &#39;(&lt;span class=&quot;org-string&quot;&gt;&quot;+forwarded&quot;&lt;/span&gt;)
    notmuch-show-mark-read-tags &#39;(&lt;span class=&quot;org-string&quot;&gt;&quot;-unread&quot;&lt;/span&gt;)
    notmuch-draft-tags &#39;(&lt;span class=&quot;org-string&quot;&gt;&quot;+draft&quot;&lt;/span&gt;)
    notmuch-draft-folder &lt;span class=&quot;org-string&quot;&gt;&quot;university/Drafts&quot;&lt;/span&gt;
    notmuch-draft-save-plaintext &#39;ask)

  &lt;span class=&quot;org-comment-delimiter&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;Email composition
&lt;/span&gt;  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-mua-compose-in &#39;new-window)
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-mua-hidden-headers nil)
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-address-command &#39;internal)
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-address-use-company nil)
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-always-prompt-for-sender t)
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-mua-cite-function
    &#39;message-cite-original-without-signature)
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-mua-user-agent-function nil)

  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-show-relative-dates t)
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-show-all-multipart/alternative-parts nil)
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-show-indent-messages-width 0)
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-show-indent-multipart nil)
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-show-part-button-default-action &#39;notmuch-show-view-part)
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-wash-wrap-lines-length 120)
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-unthreaded-show-out nil)
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-message-headers &#39;(&lt;span class=&quot;org-string&quot;&gt;&quot;To&quot;&lt;/span&gt; &lt;span class=&quot;org-string&quot;&gt;&quot;Cc&quot;&lt;/span&gt; &lt;span class=&quot;org-string&quot;&gt;&quot;Subject&quot;&lt;/span&gt; &lt;span class=&quot;org-string&quot;&gt;&quot;Date&quot;&lt;/span&gt;))
  (&lt;span class=&quot;org-keyword&quot;&gt;setq&lt;/span&gt; notmuch-message-headers-visible t)

  &lt;span class=&quot;org-builtin&quot;&gt;:bind&lt;/span&gt;
  ( &lt;span class=&quot;org-builtin&quot;&gt;:map&lt;/span&gt; global-map
    (&lt;span class=&quot;org-string&quot;&gt;&quot;C-c m m&quot;&lt;/span&gt; . notmuch)
    (&lt;span class=&quot;org-string&quot;&gt;&quot;C-x m&quot;&lt;/span&gt; . notmuch-mua-new-mail) &lt;span class=&quot;org-comment-delimiter&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;override `&lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;&lt;span class=&quot;org-constant&quot;&gt;compose-mail&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;&#39;
&lt;/span&gt;    &lt;span class=&quot;org-builtin&quot;&gt;:map&lt;/span&gt; notmuch-search-mode-map
    (&lt;span class=&quot;org-string&quot;&gt;&quot;/&quot;&lt;/span&gt; . notmuch-search-filter) &lt;span class=&quot;org-comment-delimiter&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;alias for l
&lt;/span&gt;    (&lt;span class=&quot;org-string&quot;&gt;&quot;r&quot;&lt;/span&gt; . notmuch-search-reply-to-thread) &lt;span class=&quot;org-comment-delimiter&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;easier to reply to all by default
&lt;/span&gt;    (&lt;span class=&quot;org-string&quot;&gt;&quot;R&quot;&lt;/span&gt; . notmuch-search-reply-to-thread-sender)
    &lt;span class=&quot;org-builtin&quot;&gt;:map&lt;/span&gt; notmuch-show-mode-map
    (&lt;span class=&quot;org-string&quot;&gt;&quot;r&quot;&lt;/span&gt; . notmuch-show-reply) &lt;span class=&quot;org-comment-delimiter&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;easier to reply to all by default
&lt;/span&gt;    (&lt;span class=&quot;org-string&quot;&gt;&quot;R&quot;&lt;/span&gt; . notmuch-show-reply-sender)
    &lt;span class=&quot;org-builtin&quot;&gt;:map&lt;/span&gt; notmuch-hello-mode-map
    (&lt;span class=&quot;org-string&quot;&gt;&quot;J&quot;&lt;/span&gt; . notmuch-jump-search)))&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
You&#39;re free to look at my
&lt;a href=&quot;https://github.com/paniash/dotemacs/blob/413f60cd2b152a581a6a8d5cb952b6fae318a5ba/init.el#L861&quot;&gt;&lt;code&gt;init.el&lt;/code&gt;&lt;/a&gt;
for my own customization for notmuch.el.
&lt;/p&gt;
&lt;h2 id=&quot;automating-email-synchronization-with-systemd-timers&quot;&gt;Automating email synchronization with systemd timers&lt;/h2&gt;
&lt;p&gt;
Let&#39;s automate the email sync to happen every 15 mins (or whatever
frequency you prefer). First we create a shell-script to download
email via &lt;code&gt;mbsync&lt;/code&gt; and also index the email with &lt;code&gt;notmuch&lt;/code&gt;. Let&#39;s name it
it &lt;code&gt;syncmail.sh&lt;/code&gt; and place it in &lt;code&gt;$HOME/.local/bin/&lt;/code&gt;.
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;org-comment-delimiter&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;!/bin/&lt;/span&gt;&lt;span class=&quot;org-keyword&quot;&gt;sh&lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;org-builtin&quot;&gt;set&lt;/span&gt; -eu

&lt;span class=&quot;org-comment-delimiter&quot;&gt;# &lt;/span&gt;&lt;span class=&quot;org-comment&quot;&gt;Set environment variable for notmuch config file
&lt;/span&gt;&lt;span class=&quot;org-builtin&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;org-variable-name&quot;&gt;NOTMUCH_CONFIG&lt;/span&gt;=&lt;span class=&quot;org-string&quot;&gt;&quot;$HOME/.config/notmuch/notmuch-config&quot;&lt;/span&gt;

mbsync university

&lt;span class=&quot;org-variable-name&quot;&gt;before&lt;/span&gt;=$(notmuch count --lastmod &lt;span class=&quot;org-string&quot;&gt;&#39;*&#39;&lt;/span&gt; | cut -f3)
notmuch new &amp;gt; /dev/null

&lt;span class=&quot;org-variable-name&quot;&gt;query&lt;/span&gt;=&lt;span class=&quot;org-string&quot;&gt;&quot;lastmod:$((before + 1)).. and path:university/**&quot;&lt;/span&gt;
&lt;span class=&quot;org-variable-name&quot;&gt;count&lt;/span&gt;=$(notmuch count &lt;span class=&quot;org-string&quot;&gt;&quot;$query&quot;&lt;/span&gt;)

&lt;span class=&quot;org-keyword&quot;&gt;if&lt;/span&gt; [ &lt;span class=&quot;org-string&quot;&gt;&quot;$count&quot;&lt;/span&gt; -gt 0 ]; &lt;span class=&quot;org-keyword&quot;&gt;then&lt;/span&gt;
    &lt;span class=&quot;org-variable-name&quot;&gt;body&lt;/span&gt;=$(notmuch search --format=json --limit=5 &lt;span class=&quot;org-string&quot;&gt;&quot;$query&quot;&lt;/span&gt; &lt;span class=&quot;org-sh-escaped-newline&quot;&gt;\&lt;/span&gt;
           | jq -r &lt;span class=&quot;org-string&quot;&gt;&#39;.[] | &quot;\(.authors): \(.subject)&quot;&#39;&lt;/span&gt;)
    notify-send &lt;span class=&quot;org-string&quot;&gt;&quot;New mail: $count&quot;&lt;/span&gt; &lt;span class=&quot;org-string&quot;&gt;&quot;$body&quot;&lt;/span&gt;
&lt;span class=&quot;org-keyword&quot;&gt;fi&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
In addition to downloading email and indexing, the script also
notifies through &lt;code&gt;notify-send&lt;/code&gt; if there&#39;s new email along with a
sender and subject in the notification. Make sure to make the script
executable with
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;shell&quot;&gt;chmod +x ./syncmail.sh&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
Then we write the systemd script to run this script periodically.
First we create a &lt;code&gt;syncmail.service&lt;/code&gt; file in &lt;code&gt;$HOME/.config/systemd/user/&lt;/code&gt;:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;conf&quot;&gt;[&lt;span class=&quot;org-type&quot;&gt;Unit&lt;/span&gt;]
&lt;span class=&quot;org-variable-name&quot;&gt;Description&lt;/span&gt;=Sync mail with mbsync and index with notmuch

[&lt;span class=&quot;org-type&quot;&gt;Service&lt;/span&gt;]
&lt;span class=&quot;org-variable-name&quot;&gt;Type&lt;/span&gt;=oneshot
&lt;span class=&quot;org-variable-name&quot;&gt;ExecStart&lt;/span&gt;=%h/.local/bin/syncmail.sh&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
Then we create a timer file (make sure it is named &lt;code&gt;syncmail.timer&lt;/code&gt;) for actually running the script every &lt;code&gt;n&lt;/code&gt; minutes.
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;conf&quot;&gt;[&lt;span class=&quot;org-type&quot;&gt;Unit&lt;/span&gt;]
&lt;span class=&quot;org-variable-name&quot;&gt;Description&lt;/span&gt;=Run syncmail every 15 minutes

[&lt;span class=&quot;org-type&quot;&gt;Timer&lt;/span&gt;]
&lt;span class=&quot;org-variable-name&quot;&gt;OnBootSec&lt;/span&gt;=2m
&lt;span class=&quot;org-variable-name&quot;&gt;OnUnitActiveSec&lt;/span&gt;=15m
&lt;span class=&quot;org-variable-name&quot;&gt;Persistent&lt;/span&gt;=true

[&lt;span class=&quot;org-type&quot;&gt;Install&lt;/span&gt;]
&lt;span class=&quot;org-variable-name&quot;&gt;WantedBy&lt;/span&gt;=timers.target&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
The advantage over cronjobs is that if your system is asleep or
shutdown, then booting up accomodates accordingly and runs the script
after &lt;code&gt;m&lt;/code&gt; minutes (2 minutes in my case).
&lt;/p&gt;

&lt;p&gt;
Finally we enable the script with &lt;code&gt;systemctl&lt;/code&gt;:
&lt;/p&gt;

&lt;pre&gt;&lt;code data-lang=&quot;shell&quot;&gt;systemctl --user daemon-reload
systemctl --user enable --now syncmail.timer&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&quot;concluding-remarks&quot;&gt;Concluding remarks&lt;/h2&gt;
&lt;p&gt;
Now you should have a working setup for using offline email for
Microsoft&#39;s O365. This is fairly minimal but if you&#39;d like to have
encrypted emails, addressbooks, etc., please take a look at the
original &lt;a href=&quot;https://www.cosroe.com/2025/04/neomutt-notmuch-mbsync.html&quot;&gt;blogpost from
Fergus&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
A basic emailing etiquette I like to follow is to use plaintext as
opposed to html. &lt;a href=&quot;https://useplaintext.email/&quot;&gt;Read more&lt;/a&gt; on why this is better.
&lt;/p&gt;

&lt;div class=&quot;meta&quot;&gt;
Special thanks to &lt;a href=&quot;https://marci.gunyho.com&quot;&gt;Marci&lt;/a&gt; for
pointing out grammatical errors and typos.
&lt;/div&gt;
&lt;section class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-1&quot;&gt;
&lt;p&gt;
It&#39;s like the old adage from Vi advocates, &quot;Emacs is a great
operating system, lacking only a decent text editor&quot;. Although the latter part I would disagree with.
 &lt;a href=&quot;https://ashishpanigrahi.com/blog/o365-offline-email/#fr-1-1&quot; aria-label=&quot;Back to reference 1&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn-2&quot;&gt;
&lt;p&gt;
I just found out that Mozilla has made it very convoluted to
find the source code and build Thunderbird locally. It uses
mercurial instead of Git (in this day and age?). Relevant docs are &lt;a href=&quot;https://developer.thunderbird.net/thunderbird-development/building-thunderbird/linux-build-prerequisites&quot;&gt;here&lt;/a&gt;.
 &lt;a href=&quot;https://ashishpanigrahi.com/blog/o365-offline-email/#fr-2-1&quot; aria-label=&quot;Back to reference 2&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn-3&quot;&gt;
&lt;p&gt;
Even after asking countless times, they&#39;ve rejected my request
to include notmuch/emacs into the allowed clients list. Ah well, here
we are.
 &lt;a href=&quot;https://ashishpanigrahi.com/blog/o365-offline-email/#fr-3-1&quot; aria-label=&quot;Back to reference 3&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn-4&quot;&gt;
&lt;p&gt;
Personally, I dislike that my &lt;code&gt;$HOME&lt;/code&gt; directory gets cluttered
with config files that don&#39;t respect the &lt;a href=&quot;https://wiki.archlinux.org/title/XDG_Base_Directory&quot;&gt;XDG
specifications&lt;/a&gt;.
I set it to &lt;code&gt;$HOME/.config/mbsync/mbsyncrc&lt;/code&gt; by exporting the variable &lt;code&gt;MBSYNCRC&lt;/code&gt;.
 &lt;a href=&quot;https://ashishpanigrahi.com/blog/o365-offline-email/#fr-4-1&quot; aria-label=&quot;Back to reference 4&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn-5&quot;&gt;
&lt;p&gt;
Same issue with this. I fix it to be at &lt;code&gt;$HOME/.config/msmtp/config&lt;/code&gt;.
 &lt;a href=&quot;https://ashishpanigrahi.com/blog/o365-offline-email/#fr-5-1&quot; aria-label=&quot;Back to reference 5&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn-6&quot;&gt;
&lt;p&gt;
The default interface is too noisy for me, so I disable a lot of the bells and whistles.
 &lt;a href=&quot;https://ashishpanigrahi.com/blog/o365-offline-email/#fr-6-1&quot; aria-label=&quot;Back to reference 6&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry xml:lang="en">
    <title>Switching to GNU Emacs</title>
    <published>2024-04-14T00:00:00+00:00</published>
    <updated>2024-04-14T00:00:00+00:00</updated>
    <author><name>Ashish Panigrahi</name></author>
    <link rel="alternate" type="text/html" href="https://ashishpanigrahi.com/blog/switching-to-emacs/"/>
    <id>https://ashishpanigrahi.com/blog/switching-to-emacs/</id>
    <content type="html" xml:base="https://ashishpanigrahi.com/blog/switching-to-emacs/">&lt;p&gt;
Over the past five years, I&#39;ve been using &lt;a href=&quot;https://www.vim.org&quot;&gt;Vim&lt;/a&gt;
(well &lt;a href=&quot;https://neovim.io&quot;&gt;NeoVim&lt;/a&gt; specifically) for all of my text
editing needs ranging from tinkering with config files, shell scripts,
to writing this website, making LaTeX reports and theses, etc. The
paradigm of modal text editing that is Vim, just feels right. The user
communicates exactly how text needs to be edited. For instance: delete
all characters until a specific character appears? Done. Only delete
lines in the file that cover certain patterns? Built-in regex has you
covered! The point is, once you understand how modal editing works,
any other form of text editing feels like it&#39;s from the stone ages.
&lt;/p&gt;

&lt;p&gt;
Now you might ask, why am I switching to &lt;a href=&quot;https://www.gnu.org/software/emacs/&quot;&gt;GNU
Emacs&lt;/a&gt;, the opposing contender to
Vim in the well known &lt;a href=&quot;https://en.wikipedia.org/wiki/Editor_war&quot;&gt;editor
war&lt;/a&gt;? Well, the more &quot;silly&quot;
reason is that it gives me an opportunity to learn a new piece of
software, understand it&#39;s inner workings, etc. The more pragmatic
reason is that, like any rivalry, both sides have their pros and cons.
GNU Emacs presents itself as a truly hackable editor in any way the
user desires. This is thanks to the editor being written and
configured in &lt;a href=&quot;https://en.wikipedia.org/wiki/Emacs_Lisp&quot;&gt;Emacs lisp&lt;/a&gt;,
a dialect of the Lisp family of languages. Vim on the other hand is
written mostly in C but is configured in an obscure language that is
Vimscript. The advantage with Emacs lisp is that one can write not
only specific functions to help in any form of text editing and beyond
(one of the charms of Emacs) but also supplements more experienced
users in contributing to the core development of Emacs. This appeals
to me from a FOSS perspective as I truly believe that free software
development being run by volunteers should be tightly knit with its
user community. This helps not only in raising issues with the
software better but also in users contributing to the
development.
&lt;/p&gt;

&lt;p&gt;
This truly hackable experience, presented by Emacs also benefits in
the form of tasks that are not necessarily based around text-editing.
Thanks to the wonderful community, Emacs boasts a wide-range of
well-written packages such as &lt;a href=&quot;https://orgmode.org&quot;&gt;org-mode&lt;/a&gt; (Task
management system with a markup style of its own) and
&lt;a href=&quot;https://magit.vc/&quot;&gt;Magit&lt;/a&gt; (A Git porcelain inside Emacs). One of the
primary reasons I&#39;ve decided to switch is due to org-mode (which I
intend to cover in detail in subsequent blog entries).
&lt;/p&gt;

&lt;p&gt;
Some people might argue that Emacs goes against the UNIX philosophy of
minimalism and &quot;doing one thing right&quot;. Technically Emacs is
more of a Lisp environment than a text editor, or like the more famous
vim adage: &quot;Emacs is a great operating system, but it lacks a good
text editor&quot;. I cannot really comment here because I&#39;m still very new
to Emacs but the quote does hold some truth. Emacs (atleast from my
first impressions) has esoteric keybindings which are completely
foreign to new users let alone someone coming from a vim background.
&lt;code&gt;Ctrl&lt;/code&gt; and &lt;code&gt;Alt&lt;/code&gt; (known as &lt;code&gt;Meta&lt;/code&gt; in Emacs parlance) are the most
common keys which form part of the key-chord style of using emacs.
These keys obviously are placed at positions on a standard QWERTY
keyboard layout that when used frequently leads to the more infamous
&lt;a href=&quot;https://stackoverflow.com/questions/52492/what-is-the-best-way-to-avoid-getting-emacs-pinky&quot;&gt;Emacs
pinky&lt;/a&gt;
which is basically &lt;a href=&quot;https://en.wikipedia.org/wiki/Repetitive_strain_injury&quot;&gt;repetitive strain injury
(RSI)&lt;/a&gt;. For
this reason, I will be using emacs with
&lt;a href=&quot;https://github.com/emacs-evil/evil&quot;&gt;Evil&lt;/a&gt; which is the Vi-emulation
package in emacs, atleast until I get the hang of working with Emacs
before perhaps trying the stock keybindings (which apparently most of
the emacs community adheres to).
&lt;/p&gt;

&lt;center&gt;
&lt;img src=&quot;/images/real_programmers.png&quot;&gt;
&lt;figcaption&gt;Relevant xkcd&lt;/figcaption&gt;
&lt;/center&gt;

&lt;p&gt;
For the next couple weeks I will try to steadily convert to using
Emacs and hopefully perform all of my computing needs with emacs in
the not-so-long future. This blog post is mainly for me to make this
commitment. As a first step, this blog entry is written entirely in Emacs.
&lt;/p&gt;
</content>
  </entry>
</feed>
