From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: Encoding Problem in export? Date: Sat, 16 Nov 2013 16:16:04 +0100 Message-ID: References: <87bo5s27ey.fsf@sachwertpartner.de> <877ggg7suh.fsf@gmail.com> <51EF32F4.9030309@gmx.de> <87txjk5s2q.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=047d7b3a83d419ff8804eb4ccb09 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhhbU-0005UC-7d for emacs-orgmode@gnu.org; Sat, 16 Nov 2013 10:16:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VhhbS-0003YB-Lr for emacs-orgmode@gnu.org; Sat, 16 Nov 2013 10:16:08 -0500 Received: from mail-lb0-x22b.google.com ([2a00:1450:4010:c04::22b]:54268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhhbS-0003Y7-7t for emacs-orgmode@gnu.org; Sat, 16 Nov 2013 10:16:06 -0500 Received: by mail-lb0-f171.google.com with SMTP id q8so2416344lbi.16 for ; Sat, 16 Nov 2013 07:16:04 -0800 (PST) In-Reply-To: <87txjk5s2q.fsf@gmail.com> 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: Nicolas Goaziou Cc: Org Mode --047d7b3a83d419ff8804eb4ccb09 Content-Type: text/plain; charset=ISO-8859-1 Hi Nicolas I would like to ask you to review the attached patch so I can change it when necessary before I git push it. > it probably means that `org-link-escape' is a bit too zealous (BTW > why don't this function rely on `url-encode-url'?) url-encode-url is a very good hint to solve a different issue that I try to deal with: (from http://lists.gnu.org/archive/html/emacs-orgmode/2013-10/msg00204.html) On Sat, Oct 5, 2013 at 3:04 PM, Michael Brand wrote: > [...] related change that I will suggest with an ERT in a later > patch: Just add "+" to org-link-escape-chars-browser. "+" has not been added to org-link-escape-chars-browser yet and in the meantime I realized that it should not be added in order to not break existing Org links like: [[http://lists.gnu.org/archive/cgi-bin/namazu.cgi?idxname=emacs-orgmode&query="Release+8.2"]] that work the same as [[http://lists.gnu.org/archive/cgi-bin/namazu.cgi?idxname=emacs-orgmode&query="Release 8.2"]] Better is to change the function org-link-escape-browser to use url-encode-url when available (since Emacs 24.3). With this I can write my use case to open a browser with +subject:"Release 8.2" in the query field now as an Org link written manually with %2B for the "+" at the beginning and %25 for its "%" like this [[http://lists.gnu.org/archive/cgi-bin/namazu.cgi?idxname=emacs-orgmode&query=%252Bsubject:"Release+8.2"]] or [[http://lists.gnu.org/archive/cgi-bin/namazu.cgi?idxname=emacs-orgmode&query=%252Bsubject:"Release 8.2"]] Link escaping in org-store-link and link unescaping in the first part of org-open-at-point are not changed, this is important to keep backward compatibility with old Org links. I have used this patch for several weeks on Emacs 24.3.2 without any problem. Michael --047d7b3a83d419ff8804eb4ccb09 Content-Type: text/plain; charset=US-ASCII; name="review.patch.txt" Content-Disposition: attachment; filename="review.patch.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ho2zzkbe0 Y29tbWl0IDY4NmJkNzg4MjQzZWYzODk1MWMzYzUyOWQ0YzY3YzNhZDc2NmY0MTcKQXV0aG9yOiBN aWNoYWVsIEJyYW5kIDxtaWNoYWVsLmNoLmJyYW5kQGdtYWlsLmNvbT4KRGF0ZTogICBTYXQgTm92 IDE2IDE2OjEzOjU3IDIwMTMgKzAxMDAKCiAgICBIeXBlcmxpbms6IFVzZSB1cmwtZW5jb2RlLXVy bCBmb3IgYnJvd3NlLXVybAogICAgCiAgICAqIGxpc3Avb3JnLmVsIChvcmctb3Blbi1hdC1wb2lu dCk6IFdoZW4gYXZhaWxhYmxlIChFbWFjcyAyNC4zKSB1c2UKICAgIGB1cmwtZW5jb2Rl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