emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] protocol: allow users to disable warning about old style links
@ 2017-06-14 12:11 Alex Branham
  2017-06-16  6:13 ` Nicolas Goaziou
  0 siblings, 1 reply; 11+ messages in thread
From: Alex Branham @ 2017-06-14 12:11 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1654 bytes --]

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 <branham@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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-protocol-allow-user-to-disable-warning-about-old-sty.patch --]
[-- Type: text/x-diff, Size: 1348 bytes --]

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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-06-21 17:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-14 12:11 [PATCH] protocol: allow users to disable warning about old style links Alex Branham
2017-06-16  6:13 ` Nicolas Goaziou
2017-06-16 11:31   ` Alex Branham
2017-06-16 14:26     ` Nicolas Goaziou
2017-06-21 15:27   ` Tyler Smith
2017-06-21 16:01     ` Mario Martelli
2017-06-21 16:24       ` Tyler Smith
2017-06-21 16:34         ` Tyler Smith
2017-06-21 16:51         ` Mario Martelli
2017-06-21 17:09           ` Tyler Smith
2017-06-21 17:17             ` Mario Martelli

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