From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Branham Subject: [PATCH] protocol: allow users to disable warning about old style links Date: Wed, 14 Jun 2017 14:11:34 +0200 Message-ID: <8737b2bwg9.fsf@utexas.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dL79D-0002Jh-C1 for emacs-orgmode@gnu.org; Wed, 14 Jun 2017 08:11:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dL79A-0000Ti-0G for emacs-orgmode@gnu.org; Wed, 14 Jun 2017 08:11:43 -0400 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:35466) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dL799-0000T3-Mt for emacs-orgmode@gnu.org; Wed, 14 Jun 2017 08:11:39 -0400 Received: by mail-lf0-x241.google.com with SMTP id v20so16324498lfa.2 for ; Wed, 14 Jun 2017 05:11:38 -0700 (PDT) Received: from mars (edu221103.eduroam.gu.se. [130.241.221.103]) by smtp.gmail.com with ESMTPSA id i127sm235169lfg.40.2017.06.14.05.11.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Jun 2017 05:11:35 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hello, This patch allows org mode users to disable the warning issued about old org protocol style links. This is important because sometimes (e.g. browser extensions), we don’t have easy control over the format specified. Issuing the warning is annoying because it pops up in a new window. Thanks, Alex >From 8bfc951308324de8e455128950193c046691f1f8 Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Wed, 14 Jun 2017 14:06:18 +0200 Subject: [PATCH] protocol: allow user to disable warning about old style links --- lisp/org-protocol.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el index 825435674..2eb1094e9 100644 --- a/lisp/org-protocol.el +++ b/lisp/org-protocol.el @@ -271,6 +271,12 @@ This should be a single regexp string." :package-version '(Org . "8.0") :type 'string) +(defcustom org-protocol-warn-about-old-links t + "If non-nil (the default), issue a warning when org protocol +receives old style links." + :group 'org-protocol + :type 'boolean) + ;;; Helper functions: (defun org-protocol-sanitize-uri (uri) @@ -618,8 +624,9 @@ CLIENT is ignored." (if new-style (funcall func (org-protocol-parse-parameters result new-style)) - (warn "Please update your Org Protocol handler \ -to deal with new-style links.") + (when org-protocol-warn-about-old-links + (warn "Please update your Org Protocol handler \ +to deal with new-style links.")) (funcall func result)))) ;; Greedy protocol handlers are responsible for ;; parsing their own filenames. -- 2.13.1 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-protocol-allow-user-to-disable-warning-about-old-sty.patch >From 8bfc951308324de8e455128950193c046691f1f8 Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Wed, 14 Jun 2017 14:06:18 +0200 Subject: [PATCH] protocol: allow user to disable warning about old style links --- lisp/org-protocol.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el index 825435674..2eb1094e9 100644 --- a/lisp/org-protocol.el +++ b/lisp/org-protocol.el @@ -271,6 +271,12 @@ This should be a single regexp string." :package-version '(Org . "8.0") :type 'string) +(defcustom org-protocol-warn-about-old-links t + "If non-nil (the default), issue a warning when org protocol +receives old style links." + :group 'org-protocol + :type 'boolean) + ;;; Helper functions: (defun org-protocol-sanitize-uri (uri) @@ -618,8 +624,9 @@ CLIENT is ignored." (if new-style (funcall func (org-protocol-parse-parameters result new-style)) - (warn "Please update your Org Protocol handler \ -to deal with new-style links.") + (when org-protocol-warn-about-old-links + (warn "Please update your Org Protocol handler \ +to deal with new-style links.")) (funcall func result)))) ;; Greedy protocol handlers are responsible for ;; parsing their own filenames. -- 2.13.1 --=-=-=--