emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Problems with opening a link
@ 2017-03-31  9:39 Carsten Dominik
  2017-03-31 12:05 ` Peter Davis
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Carsten Dominik @ 2017-03-31  9:39 UTC (permalink / raw)
  To: org-mode list

[-- Attachment #1: Type: text/plain, Size: 545 bytes --]

Hi everyone,

I have problems opening a link in org.

The link looks like this:

https://ui.adsabs.harvard.edu/#search/q=author%3A%22Dominik%2CC%22/metrics

I have copied it like this from the address bar in a browser.

If I click on it in Org-mode, the link is modified to

https://ui.adsabs.harvard.edu/%23search/q=author:%22Dominik,C%22/metrics

before being sent to the browser, and the browser cannot resolve it.  The
problem seems to be that # has been turned into %23

Where does this happen, and how can I fix this?

Thank you.

Carsten

[-- Attachment #2: Type: text/html, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Problems with opening a link
  2017-03-31  9:39 Problems with opening a link Carsten Dominik
@ 2017-03-31 12:05 ` Peter Davis
  2017-03-31 12:22 ` Scott Randby
  2017-03-31 17:54 ` Matt Lundin
  2 siblings, 0 replies; 10+ messages in thread
From: Peter Davis @ 2017-03-31 12:05 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 816 bytes --]

It also appears that %3A gets turned into :





On Fri, Mar 31, 2017, at 05:39 AM, Carsten Dominik wrote:

> Hi everyone,

> 

> I have problems opening a link in org.

> 

> The link looks like this:

> 

> https://ui.adsabs.harvard.edu/#search/q=author%3A%22Dominik%2CC%22/metrics
> 

> I have copied it like this from the address bar in a browser.

> 

> If I click on it in Org-mode, the link is modified to

> 

> https://ui.adsabs.harvard.edu/%23search/q=author:%22Dominik,C%22/metrics
> 

> before being sent to the browser, and the browser cannot resolve it.
> The problem seems to be that # has been turned into %23
> 

> Where does this happen, and how can I fix this?

> 

> Thank you.

> 

> Carsten



--

  Peter Davis

  www.techcurmudgeon.com

