From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0Gy2DDirtl5kCgAA0tVLHw (envelope-from ) for ; Sat, 09 May 2020 13:08:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id gPlgEUWrtl5sdQAAB5/wlQ (envelope-from ) for ; Sat, 09 May 2020 13:08:21 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0EA83940B28 for ; Sat, 9 May 2020 13:08:19 +0000 (UTC) Received: from localhost ([::1]:43332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXPDH-0001wA-LC for larch@yhetil.org; Sat, 09 May 2020 09:08:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXPCW-0001W4-Rs for emacs-orgmode@gnu.org; Sat, 09 May 2020 09:07:32 -0400 Received: from pie.tf ([62.75.142.128]:46856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXPCV-00055B-NI for emacs-orgmode@gnu.org; Sat, 09 May 2020 09:07:32 -0400 Received: from leintor.e.ffh.zone ([81.3.6.94] helo=localhost) by pie.tf with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from ) id 1jXPCR-0005wJ-Ei; Sat, 09 May 2020 13:07:27 +0000 From: Ferdinand Pieper To: Nicolas Goaziou Subject: Re: Additonal slashes in URI sent to org-protocol In-Reply-To: <87h7wtc1qy.fsf@nicolasgoaziou.fr> References: <87zhbq7zin.fsf@pie.tf> <87h7wtc1qy.fsf@nicolasgoaziou.fr> Date: Sat, 09 May 2020 15:07:26 +0200 Message-ID: <87eertw92p.fsf@pie.tf> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=62.75.142.128; envelope-from=list_gnu@pie.tf; helo=pie.tf X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/09 09:07:28 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 X-Spam-Score: 2.29 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scan-Result: default: False [2.29 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.54050292817748]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:209.51.188.0/24:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.09), country: US(-0.00), ip: 209.51.188.17(-0.54)]; DWL_DNSWL_BLOCKED(0.00)[209.51.188.17:from]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; RCPT_COUNT_TWO(0.00)[2]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; RECEIVED_SPAMHAUS_XBL(3.00)[81.3.6.94:received]; RCVD_COUNT_FIVE(0.00)[5]; FROM_NEQ_ENVFROM(0.00)[list_gnu@pie.tf,emacs-orgmode-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; URIBL_BLOCKED(0.00)[pie.tf:email,nicolasgoaziou.fr:email]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; MIME_TRACE(0.00)[0:+,1:+,2:+]; DMARC_NA(0.00)[pie.tf]; HAS_LIST_UNSUB(-0.01)[]; BAD_REP_POLICIES(0.10)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.51.188.17:from]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: +gU47jYEGvfo --=-=-= Content-Type: text/plain; format=flowed Hey, thanks for your reply! Nicolas Goaziou 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! --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-protocol-Allow-slashes-after-sub-protocol.patch >From ba0ce2837867dac20baa433b15c34cb9d4729e67 Mon Sep 17 00:00:00 2001 From: fpi 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 --=-=-=--