I wanted to use org-protocol with chrome and emacs-24.1 under windows 7.
[HKEY_CLASSES_ROOT\org-protocol]
@="URL:Org Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\org-protocol\shell]
[HKEY_CLASSES_ROOT\org-protocol\shell\open]
[HKEY_CLASSES_ROOT\org-protocol\shell\open\command]
@="\"C:\\Local\\Emacs-24.1\\bin\\emacsclientw.exe\" \"-n\" \"%1\""
I added a button to the chrome toolbar with :
javascript:location.href='org-protocol://capture://'+encodeURIComponent(location.href)+'/'+encodeURIComponent(document.title)+'/'+ encodeURIComponent(window.getSelection())
but org-protocol failed to capture anything. The reason was that the emacsclientw.exe directory was added to the org-protocol url.
I traced the problem to server.el and I had to patch it this way:
@@ -1137,7 +1135,8 @@
(let ((file (pop args-left)))
(if coding-system
(setq file (decode-coding-string file coding-system)))
- (setq file (expand-file-name file dir))
+ (unless (string-match "^[^/]+:/" file)
+ (setq file (expand-file-name file dir)))
(push (cons file filepos) files)
(server-log (format "New file: %s %s"
file (or filepos "")) proc))
to prevent addition of the current directory to the org-protocol url.
This is a crude patch, but anyway, I have the feeling nothing should be
added to 'file' when it is 'absolute' or when it is a url like in this case.
Have I done something wrong? Or is there a problem here ?
Thanks for your comments,
--
Fabrice Popineau