1 [[!meta title="Using Mutt with Org Mode (with refile)"]]
3 I use [org mode](http://orgmode.org/) extensively, and had added
4 [Zack's](http://upsilon.cc/~zack/) workflow for
5 [integrating mutt with org mode](http://upsilon.cc/~zack/blog/posts/2010/02/integrating_Mutt_with_Org-mode/)
7 [~/.emacs](http://git.donarmstrong.com/?p=emacs.git;a=blob;f=.emacs;hb=HEAD)
10 However, I've been annoyed that refiling closes the org-capture frame
11 before refiling finishes. The following
12 [trivial modification](http://git.donarmstrong.com/?p=emacs.git;a=commitdiff;h=HEAD)
13 to Zack's code (which I previously modified to work with org-mode >=
14 0.8) waits to close the frame until you've finished refiling.
17 (require 'org-protocol)
18 (add-hook 'org-capture-mode-hook 'delete-other-windows)
19 (setq my-org-protocol-flag nil)
20 (defadvice org-capture-finalize (after delete-frame-at-end activate)
21 "Delete frame at remember finalization"
22 (progn (if my-org-protocol-flag (delete-frame))
23 (setq my-org-protocol-flag nil)))
24 (defadvice org-capture-refile (around delete-frame-after-refile activate)
25 "Delete frame at remember refile"
26 (if my-org-protocol-flag
28 (setq my-org-protocol-flag nil)
33 (defadvice org-capture-kill (after delete-frame-at-end activate)
34 "Delete frame at remember abort"
35 (progn (if my-org-protocol-flag (delete-frame))
36 (setq my-org-protocol-flag nil)))
37 (defadvice org-protocol-capture (before set-org-protocol-flag activate)
38 (setq my-org-protocol-flag t))
41 Now, the frame automatically disappears after you refile it, keeping
44 [[!tag emacs debian org-mode tech mutt]]