From: pierre.techoueyres@free.fr (Pierre Téchoueyres)
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Possible bug in org-protocol
Date: Sat, 09 Mar 2019 14:14:11 +0100 [thread overview]
Message-ID: <878sxow5p8.fsf@killashandra.ballybran.fr> (raw)
In-Reply-To: <87o96kl5hm.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Sat, 09 Mar 2019 11:14:13 +0100")
[-- Attachment #1: Type: text/plain, Size: 599 bytes --]
Hello Nicolas,
Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
> Hello,
>
> pierre.techoueyres@free.fr (Pierre Téchoueyres) writes:
>
>> I think so, as org-protocol, for what I've understood, is triggered by
>> an URL where protocol is org-protocol. So the content of the URL itself
>> must be encoded.
>
> OK. I applied you fix. Thank you.
Thanks for your quick action. I've also written another test for
this patch. Would you mind adding it too ?
As a bonus it show the manual paragraph explaining the neccessity to
encode the parts of url befor calling org-protocol.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Test for org-protocol unescape --]
[-- Type: text/x-patch, Size: 1113 bytes --]
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"))
[-- Attachment #3: Type: text/plain, Size: 118 bytes --]
Regards,
P.S.
Is simple diffs an acceptable format for patches or should I send you an
fully formatted git commit ?
next prev parent reply other threads:[~2019-03-09 13:14 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 [this message]
2019-03-10 10:10 ` Nicolas Goaziou
2019-03-10 16:57 ` Pierre Téchoueyres
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=878sxow5p8.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).