emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-protocol: Make org protocol defaults work on windows
@ 2020-11-20 16:26 Robert
  2020-11-25  6:18 ` Kyle Meyer
  2021-03-28 17:02 ` Maxim Nikulin
  0 siblings, 2 replies; 4+ messages in thread
From: Robert @ 2020-11-20 16:26 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Robert

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

Hei,

Attached a little patch to make the default org-protocol handlers work on windows.

Tested with Windows 10 and emacs 27.1

Best Regards

Robert


[-- Attachment #2: 0001-org-protocol-Make-org-protocol-defaults-work-on-wind.patch --]
[-- Type: application/octet-stream, Size: 1903 bytes --]

From 40257be885a73bc055195c52d2acd354ce2ba0f9 Mon Sep 17 00:00:00 2001
From: Robert Ewald <roew@iris.no>
Date: Fri, 20 Nov 2020 15:52:00 +0100
Subject: [PATCH] org-protocol: Make org protocol defaults work on windows

* org-protocol (org-protocol-protocol-alist-default): Make default org-protocol
handlers work on windows

Windows inserts a slash in the protocol handler. By defining these
protocols with a trailing slash we are able to handle this case.

TINYCHANGE
---
 lisp/org-protocol.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 4bc7cee31..5b6862b78 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -138,10 +138,15 @@ for `org-protocol-the-protocol' and sub-protocols defined in
 
 ;;; Variables:
 
+;; Windows inserts a slash in the protocol handler. Handle this case with the constants
+
 (defconst org-protocol-protocol-alist-default
-  '(("org-capture"     :protocol "capture"     :function org-protocol-capture  :kill-client t)
-    ("org-store-link"  :protocol "store-link"  :function org-protocol-store-link)
-    ("org-open-source" :protocol "open-source" :function org-protocol-open-source))
+  '(("org-capture"     :protocol "capture/"     :function org-protocol-capture  :kill-client t)
+    ("org-capture"     :protocol "capture"      :function org-protocol-capture  :kill-client t)
+    ("org-store-link"  :protocol "store-link/"  :function org-protocol-store-link)
+    ("org-store-link"  :protocol "store-link"   :function org-protocol-store-link)
+    ("org-open-source" :protocol "open-source/" :function org-protocol-open-source)
+    ("org-open-source" :protocol "open-source"  :function org-protocol-open-source))
   "Default protocols to use.
 See `org-protocol-protocol-alist' for a description of this variable.")
 
-- 
2.29.2


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

end of thread, other threads:[~2021-05-01 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-20 16:26 [PATCH] org-protocol: Make org protocol defaults work on windows Robert
2020-11-25  6:18 ` Kyle Meyer
2021-03-28 17:02 ` Maxim Nikulin
2021-05-01 10:15   ` Bastien

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).