Subject: bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol

From: Ihor Radchenko <[email-masked]>
Date: Wed, 23 Aug 2023 09:30:38 +0000

Tags: patch

Hi,

Org mode provides a way to quickly capture bookmarks, notes, and links
using emacsclient:

emacsclient "org-protocol://store-link?url=URL&title=TITLE"

Also, see https://orgmode.org/manual/Protocols.html

However, this can only be done via command line by default.
Not DE integration is available and users have to write their own
.desktop files specifically to allow, for example browser bookmarklet
running Emacs + org-protocol.

Would it make sense to add x-scheme-handler/org-protocol handler to the
default Emacsclient desktop file?

In GNU Emacs 30.0.50 (build 54, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.17.8) of 2023-08-22 built on localhost
Repository revision: c09d78f3c0818d7391760e84f94a442e8beb22dd
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
System Description: Gentoo Linux

Configured using:
 'configure --with-native-compilation
 JAVAC=/etc/java-config-2/current-system-vm/bin/javac'

>From 77e17eb6adf744a2b9565ca6f434fd6d488e84b0 Mon Sep 17 00:00:00 2001
Message-ID: <[email-masked]>
From: Ihor Radchenko <[email-masked]>
Date: Wed, 23 Aug 2023 12:24:18 +0300
Subject: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for
 org-protocol

---
 etc/emacsclient.desktop | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/etc/emacsclient.desktop b/etc/emacsclient.desktop
index a9f840c7033..4395d3b02bc 100644
--- a/etc/emacsclient.desktop
+++ b/etc/emacsclient.desktop
@@ -2,7 +2,7 @@
 Name=Emacs (Client)
 GenericName=Text Editor
 Comment=Edit text
-MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
+MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;x-scheme-handler/org-protocol;
 Exec=sh -c "if [ -n \\"\\$*\\" ]; then exec emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" \\"\\$@\\"; else exec emacsclient --alternate-editor= --create-frame; fi" sh %F
 Icon=emacs
 Type=Application
-- 
2.41.0

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>