emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ingo Lohmar <i.lohmar@gmail.com>
To: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>,
	emacs-orgmode@gnu.org
Subject: Re: org-protocol: deal with broken links on windows
Date: Thu, 24 Aug 2017 19:00:12 +0200	[thread overview]
Message-ID: <877exsnboj.fsf@acer.localhost.com> (raw)
In-Reply-To: <0f85feb5-60c6-db4b-d3d9-8412d3447a59@gmail.com>

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

  reply	other threads:[~2017-08-24 17:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23 20:02 org-protocol: deal with broken links on windows Ingo Lohmar
2017-08-23 20:59 ` Nikolay Kudryavtsev
2017-08-24 17:00   ` Ingo Lohmar [this message]
2017-08-25 19:38     ` Nikolay Kudryavtsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877exsnboj.fsf@acer.localhost.com \
    --to=i.lohmar@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=nikolay.kudryavtsev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).