[-- Attachment #2: Type: text/html, Size: 1720 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Problems with opening a link
  2017-03-31  9:39 Problems with opening a link Carsten Dominik
  2017-03-31 12:05 ` Peter Davis
@ 2017-03-31 12:22 ` Scott Randby
  2017-03-31 12:52   ` Carsten Dominik
  2017-03-31 17:54 ` Matt Lundin
  2 siblings, 1 reply; 10+ messages in thread
From: Scott Randby @ 2017-03-31 12:22 UTC (permalink / raw)
  To: Carsten Dominik, org-mode list

On 03/31/2017 05:39 AM, Carsten Dominik wrote:
> Hi everyone,
> 
> I have problems opening a link in org.
> 
> The link looks like this:
> 
> https://ui.adsabs.harvard.edu/#search/q=author%3A%22Dominik%2CC%22/metrics
> 
> I have copied it like this from the address bar in a browser.
> 
> If I click on it in Org-mode, the link is modified to
> 
> https://ui.adsabs.harvard.edu/%23search/q=author:%22Dominik,C%22/metrics
> 
> before being sent to the browser, and the browser cannot resolve it. 
> The problem seems to be that # has been turned into %23

The link worked fine when I tried opening it from an Org file. I'm using
Org 9.0.3 in Emacs 24.5.1 and my browser is Firefox.

Scott Randby

> 
> Where does this happen, and how can I fix this?
> 
> Thank you.
> 
> Carsten

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Problems with opening a link
  2017-03-31 12:22 ` Scott Randby
@ 2017-03-31 12:52   ` Carsten Dominik
  2017-03-31 14:30     ` Tim O'Callaghan
  2017-03-31 16:04     ` Scott Randby
  0 siblings, 2 replies; 10+ messages in thread
From: Carsten Dominik @ 2017-03-31 12:52 UTC (permalink / raw)
  To: Scott Randby; +Cc: org-mode list

[-- Attachment #1: Type: text/plain, Size: 1030 bytes --]

Hi Scott,

which system are you on?

I am using a Mac, and the "open" command in the mac as
browse-url-generic-program

Carsten

On Fri, Mar 31, 2017 at 2:22 PM, Scott Randby <srandby@gmail.com> wrote:

> On 03/31/2017 05:39 AM, Carsten Dominik wrote:
> > Hi everyone,
> >
> > I have problems opening a link in org.
> >
> > The link looks like this:
> >
> > https://ui.adsabs.harvard.edu/#search/q=author%3A%22Dominik%
> 2CC%22/metrics
> >
> > I have copied it like this from the address bar in a browser.
> >
> > If I click on it in Org-mode, the link is modified to
> >
> > https://ui.adsabs.harvard.edu/%23search/q=author:%22Dominik,C%22/metrics
> >
> > before being sent to the browser, and the browser cannot resolve it.
> > The problem seems to be that # has been turned into %23
>
> The link worked fine when I tried opening it from an Org file. I'm using
> Org 9.0.3 in Emacs 24.5.1 and my browser is Firefox.
>
> Scott Randby
>
> >
> > Where does this happen, and how can I fix this?
> >
> > Thank you.
> >
> > Carsten
>

[-- Attachment #2: Type: text/html, Size: 1948 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Problems with opening a link
  2017-03-31 12:52   ` Carsten Dominik
@ 2017-03-31 14:30     ` Tim O'Callaghan
  2017-03-31 17:02       ` Matt Lundin
  2017-03-31 16:04     ` Scott Randby
  1 sibling, 1 reply; 10+ messages in thread
From: Tim O'Callaghan @ 2017-03-31 14:30 UTC (permalink / raw)
  To: org-mode

Hi,

I've had a similar issue, but with redmine links.
if i have
#+LINK: rm http://redmine/issues/%s

* link [[rm:3287]] does not work properly any more (with firefox under KDE)

best regards,

Tim.

On 31 March 2017 at 14:52, Carsten Dominik <dominik@uva.nl> wrote:
> Hi Scott,
>
> which system are you on?
>
> I am using a Mac, and the "open" command in the mac as
> browse-url-generic-program
>
> Carsten
>
> On Fri, Mar 31, 2017 at 2:22 PM, Scott Randby <srandby@gmail.com> wrote:
>>
>> On 03/31/2017 05:39 AM, Carsten Dominik wrote:
>> > Hi everyone,
>> >
>> > I have problems opening a link in org.
>> >
>> > The link looks like this:
>> >
>> >
>> > https://ui.adsabs.harvard.edu/#search/q=author%3A%22Dominik%2CC%22/metrics
>> >
>> > I have copied it like this from the address bar in a browser.
>> >
>> > If I click on it in Org-mode, the link is modified to
>> >
>> > https://ui.adsabs.harvard.edu/%23search/q=author:%22Dominik,C%22/metrics
>> >
>> > before being sent to the browser, and the browser cannot resolve it.
>> > The problem seems to be that # has been turned into %23
>>
>> The link worked fine when I tried opening it from an Org file. I'm using
>> Org 9.0.3 in Emacs 24.5.1 and my browser is Firefox.
>>
>> Scott Randby
>>
>> >
>> > Where does this happen, and how can I fix this?
>> >
>> > Thank you.
>> >
>> > Carsten
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Problems with opening a link
  2017-03-31 12:52   ` Carsten Dominik
  2017-03-31 14:30     ` Tim O'Callaghan
@ 2017-03-31 16:04     ` Scott Randby
  1 sibling, 0 replies; 10+ messages in thread
From: Scott Randby @ 2017-03-31 16:04 UTC (permalink / raw)
  To: Carsten Dominik, org-mode list

On 03/31/2017 08:52 AM, Carsten Dominik wrote:
> Hi Scott,
>
> which system are you on?
>
> I am using a Mac, and the "open" command in the mac as
> browse-url-generic-program

I'm using Xubuntu 16.04. I believe the function being used is
browse-url-browser-function which I have set to browse-url-firefox. The
variable browse-url-generic-program has no value on my system.

Scott

>
> Carsten
>
> On Fri, Mar 31, 2017 at 2:22 PM, Scott Randby <srandby@gmail.com
> <mailto:srandby@gmail.com>> wrote:
>
>     On 03/31/2017 05:39 AM, Carsten Dominik wrote:
>     > Hi everyone,
>     >
>     > I have problems opening a link in org.
>     >
>     > The link looks like this:
>     >
>     > https://ui.adsabs.harvard.edu/#search/q=author%3A%22Dominik%2CC%22/metrics
>     <https://ui.adsabs.harvard.edu/#search/q=author%3A%22Dominik%2CC%22/metrics>
>     >
>     > I have copied it like this from the address bar in a browser.
>     >
>     > If I click on it in Org-mode, the link is modified to
>     >
>     > https://ui.adsabs.harvard.edu/%23search/q=author:%22Dominik,C%22/metrics
>     <https://ui.adsabs.harvard.edu/%23search/q=author:%22Dominik,C%22/metrics>
>     >
>     > before being sent to the browser, and the browser cannot resolve it.
>     > The problem seems to be that # has been turned into %23
>
>     The link worked fine when I tried opening it from an Org file. I'm using
>     Org 9.0.3 in Emacs 24.5.1 and my browser is Firefox.
>
>     Scott Randby
>
>     >
>     > Where does this happen, and how can I fix this?
>     >
>     > Thank you.
>     >
>     > Carsten
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Problems with opening a link
  2017-03-31 14:30     ` Tim O'Callaghan
@ 2017-03-31 17:02       ` Matt Lundin
  0 siblings, 0 replies; 10+ messages in thread
From: Matt Lundin @ 2017-03-31 17:02 UTC (permalink / raw)
  To: Tim O'Callaghan; +Cc: org-mode

"Tim O'Callaghan" <timo@linux.com> writes:

> I've had a similar issue, but with redmine links.
> if i have
>
> #+LINK: rm http://redmine/issues/%s
>
> * link [[rm:3287]] does not work properly any more (with firefox under
> KDE)

The link above is missing ".org". It should look like this:

#+LINK: rm http://redmine.org/issues/%s

Matt

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Problems with opening a link
  2017-03-31  9:39 Problems with opening a link Carsten Dominik
  2017-03-31 12:05 ` Peter Davis
  2017-03-31 12:22 ` Scott Randby
@ 2017-03-31 17:54 ` Matt Lundin
  2017-04-01  8:57   ` Carsten Dominik
  2 siblings, 1 reply; 10+ messages in thread
From: Matt Lundin @ 2017-03-31 17:54 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: org-mode list

Hi Carsten,

Carsten Dominik <dominik@uva.nl> writes:

> Hi everyone,
>
> I have problems opening a link in org.
>
> The link looks like this:
>
> https://ui.adsabs.harvard.edu/#search/q=author%3A%22Dominik%2CC%22/metrics
>
> I have copied it like this from the address bar in a browser.
>
> If I click on it in Org-mode, the link is modified to
>
> https://ui.adsabs.harvard.edu/%23search/q=author:%22Dominik,C%22/metrics
>
> before being sent to the browser, and the browser cannot resolve it.
> The problem seems to be that # has been turned into %23

I cannot replicate this on Linux, but there do seem to be some
inconsistencies with how Org-mode is escaping/unescaping links:

AFAICT, Org-mode itself is not modifying the "#". The relevant lines of
org-open-at-point are 10747-10748:

      ((functionp (org-link-get-parameter type :follow))
        (funcall (org-link-get-parameter type :follow) path))

Just simply copying and pasting the link from the browser, I found that
`path` at the lines above is:

//ui.adsabs.harvard.edu/#search/q=author:"Dominik,C"/metrics

Note: the time one gets to this point, the path has already been
unescaped (see line 10712).

Meanwhile, `type` is...

https

...which results in org-open-at-point calling the following:

(lambda (path) (browse-url (concat "https:" path)))

However, there are inconsistencies when one turns the pasted url above
into an actual org-link (e.g., by calling org-insert-link).

Then the link in org-mode looks like this (note that the escape
percentage characters are themselves escaped, which seems a bit strange
to me):

[[https://ui.adsabs.harvard.edu/#search/q=author%253A%2522Dominik%252CC%2522/metrics]]

Now when you open at point, the `path` at line 10748 is:

//ui.adsabs.harvard.edu/#search/q=author%3A%22Dominik%2CC%22/metrics

Hope this helps in debugging.
Matt

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Problems with opening a link
  2017-03-31 17:54 ` Matt Lundin
@ 2017-04-01  8:57   ` Carsten Dominik
  2017-04-01 12:16     ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: Carsten Dominik @ 2017-04-01  8:57 UTC (permalink / raw)
  To: Carsten Dominik, org-mode list

[-- Attachment #1: Type: text/plain, Size: 2791 bytes --]

Hi everyone, thank you for your input.  Matt, thanks a lot for the detailed
look into this.  Indeed there are inconsistencies on how this works in Org,
and there are things happening that are system dependent.  I thibk what is
biting me this time is the system dependence which is really weird.

When I, on my Mac, call this from a commandline in bash
$ open
https://ui.adsabs.harvard.edu/#search/q=author%3A%22Dominik%2CC%22/metrics

things work.  So I made a little perl program, myopenurl, that looks like
this:

#!/usr/bin/perl
$url = join(" ",@ARGV);
system "open \"$url\";

and that does the trick when I put it into browse-url-generic-program.
Fixed for now, but I think the entire url quoting scheme in Org might
deserve another look.

Thanks.

Carsten

On Fri, Mar 31, 2017 at 7:54 PM, Matt Lundin <mdl@imapmail.org> wrote:

> Hi Carsten,
>
> Carsten Dominik <dominik@uva.nl> writes:
>
> > Hi everyone,
> >
> > I have problems opening a link in org.
> >
> > The link looks like this:
> >
> > https://ui.adsabs.harvard.edu/#search/q=author%3A%22Dominik%
> 2CC%22/metrics
> >
> > I have copied it like this from the address bar in a browser.
> >
> > If I click on it in Org-mode, the link is modified to
> >
> > https://ui.adsabs.harvard.edu/%23search/q=author:%22Dominik,C%22/metrics
> >
> > before being sent to the browser, and the browser cannot resolve it.
> > The problem seems to be that # has been turned into %23
>
> I cannot replicate this on Linux, but there do seem to be some
> inconsistencies with how Org-mode is escaping/unescaping links:
>
> AFAICT, Org-mode itself is not modifying the "#". The relevant lines of
> org-open-at-point are 10747-10748:
>
>       ((functionp (org-link-get-parameter type :follow))
>         (funcall (org-link-get-parameter type :follow) path))
>
> Just simply copying and pasting the link from the browser, I found that
> `path` at the lines above is:
>
> //ui.adsabs.harvard.edu/#search/q=author:"Dominik,C"/metrics
>
> Note: the time one gets to this point, the path has already been
> unescaped (see line 10712).
>
> Meanwhile, `type` is...
>
> https
>
> ...which results in org-open-at-point calling the following:
>
> (lambda (path) (browse-url (concat "https:" path)))
>
> However, there are inconsistencies when one turns the pasted url above
> into an actual org-link (e.g., by calling org-insert-link).
>
> Then the link in org-mode looks like this (note that the escape
> percentage characters are themselves escaped, which seems a bit strange
> to me):
>
> [[https://ui.adsabs.harvard.edu/#search/q=author%253A%
> 2522Dominik%252CC%2522/metrics]]
>
> Now when you open at point, the `path` at line 10748 is:
>
> //ui.adsabs.harvard.edu/#search/q=author%3A%22Dominik%2CC%22/metrics
>
> Hope this helps in debugging.
> Matt
>

[-- Attachment #2: Type: text/html, Size: 4439 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Problems with opening a link
  2017-04-01  8:57   ` Carsten Dominik
@ 2017-04-01 12:16     ` Nicolas Goaziou
  0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Goaziou @ 2017-04-01 12:16 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: org-mode list

Hello,

Carsten Dominik <dominik@uva.nl> writes:

> but I think the entire url quoting scheme in Org might deserve another
> look.

It does. I also suggested to think about it some time ago.

Ideally, Org should never quote any URI whatsoever. This is really the
root of all evil, because you never know if characters are escaped, and,
as a consequence, you never really know how many un-escaping turns are
required.

Unfortunately, there are a couple of forbidden characters in link
syntax, namely "[", "]", and multiple consecutive spaces. So, if we want
to allow those in, e.g. file names or labels ("http" URL are not
a problem since you can hex-encode them), we need some kind of escaping
mechanism.

In any case, it should be different than hex-encoding so we can tell if
there is some Org specific escaping involved.

Just some data to keep the ball rolling.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-04-01 12:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-31  9:39 Problems with opening a link Carsten Dominik
2017-03-31 12:05 ` Peter Davis
2017-03-31 12:22 ` Scott Randby
2017-03-31 12:52   ` Carsten Dominik
2017-03-31 14:30     ` Tim O'Callaghan
2017-03-31 17:02       ` Matt Lundin
2017-03-31 16:04     ` Scott Randby
2017-03-31 17:54 ` Matt Lundin
2017-04-01  8:57   ` Carsten Dominik
2017-04-01 12:16     ` Nicolas Goaziou

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).