emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Lundin <mdl@imapmail.org>
To: Carsten Dominik <dominik@uva.nl>
Cc: org-mode list <emacs-orgmode@gnu.org>
Subject: Re: Problems with opening a link
Date: Fri, 31 Mar 2017 12:54:40 -0500	[thread overview]
Message-ID: <874ly95o2n.fsf@fastmail.fm> (raw)
In-Reply-To: <CADn3Z2KzgGcxnoP2BviU0QJMStnyzeGXmJ9izgFdK3cj6d7U5Q@mail.gmail.com> (Carsten Dominik's message of "Fri, 31 Mar 2017 11:39:25 +0200")

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

  parent reply	other threads:[~2017-03-31 17:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2017-04-01  8:57   ` Carsten Dominik
2017-04-01 12:16     ` Nicolas Goaziou

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=874ly95o2n.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=dominik@uva.nl \
    --cc=emacs-orgmode@gnu.org \
    /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).