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

Benjamin Mako Hill || Want to submit a patch?