summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2015-06-17 10:36:20 +0200
committerGravatar Tom Willemse2015-06-17 10:36:20 +0200
commitb3bd6392061366d1188771fcb5227597667043d5 (patch)
tree5812255dc2828d3e7cd31ce65dba2fda06f0455b
parent1e46767718fd70f974036041cee59a139c7c3997 (diff)
downloaddotfiles-b3bd6392061366d1188771fcb5227597667043d5.tar.gz
dotfiles-b3bd6392061366d1188771fcb5227597667043d5.zip
Add org-capture template for Conkeror
-rw-r--r--conkeror/.conkerorrc/init.js28
-rw-r--r--emacs/.emacs.d/site-lisp/org-init.el4
2 files changed, 30 insertions, 2 deletions
diff --git a/conkeror/.conkerorrc/init.js b/conkeror/.conkerorrc/init.js
index bb6a578..6e4acc6 100644
--- a/conkeror/.conkerorrc/init.js
+++ b/conkeror/.conkerorrc/init.js
@@ -99,6 +99,34 @@ interactive("org-store-link",
+ "kill ring",
oni_org_store_link);
+function org_capture(url, title, body, window, template) {
+ template = template || '';
+ var cmd_str = 'emacsclient "org-protocol://capture:/'+template+'/'+url+'/'+title+'/'+body+'"';
+
+ if (window != null) {
+ window.minibuffer.message('Issuing ' + cmd_str);
+ }
+
+ shell_command_blind(cmd_str);
+}
+interactive("org-capture", "Clip url, title, and selection to capture via org-protocol",
+ function (I) {
+ org_capture(encodeURIComponent(I.buffer.display_uri_string),
+ encodeURIComponent(I.buffer.document.title),
+ encodeURIComponent(I.buffer.top_frame.getSelection()),
+ I.window);
+ });
+interactive("org-capture-taiga", "Capture a Taiga task via org-protocol",
+ function(I) {
+ var title = I.buffer.document.getElementsByClassName('view-subject')[0].childNodes[0].nodeValue,
+ body = I.buffer.document.getElementsByClassName('markItUpEditor')[0].value;
+ org_capture(encodeURIComponent(I.buffer.display_uri_string),
+ encodeURIComponent(title),
+ encodeURIComponent(body),
+ I.window,
+ 'w');
+ });
+
interactive("find-url-from-history",
"Find a page from history in the current buffer",
"find-url",
diff --git a/emacs/.emacs.d/site-lisp/org-init.el b/emacs/.emacs.d/site-lisp/org-init.el
index ba48997..e35af30 100644
--- a/emacs/.emacs.d/site-lisp/org-init.el
+++ b/emacs/.emacs.d/site-lisp/org-init.el
@@ -153,8 +153,8 @@ predecessor if there is a non-DONE sibling defined before it."
("d" "10 things to do today" entry (file+datetree "~/documents/org/dailies.org")
"* %<%R> [0/10]\n\n - [ ] %?\n - [ ] \n - [ ] \n - [ ] \n - [ ] \n - [ ] \n - [ ] \n - [ ] \n - [ ] \n - [ ] "
:empty-lines-before 1)
- ("w" "Taiga task" entry (file+headline "~/documents/org/tasks" "Inbox")
- (function taiga-org-task-template)
+ ("w" "Org protocol task" entry (file+headline "~/documents/org/tasks" "Inbox")
+ "* TODO %^{Title|%:description}\n\n Source: %u, %c\n\n %i"
:empty-lines-before 1)))
(setq org-contacts-files '("~/documents/org/misc/contacts.org"))
(setq org-agenda-show-outline-path nil)