Next: , Previous: , Up: Other tools   [Contents]

B.2 Org-mode links

It can be useful to include links to e-mail messages or search queries in your org-mode files. mu4e supports this by default, unless you set mu4e-support-org to nil.

You can use the normal org-mode mechanisms to store links: M-x org-store-link stores a link to a particular message when you are in Message view. When you are in Headers view, M-x org-store-link links to the query if mu4e-org-link-query-in-headers-mode is non-nil, and to the particular message otherwise (which is the default).

You can insert this link later with M-x org-insert-link. From org-mode, you can go to the query or message the link points to with either M-x org-agenda-open-link in agenda buffers, or M-x org-open-at-point elsewhere — both typically bound to C-c C-o.

You can also directly capture such links — for example, to add e-mail messages to your todo-list. For that, mu4e-org has a function mu4e-org-store-and-capture. This captures the message-at-point (or header — see the discussion on mu4e-org-link-query-in-headers-mode above), then calls org-mode’s capture functionality.

You can add some specific capture-template for this. In your capture templates, the following mu4e-specific values are available:

item                                                 | description
%:date, %:date-timestamp, %d:date-timestamp-inactive | date, org timestamps
%:from, %:fromname, %:fromaddress                    | sender, name/address
%:to, %:toname, %:toaddress                          | recipient, name/address
%:maildir                                            | maildir for the message
%:message-id                                         | message-id
%:path                                               | file system path
%:subject                                            | message subject

For example, to add a message to your todo-list, and set a deadline for processing it within two days, you could add this to org-capture-templates:

  ("P" "process-soon" entry (file+headline "" "Todo")
  "* TODO %:fromname: %a %?\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\"))")

If you use the functionality a lot, you may want to define key-bindings for that in headers and view mode:

  (define-key mu4e-headers-mode-map (kbd "C-c c") 'mu4e-org-store-and-capture)
  (define-key mu4e-view-mode-map    (kbd "C-c c") 'mu4e-org-store-and-capture)

Next: , Previous: , Up: Other tools   [Contents]