From: pierre.techoueyres@free.fr (Pierre Téchoueyres)
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Possible bug in org-protocol
Date: Sun, 10 Mar 2019 17:57:26 +0100 [thread overview]
Message-ID: <87wol6d5vt.fsf@killashandra.ballybran.fr> (raw)
In-Reply-To: <878sxnjb02.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Sun, 10 Mar 2019 11:10:21 +0100")
[-- Attachment #1: Type: text/plain, Size: 317 bytes --]
Hello Nicolas,
Nicolas Goaziou <mail@nicolasgoaziou.fr> 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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: tests for org-protocol url decoding --]
[-- Type: text/x-patch, Size: 1648 bytes --]
From 92db52eb3e546ed03f0ade483a6cb149300ca6c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pierre=20T=C3=A9choueyres?= <pierre.techoueyres@free.fr>
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
next prev parent reply other threads:[~2019-03-10 16:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-07 22:48 [PATCH] Possible bug in org-protocol Pierre Téchoueyres
2019-03-08 8:11 ` Nicolas Goaziou
2019-03-08 18:25 ` Pierre Téchoueyres
2019-03-09 10:14 ` Nicolas Goaziou
2019-03-09 13:14 ` Pierre Téchoueyres
2019-03-10 10:10 ` Nicolas Goaziou
2019-03-10 16:57 ` Pierre Téchoueyres [this message]
2019-03-10 17:23 ` Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wol6d5vt.fsf@killashandra.ballybran.fr \
--to=pierre.techoueyres@free.fr \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).