make org-capture better
authorJoerg Jaspert <joerg@ganneff.de>
Fri, 17 May 2013 11:11:27 +0000 (13:11 +0200)
committerJoerg Jaspert <joerg@ganneff.de>
Fri, 17 May 2013 11:11:27 +0000 (13:11 +0200)
.conkerorrc/functions.js

index 28c0514..82f25e0 100644 (file)
@@ -20,23 +20,39 @@ interactive("reload-config", "reload conkerorrc",
 define_key(default_global_keymap, "C-c r", "reload-config");
 
 // org-protocol stuff
-function org_capture (url, title, selection, window) {
+function org_capture (mode, url, title, selection, window) {
     var cmd_str =
-        'emacsclient \"org-protocol:/capture:/x/'+url+'/'+title+'/'+selection+'\"';
+        'emacsclient \"org-protocol:/capture:/'+mode+'/'+url+'/'+title+'/'+selection+'\"';
     if (window != null) {
       window.minibuffer.message('Issuing ' + cmd_str);
     }
     shell_command_blind(cmd_str);
 }
 
+interactive("org-capture-bookmark", "Clip url, title, and selection to capture via org-protocol",
+          function (I) {
+              org_capture('x', encodeURIComponent(I.buffer.display_uri_string),
+                        encodeURIComponent(I.buffer.document.title),
+                                encodeURIComponent(I.buffer.top_frame.getSelection()),
+                        I.window);
+          });
+interactive("org-capture-ticket", "Clip url, title, and selection to capture via org-protocol",
+          function (I) {
+              org_capture('i', encodeURIComponent(I.buffer.display_uri_string),
+                        encodeURIComponent(I.buffer.document.title),
+                                encodeURIComponent(I.buffer.top_frame.getSelection()),
+                        I.window);
+          });
 interactive("org-capture", "Clip url, title, and selection to capture via org-protocol",
           function (I) {
-              org_capture(encodeURIComponent(I.buffer.display_uri_string),
+              org_capture('', encodeURIComponent(I.buffer.display_uri_string),
                         encodeURIComponent(I.buffer.document.title),
                                 encodeURIComponent(I.buffer.top_frame.getSelection()),
                         I.window);
           });
 // capture with C-c c
+define_key(content_buffer_normal_keymap, "C-c b", "org-capture-bookmark");
+define_key(content_buffer_normal_keymap, "C-c i", "org-capture-ticket");
 define_key(content_buffer_normal_keymap, "C-c c", "org-capture");
 
 // See also http://kb.mozillazine.org/Network.proxy.type