emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alexander Adolf <alexander.adolf@condition-alpha.com>
To: Tim Visher <tim.visher@gmail.com>,
	Emacs Org Mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: How to use `open` to handle `message:*` links on macOS
Date: Fri, 15 Jan 2021 15:12:34 +0100	[thread overview]
Message-ID: <2acd022ab06f7f7e2fbe74a6b42d816a@condition-alpha.com> (raw)
In-Reply-To: <CAHa53uyQNLqSRngPLCpfvJbPKi+=5=3uRUO_qhsQtxF3EaV1Kw@mail.gmail.com>

Hello Tim,

Tim Visher <tim.visher@gmail.com> writes:

> [...]
> I'd like to be able to whack `C-c C-o` on `message:*` links on macOS and
> have it call `open` on the contents. Is there a way to make that happen?
> My intent is to be able to save a deep link to a Mail.app message in an org
> document.
> [...]

In my setup, I'm using this:
---------------------------- Begin Quote -----------------------------
(org-add-link-type "mac-mail" 'org-mac-mail-link-open)

(defun org-mac-mail-link-open (mid)
  "Visit the email message with message id MID."
  (start-process "open-mail" nil "open" (format "message:%%3C%s%%3E" mid)))
----------------------------- End Quote ------------------------------

It gives me a new link type "mac-mail" for org-insert-link. Copy the
message ID (without the angle brackets) from Mail.app, and insert it as
the link location. This is a manual process, of course, but then I'm not
using it often, and I don't need it for anything else but Mail.app.

org-mac-link as suggested by Diego offers much more convenience by
automating the entire process, and by giving you access to many other
apps, too. So you might prefer that if you are going to use it often.

Hoping to have helped,


  parent reply	other threads:[~2021-01-15 14:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 19:44 How to use `open` to handle `message:*` links on macOS Tim Visher
2021-01-11 21:57 ` Diego Zamboni
2021-01-15 14:12 ` Alexander Adolf [this message]
2021-04-29 16:21   ` Tim Visher
2021-04-29 16:28     ` Diego Zamboni
2021-04-29 19:37     ` Tim Cross
2021-04-29 21:01       ` Tim Visher
2021-04-29 23:38     ` Alexander Adolf
2021-05-02 20:58       ` Tim Visher
2021-05-06 17:04         ` Alexander Adolf
2021-05-06 17:38           ` Tim Visher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2acd022ab06f7f7e2fbe74a6b42d816a@condition-alpha.com \
    --to=alexander.adolf@condition-alpha.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tim.visher@gmail.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).