From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Lohmar Subject: Re: org-protocol: deal with broken links on windows Date: Thu, 24 Aug 2017 19:00:12 +0200 Message-ID: <877exsnboj.fsf@acer.localhost.com> References: <87d17mm4sd.fsf@acer.localhost.com> <0f85feb5-60c6-db4b-d3d9-8412d3447a59@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkvUS-0000GI-Qx for emacs-orgmode@gnu.org; Thu, 24 Aug 2017 13:00:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkvUN-0005cL-6P for emacs-orgmode@gnu.org; Thu, 24 Aug 2017 13:00:20 -0400 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:38509) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dkvUN-0005bd-0x for emacs-orgmode@gnu.org; Thu, 24 Aug 2017 13:00:15 -0400 Received: by mail-wm0-x229.google.com with SMTP id z132so78561wmg.1 for ; Thu, 24 Aug 2017 10:00:14 -0700 (PDT) In-Reply-To: <0f85feb5-60c6-db4b-d3d9-8412d3447a59@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nikolay Kudryavtsev , emacs-orgmode@gnu.org Hi Nikolay, Thanks for your reply. I checked a few things today: I am using Org mode version 9.0.9 (9.0.9-82-gb862c2-elpaplus, org-plus-contrib-20170814/) and the unofficial emacs build GNU Emacs 25.2.1 (x86_64-w64-mingw32) of 2017-04-24 from http://sourceforge.net/projects/emacsbinw64/ (supposedly straight from original sources). > emacsclientw.exe > "org-protocol:/capture?template=w&url=http%3A%2F%2Fjira%2Fbrowse%2FSDST-705&title=SOMETHING&body=" 1) Without any patch/advice, calling emacsclientw directly on this address (modulo template letter) works fine, as does a call with the full executable path. I think the path prefix is weird, but fine with me. The culprit (independent of the prefix) is the "/" before the query string. So thanks for narrowing this down, first of all. 2) Just a side note: store-link (instead of capture) shows the exact same behavior. 3) Here are the bookmarklets I use... >------------------------------------------------------------------------------< javascript:location.href='org-protocol://store-link?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection()) javascript:location.href='org-protocol://capture?template=y&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection()) >------------------------------------------------------------------------------< 4) ...and the registry entries >------------------------------------------------------------------------------< REGEDIT4 [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:\\Program Files\\Emacs\\bin\\emacsclientw.exe\" --no-wait \"%1\"" >------------------------------------------------------------------------------< I think this is all as it should be, and I have tried to make the minimal changes to get a working system. 5) Soooooo the remaining puzzle: How can the "/" get in there? As I said, it happens when called from both FF (although I have not used that for a few weeks now) and Iridium. It seems to happen somewhere b/w the browser and emacsclientw, ie, in the Windows "protocol" handling, I suppose? If other people can confirm (or even explain) this behavior, we could decide if there should be a transformation on the FNAME argument. In that case, it should definitely leave the leading executable path alone. Thanks a lot so far! Ingo