diff options
author | 2016-11-24 21:40:52 +0100 | |
---|---|---|
committer | 2016-11-24 21:40:52 +0100 | |
commit | ec876cf254aed379b5758681e20f71d48dbbe001 (patch) | |
tree | d1ef37eac10fb50f998a3e71cf70e50a8807e0e3 | |
parent | c06f101307d0f00268d6982802af7d876d460174 (diff) | |
download | new-dotfiles-ec876cf254aed379b5758681e20f71d48dbbe001.tar.gz new-dotfiles-ec876cf254aed379b5758681e20f71d48dbbe001.zip |
Add Emacs org-protocol integration
-rw-r--r-- | conkeror/.conkerorrc/init.org | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/conkeror/.conkerorrc/init.org b/conkeror/.conkerorrc/init.org index 40fb299..43ee390 100644 --- a/conkeror/.conkerorrc/init.org +++ b/conkeror/.conkerorrc/init.org @@ -98,3 +98,33 @@ Add the ~site-js/~ directory to the load path. define_key(default_global_keymap, 'p', 'scuttle-post'); define_key(default_global_keymap, 'P', 'scuttle-post-link'); #+END_SRC + +* Emacs integration + + Using org-protocol we can add information from the page. + + #+BEGIN_SRC js + function org_capture(url, title, selection, window) { + var cmd_str = 'emacsclient "org-protocol://capture://b/' + url + '/' + title + '/' + selection + '"'; + + if (window !== null) { + window.minibuffer.message('Issuing ' + cmd_str); + } + + shell_command_blind(cmd_str); + } + + function org_capture_command(I) { + var url = encodeURIComponent(I.buffer.display_uri_string); + var title = encodeURIComponent(I.buffer.document.title); + var selection = encodeURIComponent(I.buffer.top_frame.getSelection()); + + org_capture(url, title, selection, I.window); + } + + interactive("org-capture", + "Clip url, title and selection to capture via org-protocol", + org_capture_command); + + define_key(content_buffer_normal_keymap, "C-c b", "org-capture"); + #+END_SRC |