Notmuch
Posts related to the Notmuch email system.
Email actions in Emacs (notmuch)
A few years ago I wrote microdata.el, an Emacs package for extracting and acting on microdata in email. Since then, I’ve been using it daily to open Discourse and GitHub PR/issue notifications from notmuch with a single keypress (C-c C-c
) instead of having to find and click on the appropriate link.
Many automated emails include structured metadata using either JSON-LD and/or Microdata. Adoption isn’t great, but code forges like GitLab and GitHub use this to include metadata in their notifications indicating how to view the associated issue/PR/etc. in the browser.
This package provides commands for reading and acting on this metadata.
Configuration
You can install the package with the built-in use-package-vc
(or straight, or Elpaca, etc.). I’ve never bothered to publish the package to MELPA so you’ll need to directly fetch it via git.
(use-package microdata
:vc (:url "https://github.com/Stebalien/microdata.el"))
I distribute a notmuch integration library along with the package. However, there’s no reason it wouldn’t work with mu4e or Gnus (but you’ll have to write that integration yourself).
For notmuch, you can set it up like this (assuming you already have the microdata
package itself):
(use-package notmuch-microdata
:bind
(:map notmuch-show-mode-map
"C-c C-c" 'notmuch-microdata-show-action-view
:map notmuch-search-mode-map
"C-c C-c" 'notmuch-microdata-search-action-view))
With this configuration, pressing C-c C-c
in the notmuch search view or when viewing an email will open the default action URL (typically the issue, PR, or forum thread) in your browser.
Matching GMail
Unfortunately, this package will never be able to compete with GMail’s built-in actions feature. Given recent advances in language models, applications like GMail simply read the email itself so there’s little pressure for senders to standardize on structured metadata in standard formats.