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 <bran...@utexas.edu> 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
>From 8bfc951308324de8e455128950193c046691f1f8 Mon Sep 17 00:00:00 2001 From: Alex Branham <bran...@utexas.edu> 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