diff options
author | Tom Willemse | 2017-01-08 13:33:08 +0100 |
---|---|---|
committer | Tom Willemse | 2017-01-08 13:33:08 +0100 |
commit | 0ee856c6f35f9eda412534f9e2a7b5e4954e6af6 (patch) | |
tree | 4710d1224c8a8781d3462d0dbc364209f38bef10 /conkeror/.conkerorrc/init.org | |
parent | 562791b0ae258ba68851a025f954614fed1f0dd1 (diff) | |
parent | a6a88fd424ea806ce89ce6b2aa1e0d6664b918de (diff) | |
download | new-dotfiles-0ee856c6f35f9eda412534f9e2a7b5e4954e6af6.tar.gz new-dotfiles-0ee856c6f35f9eda412534f9e2a7b5e4954e6af6.zip |
Merge remote-tracking branch 'origin/index' into index
Diffstat (limited to 'conkeror/.conkerorrc/init.org')
-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 |