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