From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Ihm Subject: [PATCH] lisp/org.el: make org-open-at-point handle parens in encoded urls correctly Date: Thu, 10 Aug 2017 22:25:05 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090601020107020501000901" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfu1D-0007yS-KS for emacs-orgmode@gnu.org; Thu, 10 Aug 2017 16:25:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfu1A-00015F-S8 for emacs-orgmode@gnu.org; Thu, 10 Aug 2017 16:25:23 -0400 Received: from [195.159.176.226] (port=38118 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfu1A-00013W-K7 for emacs-orgmode@gnu.org; Thu, 10 Aug 2017 16:25:20 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dfu12-00006v-55 for emacs-orgmode@gnu.org; Thu, 10 Aug 2017 22:25:12 +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: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------090601020107020501000901 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, the attached patch changes org-open-at-point in org.el: Currently, when opening an url the function org-open-at-point uses the variable path, which is the result of applying org-link-unescape on the original url. Thus, all special chars like '() "' etc. which were originally encoded like %20%28 etc. are reverted to their clear text form. This worked for me in most cases, but gives me errors when my url contains encoded chars like '()', i.e. %28%29. The submitted patch fixes this by simply using the original url with all special chars still encoded. Please consider applying it, if fit. Thanks, Marc --- a/lisp/org.el +++ b/lisp/org.el @@ -10707,7 +10707,7 @@ a timestamp or a link." (t (list nil (org-link-unescape option))))))))) ((functionp (org-link-get-parameter type :follow)) - (funcall (org-link-get-parameter type :follow) path)) + (funcall (org-link-get-parameter type :follow) (org-element-property :path link))) ((member type '("coderef" "custom-id" "fuzzy" "radio")) (unless (run-hook-with-args-until-success 'org-open-link-functions path) -- --------------090601020107020501000901 Content-Type: application/x-empty; name="0001-make-org-open-at-point-handle-parens-in-encoded-urls.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*0="0001-make-org-open-at-point-handle-parens-in-encoded-urls.pa"; filename*1="tch" RnJvbSBjNTFlYTMyZjM5ZjY1ZTA0Zjc1NzllMTIyOGE0N2ZmYzg5N2JlMThlIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiAiVS1JSE0tTk9URUJPT0tcXE9sbGkiIDxtYXJjQGlo bS5uYW1lPgpEYXRlOiBUaHUsIDEwIEF1ZyAyMDE3IDIxOjIzOjA0ICswMjAwClN1YmplY3Q6 IFtQQVRDSCAxLzFdIG1ha2Ugb3JnLW9wZW4tYXQtcG9pbnQgaGFuZGxlIHBhcmVucyBpbiBl bmNvZGVkIHVybHMKIGNvcnJlY3RseQoKLS0tCiBsaXNwL29yZy5lbCB8IDIgKy0KIDEgZmls ZSBjaGFuZ2VkLCAxIGluc2VydGlvbigrKSwgMSBkZWxldGlvbigtKQoKZGlmZiAtLWdpdCBh L2xpc3Avb3JnLmVsIGIvbGlzcC9vcmcuZWwKaW5kZXggZjYyYjA3NDcyLi4yZTQyN2I5YWYg MTAwNjQ0Ci0tLSBhL2xpc3Avb3JnLmVsCisrKyBiL2xpc3Avb3JnLmVsCkBAIC0xMDcwNyw3 ICsxMDcwNyw3IEBAIGEgdGltZXN0YW1wIG9yIGEgbGluay4iCiAJCQkJICAgKHQgKGxpc3Qg bmlsCiAJCQkJCSAgICAob3JnLWxpbmstdW5lc2NhcGUgb3B0aW9uKSkpKSkpKSkpCiAJICAg ICAgICg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