emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Fabrice Popineau <fabrice.popineau@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Links
Date: Tue, 16 Jun 2015 14:50:19 +0200	[thread overview]
Message-ID: <87wpz3akc4.fsf@selenimh.access.network> (raw)
In-Reply-To: <CAFgFV9N4p6V4K01gj-Eb-6KVTrFQ-f5bkXPKT2m4xn5hPxQJaA@mail.gmail.com> (Fabrice Popineau's message of "Tue, 16 Jun 2015 14:11:43 +0200")

Hello,

Fabrice Popineau <fabrice.popineau@gmail.com> writes:

> Assume the following file :

[...]

> ** First link

[...]

> ** Second link
> [2015-06-16 mar. 13:58]
>
> - [[First%20link][First link]]

[...]

> The exporter fails to resolve the (fuzzy) link "First%20link".
> However, if I click on the link, I jump to the right heading.
>
> Am I missing something or should this be made consistent ?

You are not missing something, but making it consistent is not as
trivial as it sounds.

The problem is that, AFAIK, we cannot tell if a given string is
url-encoded or not. Also, url-encoding is not idempotent.

So, export process doesn't url-decode links, and cannot handle the link
above. OTOH, `org-open-at-point' assumes links are url-encoded (and they
are if you stored them with `org-store-link') so it url-decodes the link
above and is able to follow it.

I think it would be a mistake to expect all links to be url-encoded as
it is a pain when you enter most of your internal links manually.
However, forbidding url-encoding for internal links is also a mistake
because some of them cannot be expressed otherwise (e.g., headlines
containing square brackets). The current situation is also problematic,
of course. Well.

At this point, it seems that all is left are cheesy approaches. E.g,
when a path matches "%[A-Za-z0-9]\\{2\\}", decode it during export. This
leaves pathological cases (e.g., when you really meant, for some very
good reason, to have a headline called "* %25"), though. That's not
great either.

WDYT?

Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2015-06-16 12:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16 12:11 Links Fabrice Popineau
2015-06-16 12:50 ` Nicolas Goaziou [this message]
2015-06-16 13:32   ` Links Fabrice Popineau
2015-06-16 21:30     ` Links Nicolas Goaziou
2015-06-17  6:44       ` Links Suvayu Ali
2015-06-17  9:47         ` Links Nicolas Goaziou
2015-06-18 23:41           ` Links Suvayu Ali

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=87wpz3akc4.fsf@selenimh.access.network \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=fabrice.popineau@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).