From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Fabrice Popineau Newsgroups: gmane.emacs.devel Subject: server.el problem ? Date: Wed, 1 Aug 2012 14:01:14 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d043892bd69263c04c6330e12 X-Trace: dough.gmane.org 1343822519 25385 80.91.229.3 (1 Aug 2012 12:01:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 1 Aug 2012 12:01:59 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 01 14:01:59 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SwXcg-0000Yv-AI for ged-emacs-devel@m.gmane.org; Wed, 01 Aug 2012 14:01:54 +0200 Original-Received: from localhost ([::1]:47905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwXcf-00067I-JO for ged-emacs-devel@m.gmane.org; Wed, 01 Aug 2012 08:01:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwXcU-0005st-8S for emacs-devel@gnu.org; Wed, 01 Aug 2012 08:01:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwXcN-00070m-Ez for emacs-devel@gnu.org; Wed, 01 Aug 2012 08:01:42 -0400 Original-Received: from mail-wi0-f177.google.com ([209.85.212.177]:42351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwXcN-00070f-4l for emacs-devel@gnu.org; Wed, 01 Aug 2012 08:01:35 -0400 Original-Received: by wibhm11 with SMTP id hm11so2920337wib.12 for ; Wed, 01 Aug 2012 05:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=NOHgg+CtIcs90fbTx0kdPFzCQZrV1l9dSSi6nZwgAv0=; b=H4l2m83+2dWUX06yhXYm76LiReYkJDgevWpGqxgImfPe0eWD9kqjDAaVfn1W22AlbK PmC8qDyQ87KEO8AxQSnmLa6wveor1jZeaPpioVcYKnLOqU+I68jnkQOZO7Eq5w4K/+Yl 9fESp2dGvTbTR0zVBXXGTVDgKDJyMCZCcIqP51nAJ3AYR3IKGnNbYqACusQqaQLDw7QL 2mTJ3hROp4hwgn+AGuOwhZU6xgAbDqp59ZYluaXpt5vGxUYbmVrNsxNZgK4dNXUfTjBC U03HFxSXQGVvQU72PsVFkJi+IixvGu2dqLnHplhrcX+repujpzAdeHCOXSWOufP7Hwtl eDAw== Original-Received: by 10.180.93.68 with SMTP id cs4mr11371677wib.14.1343822494246; Wed, 01 Aug 2012 05:01:34 -0700 (PDT) Original-Received: by 10.194.18.243 with HTTP; Wed, 1 Aug 2012 05:01:14 -0700 (PDT) X-Google-Sender-Auth: 6GTmfgze1uXTb20iuobAj8Y5SsM X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.177 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152070 Archived-At: --f46d043892bd69263c04c6330e12 Content-Type: text/plain; charset=ISO-8859-1 Hi all, I wanted to use org-protocol with chrome and emacs-24.1 under windows 7. I registered the org-protocol protocol with: [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 --f46d043892bd69263c04c6330e12 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all,

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

[HKEY_CLASSES_ROOT\org-protocol]
@=3D"URL:Org Protocol&= quot;
"URL Protocol"=3D""

[HKEY_CLASSES_ROOT\org-protocol\shell]

[HKEY= _CLASSES_ROOT\org-protocol\shell\open]

[HKEY_CLASSES_ROOT\org-protocol\shell\open\command]
@=3D"\"C:\\Local\\Emacs-24.1\\bin\\emacsclientw.exe\"= \"-n\" \"%1\""

I adde= d a button to the chrome toolbar with :

javascript= :location.href=3D'org-protocol://capture://'+encodeURIComponent(loc= ation.href)+'/'+encodeURIComponent(document.title)+'/'+ enc= odeURIComponent(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 @@
=A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 (let ((file (pop args-left)))
=A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 (if coding-system
=A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 (setq file (decode-coding-string file coding-sy= stem)))
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (setq file (expand-file-name fil= e dir))
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (unless (string-mat= ch "^[^/]+:/" file)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 (setq file (expand-file-name file dir)))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (push (cons file filepos) file= s)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (server-log (format &q= uot;New file: %s %s"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 file (or filepos "")) pr= oc))

to prevent addition of the current directory to t= he org-protocol url.
This is a crude patch, but anyway, I have th= e feeling nothing should be=A0
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,
--=A0
Fabric= e Popineau

--f46d043892bd69263c04c6330e12--