emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Robert <robert@robewald.de>
To: emacs-orgmode@gnu.org
Cc: Robert <robert@robewald.de>
Subject: [PATCH] org-protocol: Make org protocol defaults work on windows
Date: Fri, 20 Nov 2020 17:26:29 +0100	[thread overview]
Message-ID: <A2B0655F-BF28-4943-BC05-99021BFDA1B3@robewald.de> (raw)

[-- 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


             reply	other threads:[~2020-11-21  6:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 16:26 Robert [this message]
2020-11-25  6:18 ` [PATCH] org-protocol: Make org protocol defaults work on windows Kyle Meyer
2021-03-28 17:02 ` Maxim Nikulin
2021-05-01 10:15   ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A2B0655F-BF28-4943-BC05-99021BFDA1B3@robewald.de \
    --to=robert@robewald.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).