emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Additonal slashes in URI sent to org-protocol


From: Nicolas Goaziou
Subject: Re: Additonal slashes in URI sent to org-protocol
Date: Wed, 06 May 2020 03:04:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hello,

Ferdinand Pieper <address@hidden> writes:

> Subject: [PATCH] org-protocol: Allow slashes after sub-protocol

Thank you.

Please add the function modified in the commit message. Also, if you
haven't signed FSF papers for copyright, you need to insert TINYCHANGE.

> This change lets 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=...
> ---
>  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..8fbff9611 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) "/*?")))

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)))

Could you also insert a comment explaining why this workaround is
required?

Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]