From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Escaping links Date: Sat, 19 Aug 2017 11:15:25 +0200 Message-ID: <87wp5zlxzm.fsf@nicolasgoaziou.fr> References: <87zib65e93.fsf@nicolasgoaziou.fr> <871soh5amk.fsf@nicolasgoaziou.fr> <66cadfb9-5b38-03fb-cde0-090b1dfd7c66@ossau.homelinux.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dizqv-0006qB-11 for emacs-orgmode@gnu.org; Sat, 19 Aug 2017 05:15:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dizqq-0004Ad-4b for emacs-orgmode@gnu.org; Sat, 19 Aug 2017 05:15:33 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:35649) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dizqp-00049E-Ui for emacs-orgmode@gnu.org; Sat, 19 Aug 2017 05:15:28 -0400 In-Reply-To: (Fabrice Popineau's message of "Mon, 14 Aug 2017 18:35:54 +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" To: Fabrice Popineau Cc: Neil Jerram , "emacs-orgmode@gnu.org" , fabrice.popineau@centralesupelec.fr Hello, Fabrice Popineau writes: > You could also prefix the link by a string holding (in ascii) the number of > bytes of the unencoded link. > > But that makes raw/manual editing of an org file much harder. I'd rather have something simple. Here are some suggestions. 1. Replace "\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]" (`org-bracket-link-regexp') with "\\[\\[\\([^\000]+?\\)\\]\\(\\[\\([^\000]+?\\)\\]\\)?\\]". This gives more possibilities. We will just live with the unsupported cases (e.g. square brackets at the end of the path or the description). 2. Use good ole backslash character to escape ambiguous characters (even though any character can be escaped). `org-link-unescape' would take care of them instead of url-encoded characters. 3. A mix of both. `org-bracket-link-regexp' could become more complicated though. I'm open to other suggestions, as long as they do not massively impede manual editing. Regards, -- Nicolas Goaziou