From mboxrd@z Thu Jan 1 00:00:00 1970 From: pierre.techoueyres@free.fr (Pierre =?utf-8?Q?T=C3=A9choueyres?=) Subject: Re: [PATCH] Possible bug in org-protocol Date: Sun, 10 Mar 2019 17:57:26 +0100 Message-ID: <87wol6d5vt.fsf@killashandra.ballybran.fr> References: <87d0n29u8j.fsf@killashandra.ballybran.fr> <87sgvxkcq3.fsf@nicolasgoaziou.fr> <87sgvxw7em.fsf@killashandra.ballybran.fr> <87o96kl5hm.fsf@nicolasgoaziou.fr> <878sxow5p8.fsf@killashandra.ballybran.fr> <878sxnjb02.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:56927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h31lS-0004WX-Ta for emacs-orgmode@gnu.org; Sun, 10 Mar 2019 12:57:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h31lS-0004bY-2f for emacs-orgmode@gnu.org; Sun, 10 Mar 2019 12:57:30 -0400 Received: from smtp4-g21.free.fr ([212.27.42.4]:6788) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h31lR-0004ac-O6 for emacs-orgmode@gnu.org; Sun, 10 Mar 2019 12:57:30 -0400 Received: from killashandra.ballybran.fr.free.fr (unknown [IPv6:2a01:e0a:1e2:f8b0:9cc3:35bf:aa81:ccf7]) by smtp4-g21.free.fr (Postfix) with ESMTPS id DA04319F5D7 for ; Sun, 10 Mar 2019 17:57:26 +0100 (CET) In-Reply-To: <878sxnjb02.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Sun, 10 Mar 2019 11:10:21 +0100") 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 --=-=-= Content-Type: text/plain Hello Nicolas, Nicolas Goaziou writes: > ... >> Is simple diffs an acceptable format for patches or should I send you an >> fully formatted git commit ? > > The latter, please. > > Could you send a complete version of the patch? What dou you think of the attached one ? Regards, Pierre --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-protocol-Fix-URL-handling-add-tests.patch Content-Description: tests for org-protocol url decoding >From 92db52eb3e546ed03f0ade483a6cb149300ca6c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20T=C3=A9choueyres?= Date: Sun, 10 Mar 2019 17:50:22 +0100 Subject: [PATCH] org-protocol: Fix URL handling -- add tests * testing/lisp/test-org-protocol.el (test-org-protocol/org-protocol-parse-parameters): add test for the commit e0bfdec22 which un-escape extracted link as it is url-encoded externally. --- testing/lisp/test-org-protocol.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/testing/lisp/test-org-protocol.el b/testing/lisp/test-org-protocol.el index fc764386c..6ee368dcf 100644 --- a/testing/lisp/test-org-protocol.el +++ b/testing/lisp/test-org-protocol.el @@ -35,6 +35,16 @@ (let ((data (org-protocol-parse-parameters "url=abc&title=def" t))) (should (string= (plist-get data :url) "abc")) (should (string= (plist-get data :title) "def"))) + ;; Parse new-style complex links + (let* ((url (concat "template=p&" + "url=https%3A%2F%2Forgmode.org%2Forg.html%23capture-protocol&" + "title=The%20Org%20Manual&" + "body=9.4.2%20capture%20protocol")) + (data (org-protocol-parse-parameters url))) + (should (string= (plist-get data :template) "p")) + (should (string= (plist-get data :url) "https://orgmode.org/org.html#capture-protocol")) + (should (string= (plist-get data :title) "The Org Manual")) + (should (string= (plist-get data :body) "9.4.2 capture protocol"))) ;; Parse old-style links (let ((data (org-protocol-parse-parameters "abc/def" nil '(:url :title)))) (should (string= (plist-get data :url) "abc")) -- 2.20.1 --=-=-=--