check-in sample Mutt and Emacs conffiles
authorStefano Zacchiroli <zack@upsilon.cc>
Sun, 17 Feb 2013 17:02:34 +0000 (18:02 +0100)
committerStefano Zacchiroli <zack@upsilon.cc>
Sun, 17 Feb 2013 17:02:34 +0000 (18:02 +0100)
emacs-conf.sample [new file with mode: 0644]
mutt-conf.sample [new file with mode: 0644]

diff --git a/emacs-conf.sample b/emacs-conf.sample
new file mode 100644 (file)
index 0000000..f1415dd
--- /dev/null
@@ -0,0 +1,34 @@
+;; standard org <-> remember stuff, RTFM
+(org-remember-insinuate)
+(setq org-default-notes-file "~/org/gtd.org")
+(setq org-remember-templates  ;; mail-specific note template, identified by "m"
+      '(("Mail" ?m "* %?\n\n  Source: %u, %c\n %i" nil)))
+
+;; ensure that emacsclient will show just the note to be edited when invoked
+;; from Mutt, and that it will shut down emacsclient once finished;
+;; fallback to legacy behavior when not invoked via org-protocol.
+(add-hook 'org-remember-mode-hook 'delete-other-windows)
+(setq my-org-protocol-flag nil)
+(defadvice org-remember-finalize (after delete-frame-at-end activate)
+  "Delete frame at remember finalization"
+  (progn (if my-org-protocol-flag (delete-frame))
+        (setq my-org-protocol-flag nil)))
+(defadvice org-remember-kill (after delete-frame-at-end activate)
+  "Delete frame at remember abort"
+  (progn (if my-org-protocol-flag (delete-frame))
+        (setq my-org-protocol-flag nil)))
+(defadvice org-protocol-remember (before set-org-protocol-flag activate)
+  (setq my-org-protocol-flag t))
+
+(defun open-mail-in-mutt (message)
+  "Open a mail message in Mutt, using an external terminal.
+
+Message can be specified either by a path pointing inside a
+Maildir, or by Message-ID."
+  (interactive "MPath or Message-ID: ")
+  (shell-command
+   (format "gnome-terminal -e \"%s %s\""
+          (substitute-in-file-name "$HOME/bin/mutt-open") message)))
+
+;; add support for "mutt:ID" links
+(org-add-link-type "mutt" 'open-mail-in-mutt)
diff --git a/mutt-conf.sample b/mutt-conf.sample
new file mode 100644 (file)
index 0000000..4cd5b6f
--- /dev/null
@@ -0,0 +1 @@
+macro index \eR "|~/bin/remember-mail\n"

Benjamin Mako Hill || Want to submit a patch?