[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Additonal slashes in URI sent to org-protocol
From: |
Ferdinand Pieper |
Subject: |
Re: Additonal slashes in URI sent to org-protocol |
Date: |
Sat, 09 May 2020 15:07:26 +0200 |
Hey,
thanks for your reply!
Nicolas Goaziou <address@hidden> writes:
Please add the function modified in the commit message. Also, if
you haven't signed FSF papers for copyright, you need to insert
TINYCHANGE.
Done.
- (new-style (string= (match-string 1 fname)
"?"))) + (new-style (string-match
(match-string 1 fname) "/*?")))
I don't understand this line. Aren't you calling string-match
backwards? I think you mean:
(new-style (string-match "?" (match-string 1 fname)))
Yes, you are right. I mixed this up because I just changed the
previous line without thinking about it.
Could you also insert a comment explaining why this workaround
is required?
I added a short comment in the commit message. Did you mean to
also insert a comment in the code?
Thanks!
>From ba0ce2837867dac20baa433b15c34cb9d4729e67 Mon Sep 17 00:00:00 2001
From: fpi <address@hidden>
Date: Fri, 3 Apr 2020 19:12:01 +0200
Subject: [PATCH] org-protocol: Allow slashes after sub-protocol
* lisp/org-protocol.el (org-protocol-check-filename-for-protocol): Let
org-protocol handle URIs with additional slashes before the start of
the query string, e.g.
org-protocol:/capture/?template=...
instead of
org-protocol:/capture?template=...
This is needed to support some browsers under windows which insert the
additional slash in the URI.
TINYCHANGE
---
lisp/org-protocol.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 55a534d0d..35e1bc2f8 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -617,13 +617,13 @@ CLIENT is ignored."
(let ((proto
(concat the-protocol
(regexp-quote (plist-get (cdr prolist) :protocol))
- "\\(:/+\\|\\?\\)")))
+ "\\(:/+\\|/*\\?\\)")))
(when (string-match proto fname)
(let* ((func (plist-get (cdr prolist) :function))
(greedy (plist-get (cdr prolist) :greedy))
(split (split-string fname proto))
(result (if greedy restoffiles (cadr split)))
- (new-style (string= (match-string 1 fname) "?")))
+ (new-style (string-match "/*?" (match-string 1 fname))))
(when (plist-get (cdr prolist) :kill-client)
(message "Greedy org-protocol handler. Killing client.")
(server-edit))
--
2.26.2