From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Links Date: Tue, 16 Jun 2015 14:50:19 +0200 Message-ID: <87wpz3akc4.fsf@selenimh.access.network> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4qIQ-0002DW-Rh for emacs-orgmode@gnu.org; Tue, 16 Jun 2015 08:48:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4qIM-0005lG-Us for emacs-orgmode@gnu.org; Tue, 16 Jun 2015 08:48:54 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:48110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4qIM-0005l0-PU for emacs-orgmode@gnu.org; Tue, 16 Jun 2015 08:48:50 -0400 In-Reply-To: (Fabrice Popineau's message of "Tue, 16 Jun 2015 14:11:43 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Fabrice Popineau Cc: "emacs-orgmode@gnu.org" Hello, Fabrice Popineau 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