[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

server.el problem ?

From: Fabrice Popineau
Subject: server.el problem ?
Date: Wed, 1 Aug 2012 14:01:14 +0200

Hi all,

I wanted to use org-protocol with chrome and emacs-24.1 under windows 7.
I registered the org-protocol protocol with:

@="URL:Org Protocol"
"URL Protocol"=""



@="\"C:\\Local\\Emacs-24.1\\bin\\emacsclientw.exe\" \"-n\" \"%1\""

I added a button to the chrome toolbar with :

_javascript_:location.href="" 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]