Updated scripts to use capture instead of remember master
authorBenjamin Mako Hill <mako@atdot.cc>
Tue, 8 Oct 2013 18:48:33 +0000 (11:48 -0700)
committerBenjamin Mako Hill <mako@atdot.cc>
Tue, 8 Oct 2013 18:48:33 +0000 (11:48 -0700)
As of org-mode version 8, remember has been completely replained with
capture. The old code, designed to work with capture, no longer works
with org-mode. This requires a minro change to the remember script and a
small change to the emacs configuration.

This patch is based on the default capture template configuration. As a
result, the behavior from this patch is very similar, but  not
identical. The new capture templates can be tweaked.

emacs-conf.sample
remember-mail

index f1415dd19b412de45f72f8a694a627529b4a6764..e07df5ecdf3808dade95d20d50f1fbdfd13b17df 100644 (file)
@@ -1,23 +1,32 @@
 ;; standard org <-> remember stuff, RTFM
-(org-remember-insinuate)
+(require 'org-capture)
+
 (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)))
 
+(setq org-capture-templates
+      (quote
+       (("m"
+         "Mail"
+         entry
+         (file+headline "~/org/gtd.org" "Incoming")
+         "* TODO %^{Title}\n\n  Source: %u, %c\n\n  %i"
+         :empty-lines 1)
+        ;; ... more templates here ...
+        )))
 ;; 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)
+(add-hook 'org-capture-mode-hook 'delete-other-windows)
 (setq my-org-protocol-flag nil)
-(defadvice org-remember-finalize (after delete-frame-at-end activate)
+(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-remember-kill (after delete-frame-at-end activate)
+         (setq my-org-protocol-flag nil)))
+(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-remember (before set-org-protocol-flag activate)
+         (setq my-org-protocol-flag nil)))
+(defadvice org-protocol-capture (before set-org-protocol-flag activate)
   (setq my-org-protocol-flag t))
 
 (defun open-mail-in-mutt (message)
index 9e13e75ea88d0c8a599458ccb70f1b9f076db249..86a32ef73acd775425cfeba3b8a1b9efc456653c 100755 (executable)
@@ -20,4 +20,4 @@ my $from = $msg->head->get('from') || "";
 chomp ($subject, $from);
 my $note_body = uri_escape("  Subject: $subject\n    From: $from");
 
-exec "emacsclient", "-t", "org-protocol:/remember:/m/mutt:$mid/mail/$note_body";
+exec "emacsclient", "-t", "org-protocol:/capture:/m/mutt:$mid/mail/$note_body";

Benjamin Mako Hill || Want to submit a patch?