Updated scripts to use capture instead of remember
[org-mutt] / emacs-conf.sample
1 ;; standard org <-> remember stuff, RTFM
2 (require 'org-capture)
3
4 (setq org-default-notes-file "~/org/gtd.org")
5
6 (setq org-capture-templates
7       (quote
8        (("m"
9          "Mail"
10          entry
11          (file+headline "~/org/gtd.org" "Incoming")
12          "* TODO %^{Title}\n\n  Source: %u, %c\n\n  %i"
13          :empty-lines 1)
14         ;; ... more templates here ...
15         )))
16 ;; ensure that emacsclient will show just the note to be edited when invoked
17 ;; from Mutt, and that it will shut down emacsclient once finished;
18 ;; fallback to legacy behavior when not invoked via org-protocol.
19 (add-hook 'org-capture-mode-hook 'delete-other-windows)
20 (setq my-org-protocol-flag nil)
21 (defadvice org-capture-finalize (after delete-frame-at-end activate)
22   "Delete frame at remember finalization"
23   (progn (if my-org-protocol-flag (delete-frame))
24          (setq my-org-protocol-flag nil)))
25 (defadvice org-capture-kill (after delete-frame-at-end activate)
26   "Delete frame at remember abort"
27   (progn (if my-org-protocol-flag (delete-frame))
28          (setq my-org-protocol-flag nil)))
29 (defadvice org-protocol-capture (before set-org-protocol-flag activate)
30   (setq my-org-protocol-flag t))
31
32 (defun open-mail-in-mutt (message)
33   "Open a mail message in Mutt, using an external terminal.
34
35 Message can be specified either by a path pointing inside a
36 Maildir, or by Message-ID."
37   (interactive "MPath or Message-ID: ")
38   (shell-command
39    (format "gnome-terminal -e \"%s %s\""
40            (substitute-in-file-name "$HOME/bin/mutt-open") message)))
41
42 ;; add support for "mutt:ID" links
43 (org-add-link-type "mutt" 'open-mail-in-mutt)

Benjamin Mako Hill || Want to submit a patch?