From: Ihor Radchenko <yantar92@posteo.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 74467@debbugs.gnu.org, Alexey Lebedeff <binarin@binarin.info>
Subject: bug#74467: 31.0.50; org-protocol emacsclient.desktop change is not fully functional
Date: Mon, 16 Dec 2024 19:34:01 +0000 [thread overview]
Message-ID: <87ed27cthy.fsf@localhost> (raw)
In-Reply-To: <86seriksak.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 648 bytes --]
Eli Zaretskii <eliz@gnu.org> writes:
>> One solution would be introducing separate .desktop file
>> (i.e. 'etc/emacsclient-org-protocol.desktop'), analoguous to the already
>> existing 'etc/emacsclient-mail.desktop' (which uses '%u').
>
> Ihor, could you please look into this?
I am attaching an *untested* patch that implements a new .desktop file.
Note that an alternative could be handling file:// URIs by Emacs. Your call.
> (Each time such issues pop up, I regret again that we agreed to
> include these *.desktop files in our source tree, sigh.)
We are obliged to cooperate with other parts of GNU toolchain, don't we?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-etc-emacsclient.desktop-Fix-handling-org-protocol-UR.patch --]
[-- Type: text/x-patch, Size: 2416 bytes --]
From 1b5148c8a7fe995adcfae302e48a87a039eed8a8 Mon Sep 17 00:00:00 2001
Message-ID: <1b5148c8a7fe995adcfae302e48a87a039eed8a8.1734377491.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Mon, 16 Dec 2024 20:28:28 +0100
Subject: [PATCH] etc/emacsclient.desktop: Fix handling org-protocol URIs
(bug#74467)
* etc/emacsclient-org-protocol.desktop: New file registering
x-scheme-handler/org-protocol URI handler. This has to be a separate
file because new versions of xdg-utils demand using %u or %U in order to
open URIs.
* etc/emacsclient.desktop: Remove x-scheme-handler/org-protocol from
MimeType. It does not have any effect in the newer xdg-utils.
---
etc/emacsclient-org-protocol.desktop | 13 +++++++++++++
etc/emacsclient.desktop | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
create mode 100644 etc/emacsclient-org-protocol.desktop
diff --git a/etc/emacsclient-org-protocol.desktop b/etc/emacsclient-org-protocol.desktop
new file mode 100644
index 00000000000..92cde0e7130
--- /dev/null
+++ b/etc/emacsclient-org-protocol.desktop
@@ -0,0 +1,13 @@
+[Desktop Entry]
+Name=Emacs (Client)
+GenericName=Text Editor
+Comment=Handle Org protocol URI
+MimeType=x-scheme-handler/org-protocol;
+Exec=sh -c "exec emacsclient --alternate-editor= --create-frame" sh %u
+Icon=emacs
+Type=Application
+Terminal=false
+Categories=Development;TextEditor;
+StartupNotify=true
+StartupWMClass=Emacs
+Keywords=emacsclient;org-protocol
\ No newline at end of file
diff --git a/etc/emacsclient.desktop b/etc/emacsclient.desktop
index 4395d3b02bc..a9f840c7033 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++;x-scheme-handler/org-protocol;
+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++;
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.47.1
[-- Attachment #3: Type: text/plain, Size: 223 bytes --]
--
Ihor Radchenko // yantar92,
Org mode maintainer,
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>
next prev parent reply other threads:[~2024-12-16 19:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-21 18:53 bug#74467: 31.0.50; org-protocol emacsclient.desktop change is not fully functional Alexey Lebedeff via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-23 13:12 ` Eli Zaretskii
2024-11-23 19:58 ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-07 12:17 ` Eli Zaretskii
2024-12-16 19:34 ` Ihor Radchenko [this message]
2024-12-16 20:01 ` Eli Zaretskii
2024-12-16 21:07 ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
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.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ed27cthy.fsf@localhost \
--to=yantar92@posteo.net \
--cc=74467@debbugs.gnu.org \
--cc=binarin@binarin.info \
--cc=eliz@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.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).