emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <dominik@uva.nl>
To: Carsten Dominik <dominik@uva.nl>, org-mode list <emacs-orgmode@gnu.org>
Subject: Re: Problems with opening a link
Date: Sat, 1 Apr 2017 10:57:33 +0200	[thread overview]
Message-ID: <CADn3Z2LCROE2qtUP2AX0auhWnxcSyhssGXSWtyLpppnXQWnuVg@mail.gmail.com> (raw)
In-Reply-To: <874ly95o2n.fsf@fastmail.fm>

[-- 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 --]

  reply	other threads:[~2017-04-01  8:57 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
2017-04-01  8:57   ` Carsten Dominik [this message]
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=CADn3Z2LCROE2qtUP2AX0auhWnxcSyhssGXSWtyLpppnXQWnuVg@mail.gmail.com \
    --to=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).