emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Ferdinand Pieper <list_gnu@pie.tf>
Cc: emacs-orgmode@gnu.org
Subject: Re: Additonal slashes in URI sent to org-protocol
Date: Wed, 06 May 2020 03:04:37 +0200	[thread overview]
Message-ID: <87h7wtc1qy.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87zhbq7zin.fsf@pie.tf> (Ferdinand Pieper's message of "Sun, 05 Apr 2020 16:55:44 +0200")

Hello,

Ferdinand Pieper <list_gnu@pie.tf> 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	other threads:[~2020-05-06  1:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-05 14:55 Ferdinand Pieper
2020-05-06  1:04 ` Nicolas Goaziou [this message]
2020-05-09 13:07   ` Ferdinand Pieper
2020-05-22 15:56     ` Bastien
  -- strict thread matches above, loose matches on Subject: below --
2020-04-05 13:56 Ferdinand Pieper

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=87h7wtc1qy.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=list_gnu@pie.tf \
    --subject='Re: Additonal slashes in URI sent to org-protocol' \
    /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

Code repositories for project(s) associated with this 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).