From 0ee315fc57cf84a33c5fd6b2e19e8a915c733b59 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Wed, 16 Oct 2013 18:11:59 -0700 Subject: [PATCH] add org mode mutt capture post --- posts/org_mode_mutt_capture.mdwn | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 posts/org_mode_mutt_capture.mdwn diff --git a/posts/org_mode_mutt_capture.mdwn b/posts/org_mode_mutt_capture.mdwn new file mode 100644 index 0000000..92975c7 --- /dev/null +++ b/posts/org_mode_mutt_capture.mdwn @@ -0,0 +1,42 @@ +[[!meta title="Using Mutt with Org Mode (with refile)"]] + +I use [org mode](http://orgmode.org/) extensively, and had added +[Zack's](http://upsilon.cc/~zack/) workflow for +[integrating mutt with org mode](http://upsilon.cc/~zack/blog/posts/2010/02/integrating_Mutt_with_Org-mode/) +to my +[~/.emacs](http://git.donarmstrong.com/?p=emacs.git;a=blob;f=.emacs;hb=HEAD) +some time ago. + +However, I've been annoyed that refiling closes the org-capture frame +before refiling finishes. The following +[trivial modification](http://git.donarmstrong.com/?p=emacs.git;a=commitdiff;h=HEAD) +to Zack's code (which I previously modified to work with org-mode >= +0.8) waits to close the frame until you've finished refiling. + + (require 'org-protocol) + (add-hook 'org-capture-mode-hook 'delete-other-windows) + (setq my-org-protocol-flag nil) + (defadvice org-capture-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-capture-refile (around delete-frame-after-refile activate) + "Delete frame at remember refile" + (if my-org-protocol-flag + (progn + (setq my-org-protocol-flag nil) + ad-do-it + (delete-frame)) + ad-do-it) + ) + (defadvice org-capture-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-capture (before set-org-protocol-flag activate) + (setq my-org-protocol-flag t)) + +Now, the frame automatically disappears after you refile it, keeping +my refile.org clean. + +[[!tag emacs debian org-mode tech mutt]] -- 2.39.2