Skip to content

Instantly share code, notes, and snippets.

@bdarcus
Forked from ephsmith/org-airmail.el
Last active September 2, 2021 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdarcus/2e90fa7381e0c00accfc0ef3cfaf86a9 to your computer and use it in GitHub Desktop.
Save bdarcus/2e90fa7381e0c00accfc0ef3cfaf86a9 to your computer and use it in GitHub Desktop.
org-airmail.el adds an org-hyperlink handler for Airmail email URLs
;;; org-airmail.el - Support for links to Airmail 3 messages in Org
(require 'org)
(org-link-set-parameters "airmail" :follow 'org-airmail-open)
(defun org-airmail-open (url)
"Visit the Airmail message referenced by URL.
URL should be a vaid Airmail message url retrieved from Airmail with
'Copy Message Link'."
(shell-command
;; Note: org strips "airmail:" from the link URL
(concat "open -a '/Applications/Airmail 3.app' airmail:"
(shell-quote-argument url))))
(provide 'org-airmail)
;;; org-airmail.el ends here

Description

If you’re an Airmail 3 user, this provides the ability to link to an Airmail email within an org document. This Gist uses the orgmode mechanism for adding additional hyperlink types.

Installation

Save the file to your Emacs load-path and add (require 'org-airmail) to your Emacs init file.

Usage

  1. Copy and Airmail message link in Airmail (Edit-> Copy Message Link).
  2. Insert the link into an orgmode file just as you would any other (C-c C-l ...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment