all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
@ 2023-08-23  9:30 Ihor Radchenko
  2023-08-23 22:39 ` Stefan Kangas
  0 siblings, 1 reply; 45+ messages in thread
From: Ihor Radchenko @ 2023-08-23  9:30 UTC (permalink / raw)
  To: 65469

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

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'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-etc-emacsclient.desktop-Make-Emacs-default-applicati.patch --]
[-- Type: text/patch, Size: 1334 bytes --]

From 77e17eb6adf744a2b9565ca6f434fd6d488e84b0 Mon Sep 17 00:00:00 2001
Message-ID: <77e17eb6adf744a2b9565ca6f434fd6d488e84b0.1692782734.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
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


[-- Attachment #3: Type: text/plain, Size: 224 bytes --]


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

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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-08-23  9:30 bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol Ihor Radchenko
@ 2023-08-23 22:39 ` Stefan Kangas
  2023-09-01 18:50   ` Stefan Kangas
  0 siblings, 1 reply; 45+ messages in thread
From: Stefan Kangas @ 2023-08-23 22:39 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: 65469

Ihor Radchenko <yantar92@posteo.net> writes:

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

I think it makes sense, yes.  I guess not a lot of other things try to
register "org-protocol" handlers besides Emacs, and in any case this
would make some users' lives easier.  So I don't see any drawbacks.





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-08-23 22:39 ` Stefan Kangas
@ 2023-09-01 18:50   ` Stefan Kangas
  2023-09-17 13:09     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 45+ messages in thread
From: Stefan Kangas @ 2023-09-01 18:50 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: 65469-done

Version: 30.1

> I think it makes sense, yes.  I guess not a lot of other things try to
> register "org-protocol" handlers besides Emacs, and in any case this
> would make some users' lives easier.  So I don't see any drawbacks.

Pushed to master, thanks.





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-01 18:50   ` Stefan Kangas
@ 2023-09-17 13:09     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-17 13:16       ` Stefan Kangas
  0 siblings, 1 reply; 45+ messages in thread
From: Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-17 13:09 UTC (permalink / raw)
  To: 65469; +Cc: yantar92, stefankangas

Stefan Kangas <stefankangas@gmail.com> writes:

> Version: 30.1
>
>> I think it makes sense, yes.  I guess not a lot of other things try
>> to
>> register "org-protocol" handlers besides Emacs, and in any case this
>> would make some users' lives easier.  So I don't see any drawbacks.
>
> Pushed to master, thanks.

Would it make sense to apply the patch to Emacs 29.1 too? Org-protocol
is already supported and some user package extra desktop files because
of it.





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-17 13:09     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-17 13:16       ` Stefan Kangas
  2023-09-17 14:18         ` Eli Zaretskii
  2023-09-18  8:30         ` Ihor Radchenko
  0 siblings, 2 replies; 45+ messages in thread
From: Stefan Kangas @ 2023-09-17 13:16 UTC (permalink / raw)
  To: Björn Bidar, 65469; +Cc: yantar92

Björn Bidar <bjorn.bidar@thaodan.de> writes:

> Would it make sense to apply the patch to Emacs 29.1 too? Org-protocol
> is already supported and some user package extra desktop files because
> of it.

I'm not sure, since the issue is not new.  Eli, WDYT?

BTW, Ihor, could we have a NEWS item for this change please?
I forgot to ask for one before.





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-17 13:16       ` Stefan Kangas
@ 2023-09-17 14:18         ` Eli Zaretskii
  2023-09-17 14:31           ` Stefan Kangas
  2023-09-18  8:30         ` Ihor Radchenko
  1 sibling, 1 reply; 45+ messages in thread
From: Eli Zaretskii @ 2023-09-17 14:18 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: bjorn.bidar, yantar92, 65469

> Cc: yantar92@posteo.net
> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Sun, 17 Sep 2023 06:16:08 -0700
> 
> Björn Bidar <bjorn.bidar@thaodan.de> writes:
> 
> > Would it make sense to apply the patch to Emacs 29.1 too? Org-protocol
> > is already supported and some user package extra desktop files because
> > of it.
> 
> I'm not sure, since the issue is not new.  Eli, WDYT?

If it's safe, I don't mind.





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-17 14:18         ` Eli Zaretskii
@ 2023-09-17 14:31           ` Stefan Kangas
  0 siblings, 0 replies; 45+ messages in thread
From: Stefan Kangas @ 2023-09-17 14:31 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: bjorn.bidar, yantar92, 65469

fixed 65469 30.1
reopen 65469
thanks

Eli Zaretskii <eliz@gnu.org> writes:

> If it's safe, I don't mind.

I think it's safe, but I'll wait for a NEWS item from Ihor before
cherry-picking it.  The NEWS item should be for Emacs 29.2.





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-17 13:16       ` Stefan Kangas
  2023-09-17 14:18         ` Eli Zaretskii
@ 2023-09-18  8:30         ` Ihor Radchenko
  2023-09-18 11:02           ` Stefan Kangas
  2023-09-18 11:15           ` Eli Zaretskii
  1 sibling, 2 replies; 45+ messages in thread
From: Ihor Radchenko @ 2023-09-18  8:30 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Björn Bidar, 65469

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

Stefan Kangas <stefankangas@gmail.com> writes:

> BTW, Ihor, could we have a NEWS item for this change please?
> I forgot to ask for one before.

Sure.
See the attached.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-etc-NEWS-Document-handling-org-protocol-URI-scheme-b.patch --]
[-- Type: text/x-patch, Size: 1398 bytes --]

From 11531beda02f89517c660f0b44375d301fbf86dc Mon Sep 17 00:00:00 2001
Message-ID: <11531beda02f89517c660f0b44375d301fbf86dc.1695025691.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Mon, 18 Sep 2023 11:26:27 +0300
Subject: [PATCH] * etc/NEWS: Document handling 'org-protocol' URI scheme
 (bug#65469)

The commit implementing the new functionality is 05a7c91b91c.
---
 etc/NEWS | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index f9ebe312612..0d6be3ed2d9 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -55,6 +55,20 @@ ALSA on these operating systems instead.
 For native compiled Lisp functions 'describe-function' prints (after
 the signature) the automatically inferred function type as well.
 
+** Emacs is now the default application for 'org-protocol' URI scheme
+
+Org mode provides a way to quickly capture bookmarks, notes, and links
+using 'emacsclient':
+
+    emacsclient "org-protocol://store-link?url=URL&title=TITLE"
+
+Previously, users had to manually setup their Linux desktop
+environment to open 'org-protocol' links in Emacs.  Now, these links
+should be open in Emacs automatically.
+
+See "(org) Protocols for External Access" node in Org mode manual for
+more details.
+
 ---
 ** New user option 'describe-bindings-outline-rules'.
 This user option controls outline visibility in the output buffer of
-- 
2.42.0


[-- Attachment #3: Type: text/plain, Size: 225 bytes --]



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

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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-18  8:30         ` Ihor Radchenko
@ 2023-09-18 11:02           ` Stefan Kangas
  2023-09-18 11:15           ` Eli Zaretskii
  1 sibling, 0 replies; 45+ messages in thread
From: Stefan Kangas @ 2023-09-18 11:02 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Björn Bidar, 65469

reopen 65469
close 65469 29.1
thanks

Ihor Radchenko <yantar92@posteo.net> writes:

> Stefan Kangas <stefankangas@gmail.com> writes:
>
>> BTW, Ihor, could we have a NEWS item for this change please?
>> I forgot to ask for one before.
>
> Sure.
> See the attached.

Thanks, I installed this with some light edits on emacs-29 (commit
5611274bbda).  I also cherry-picked commit 05a7c91b91c.





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-18  8:30         ` Ihor Radchenko
  2023-09-18 11:02           ` Stefan Kangas
@ 2023-09-18 11:15           ` Eli Zaretskii
  2023-09-18 11:18             ` Stefan Kangas
  2023-09-18 13:00             ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 2 replies; 45+ messages in thread
From: Eli Zaretskii @ 2023-09-18 11:15 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: bjorn.bidar, stefankangas, 65469

> Cc: Björn Bidar <bjorn.bidar@thaodan.de>,
>  65469@debbugs.gnu.org
> From: Ihor Radchenko <yantar92@posteo.net>
> Date: Mon, 18 Sep 2023 08:30:03 +0000
> 
> +** Emacs is now the default application for 'org-protocol' URI scheme
> +
> +Org mode provides a way to quickly capture bookmarks, notes, and links
> +using 'emacsclient':
> +
> +    emacsclient "org-protocol://store-link?url=URL&title=TITLE"
> +
> +Previously, users had to manually setup their Linux desktop
> +environment to open 'org-protocol' links in Emacs.  Now, these links
> +should be open in Emacs automatically.
> +
> +See "(org) Protocols for External Access" node in Org mode manual for
> +more details.

Thanks.  I needed to fix this slightly, to make it clear that this is
limited to GNU/Linux desktops.





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-18 11:15           ` Eli Zaretskii
@ 2023-09-18 11:18             ` Stefan Kangas
  2023-09-18 13:00             ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 45+ messages in thread
From: Stefan Kangas @ 2023-09-18 11:18 UTC (permalink / raw)
  To: Eli Zaretskii, Ihor Radchenko; +Cc: bjorn.bidar, 65469

Eli Zaretskii <eliz@gnu.org> writes:

> Thanks.  I needed to fix this slightly, to make it clear that this is
> limited to GNU/Linux desktops.

Looks great, thanks.





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-18 11:15           ` Eli Zaretskii
  2023-09-18 11:18             ` Stefan Kangas
@ 2023-09-18 13:00             ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-18 13:20               ` Ihor Radchenko
  2023-09-18 14:33               ` bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol Eli Zaretskii
  1 sibling, 2 replies; 45+ messages in thread
From: Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-18 13:00 UTC (permalink / raw)
  To: eliz, yantar92; +Cc: 65469, stefankangas

On Monday, 18 September 2023, Eli Zaretskii wrote:
> > Cc: Björn Bidar <bjorn.bidar@thaodan.de>,
> >  65469@debbugs.gnu.org
> > From: Ihor Radchenko <yantar92@posteo.net>
> > Date: Mon, 18 Sep 2023 08:30:03 +0000
> > 
> > +** Emacs is now the default application for 'org-protocol' URI scheme
> > +
> > +Org mode provides a way to quickly capture bookmarks, notes, and links
> > +using 'emacsclient':
> > +
> > +    emacsclient "org-protocol://store-link?url=URL&title=TITLE"
> > +
> > +Previously, users had to manually setup their Linux desktop
> > +environment to open 'org-protocol' links in Emacs.  Now, these links
> > +should be open in Emacs automatically.
> > +
> > +See "(org) Protocols for External Access" node in Org mode manual for
> > +more details.
> 
> Thanks.  I needed to fix this slightly, to make it clear that this is
> limited to GNU/Linux desktops.
>

It applies to all operating system that use desktop environments that  comply with XDG so for example also BSD.

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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-18 13:00             ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-18 13:20               ` Ihor Radchenko
  2023-09-18 13:32                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-18 14:33               ` bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol Eli Zaretskii
  1 sibling, 1 reply; 45+ messages in thread
From: Ihor Radchenko @ 2023-09-18 13:20 UTC (permalink / raw)
  To: Björn Bidar; +Cc: Po Lu, 65469, eliz, stefankangas

Björn Bidar <bjorn.bidar@thaodan.de> writes:

>> Thanks.  I needed to fix this slightly, to make it clear that this is
>> limited to GNU/Linux desktops.
>
> It applies to all operating system that use desktop environments that  comply with XDG so for example also BSD.

I am also wondering is something similar might be done for Android build.
Having something like "Share with ... Emacs" might be an interesting
feature.

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





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-18 13:20               ` Ihor Radchenko
@ 2023-09-18 13:32                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-19 11:14                   ` Generic Elisp mechanism to declare file/URI handlers for Emacs (was: bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol) Ihor Radchenko
  0 siblings, 1 reply; 45+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-18 13:32 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Björn Bidar, eliz, stefankangas, 65469

Ihor Radchenko <yantar92@posteo.net> writes:

> Björn Bidar <bjorn.bidar@thaodan.de> writes:
>
>>> Thanks.  I needed to fix this slightly, to make it clear that this is
>>> limited to GNU/Linux desktops.
>>
>> It applies to all operating system that use desktop environments that  comply with XDG so for example also BSD.
>
> I am also wondering is something similar might be done for Android build.
> Having something like "Share with ... Emacs" might be an interesting
> feature.

I wrote this feature back in August, immediately upon this patch's
installation in master.  Emacs registers itself as a URL handler for
``org-protocol://'' links, which are then provided to emacsclient.





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-18 13:00             ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-18 13:20               ` Ihor Radchenko
@ 2023-09-18 14:33               ` Eli Zaretskii
  2023-09-18 23:04                 ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 45+ messages in thread
From: Eli Zaretskii @ 2023-09-18 14:33 UTC (permalink / raw)
  To: Björn Bidar; +Cc: 65469, yantar92, stefankangas

> Cc: 65469@debbugs.gnu.org,stefankangas@gmail.com
> From: Björn Bidar <bjorn.bidar@thaodan.de>
> Date: Mon, 18 Sep 2023 13:00:52 +0000
> 
> On Monday, 18 September 2023, Eli Zaretskii wrote:
> > > Cc: Björn Bidar <bjorn.bidar@thaodan.de>,
> > >  65469@debbugs.gnu.org
> > > From: Ihor Radchenko <yantar92@posteo.net>
> > > Date: Mon, 18 Sep 2023 08:30:03 +0000
> > > 
> > > +** Emacs is now the default application for 'org-protocol' URI scheme
> > > +
> > > +Org mode provides a way to quickly capture bookmarks, notes, and links
> > > +using 'emacsclient':
> > > +
> > > +    emacsclient "org-protocol://store-link?url=URL&title=TITLE"
> > > +
> > > +Previously, users had to manually setup their Linux desktop
> > > +environment to open 'org-protocol' links in Emacs.  Now, these links
> > > +should be open in Emacs automatically.
> > > +
> > > +See "(org) Protocols for External Access" node in Org mode manual for
> > > +more details.
> > 
> > Thanks.  I needed to fix this slightly, to make it clear that this is
> > limited to GNU/Linux desktops.
> >
> 
> It applies to all operating system that use desktop environments that  comply with XDG so for example also BSD.

Only XDG-compliant desktops? nothing else?





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-18 14:33               ` bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol Eli Zaretskii
@ 2023-09-18 23:04                 ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-19  2:31                   ` Eli Zaretskii
  0 siblings, 1 reply; 45+ messages in thread
From: Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-18 23:04 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 65469, yantar92, stefankangas

Eli Zaretskii <eliz@gnu.org> writes:

>> It applies to all operating system that use desktop environments
>> that comply with XDG so for example also BSD.
>
> Only XDG-compliant desktops? nothing else?

Well only those that handle xdg desktop files specific uri type
handlers e.g. Gnome, KDE, Xfce etc.

Not sure if there's something such as "fully XDG-compliant".

My phrasing only intended to explain that in theory any operating system
that uses xdg compliant desktop environments works with the change, not
just GNU/QT/GTK/KDE/GNOME Linux.






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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-18 23:04                 ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-19  2:31                   ` Eli Zaretskii
  2023-09-19  7:59                     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 45+ messages in thread
From: Eli Zaretskii @ 2023-09-19  2:31 UTC (permalink / raw)
  To: Björn Bidar; +Cc: 65469, yantar92, stefankangas

> From: Björn Bidar <bjorn.bidar@thaodan.de>
> Cc: yantar92@posteo.net,  65469@debbugs.gnu.org, stefankangas@gmail.com
> Date: Tue, 19 Sep 2023 02:04:52 +0300
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> It applies to all operating system that use desktop environments
> >> that comply with XDG so for example also BSD.
> >
> > Only XDG-compliant desktops? nothing else?
> 
> Well only those that handle xdg desktop files specific uri type
> handlers e.g. Gnome, KDE, Xfce etc.
> 
> Not sure if there's something such as "fully XDG-compliant".
> 
> My phrasing only intended to explain that in theory any operating system
> that uses xdg compliant desktop environments works with the change, not
> just GNU/QT/GTK/KDE/GNOME Linux.

Thanks, but I'm looking for wording that we should put in NEWS.  How
would you categorize the systems which can support these desktop files
in words that will be understood by readers of NEWS?





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-19  2:31                   ` Eli Zaretskii
@ 2023-09-19  7:59                     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-19 11:06                       ` Eli Zaretskii
  0 siblings, 1 reply; 45+ messages in thread
From: Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-19  7:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 65469, yantar92, stefankangas

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Björn Bidar <bjorn.bidar@thaodan.de>
>> Cc: yantar92@posteo.net, 65469@debbugs.gnu.org,
>> stefankangas@gmail.com
>> Date: Tue, 19 Sep 2023 02:04:52 +0300
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> It applies to all operating system that use desktop environments
>> >> that comply with XDG so for example also BSD.
>> >
>> > Only XDG-compliant desktops? nothing else?
>> 
>> Well only those that handle xdg desktop files specific uri type
>> handlers e.g. Gnome, KDE, Xfce etc.
>> 
>> Not sure if there's something such as "fully XDG-compliant".
>>
>> My phrasing only intended to explain that in theory any operating
>> system
>> that uses xdg compliant desktop environments works with the change,
>> not
>> just GNU/QT/GTK/KDE/GNOME Linux.
>
> Thanks, but I'm looking for wording that we should put in NEWS.  How
> would you categorize the systems which can support these desktop files
> in words that will be understood by readers of NEWS?

What about Unix and Unix-like systems excluding macOS?





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-19  7:59                     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-19 11:06                       ` Eli Zaretskii
  2023-09-19 11:21                         ` Ihor Radchenko
  0 siblings, 1 reply; 45+ messages in thread
From: Eli Zaretskii @ 2023-09-19 11:06 UTC (permalink / raw)
  To: Björn Bidar; +Cc: 65469, yantar92, stefankangas

> From: Björn Bidar <bjorn.bidar@thaodan.de>
> Cc: yantar92@posteo.net,  65469@debbugs.gnu.org,  stefankangas@gmail.com
> Date: Tue, 19 Sep 2023 10:59:41 +0300
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: Björn Bidar <bjorn.bidar@thaodan.de>
> >> Cc: yantar92@posteo.net, 65469@debbugs.gnu.org,
> >> stefankangas@gmail.com
> >> Date: Tue, 19 Sep 2023 02:04:52 +0300
> >> 
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >> 
> >> >> It applies to all operating system that use desktop environments
> >> >> that comply with XDG so for example also BSD.
> >> >
> >> > Only XDG-compliant desktops? nothing else?
> >> 
> >> Well only those that handle xdg desktop files specific uri type
> >> handlers e.g. Gnome, KDE, Xfce etc.
> >> 
> >> Not sure if there's something such as "fully XDG-compliant".
> >>
> >> My phrasing only intended to explain that in theory any operating
> >> system
> >> that uses xdg compliant desktop environments works with the change,
> >> not
> >> just GNU/QT/GTK/KDE/GNOME Linux.
> >
> > Thanks, but I'm looking for wording that we should put in NEWS.  How
> > would you categorize the systems which can support these desktop files
> > in words that will be understood by readers of NEWS?
> 
> What about Unix and Unix-like systems excluding macOS?

That sounds too general, I think.

Let me turn the table and ask you: where are those desktop files,
their format and contents described?  If there's some standard
document where they are documented, can you point me to that
document?





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

* Generic Elisp mechanism to declare file/URI handlers for Emacs (was: bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol)
  2023-09-18 13:32                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-19 11:14                   ` Ihor Radchenko
  2023-09-19 11:44                     ` Generic Elisp mechanism to declare file/URI handlers for Emacs Po Lu
  2023-09-19 16:28                     ` Generic Elisp mechanism to declare file/URI handlers for Emacs (was: bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol) Jim Porter
  0 siblings, 2 replies; 45+ messages in thread
From: Ihor Radchenko @ 2023-09-19 11:14 UTC (permalink / raw)
  To: Po Lu; +Cc: Björn Bidar, eliz, stefankangas, emacs-devel

[ moving to emacs-devel ]

Po Lu <luangruo@yahoo.com> writes:

>> I am also wondering is something similar might be done for Android build.
>> Having something like "Share with ... Emacs" might be an interesting
>> feature.
>
> I wrote this feature back in August, immediately upon this patch's
> installation in master.  Emacs registers itself as a URL handler for
> ``org-protocol://'' links, which are then provided to emacsclient.

Thanks!

Apparently, Android builds have to implement handlers in the source code
directly. This makes adding new handlers for Emacs non-trivial - one
needs to know both about .desktop file and also about Android-specific
code (and what about MacOS-specific and Windows-specific?).

Would it make sense to create a more generic mechanism to collect a list
of handlers from all the Elisp sources in Emacs and then generate
Linux/Android/etc-specific definitions automatically when Emacs is
compiled?

I imagine something akin how ;;;###autoload works - Elisp libraries that
implement handling of certain file types or URI protocols declare this
fact and then Emacs automatically pick this info, generating .desktop
files and relevant parts of Andoid
(java/org/gnu/emacs/EmacsOpenActivity.java) and whatever else necessary.

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



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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-19 11:06                       ` Eli Zaretskii
@ 2023-09-19 11:21                         ` Ihor Radchenko
  2023-09-19 12:24                           ` Eli Zaretskii
  0 siblings, 1 reply; 45+ messages in thread
From: Ihor Radchenko @ 2023-09-19 11:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Björn Bidar, stefankangas, 65469

Eli Zaretskii <eliz@gnu.org> writes:

>> >> >> It applies to all operating system that use desktop environments
>> >> >> that comply with XDG so for example also BSD.
>> >> >
>> >> > Only XDG-compliant desktops? nothing else?
> ...
> Let me turn the table and ask you: where are those desktop files,
> their format and contents described?  If there's some standard
> document where they are documented, can you point me to that
> document?

desktop files are defined in XDG spec. See
https://www.freedesktop.org/wiki/Specifications/ and
https://www.freedesktop.org/wiki/Specifications/desktop-entry-spec/

So, .desktop files are understood by XDG-compiant desktops and apps. Now
every desktop environment on GNU/Linux actually supports these specs.
Gnome and KDE do. Some others also do. Otherwise, one needs to install
xdg-utils or similar package manually.

Also, a number of applications, expect xdg-open executable to be
available on GNU/Linux systems as a generic way to open files using
"right" application. Including Emacs itself - see
`browse-url-can-use-xdg-open', for example.

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





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

* Re: Generic Elisp mechanism to declare file/URI handlers for Emacs
  2023-09-19 11:14                   ` Generic Elisp mechanism to declare file/URI handlers for Emacs (was: bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol) Ihor Radchenko
@ 2023-09-19 11:44                     ` Po Lu
  2023-09-19 13:06                       ` Ihor Radchenko
  2023-09-19 16:28                     ` Generic Elisp mechanism to declare file/URI handlers for Emacs (was: bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol) Jim Porter
  1 sibling, 1 reply; 45+ messages in thread
From: Po Lu @ 2023-09-19 11:44 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Björn Bidar, eliz, stefankangas, emacs-devel

Ihor Radchenko <yantar92@posteo.net> writes:

> Apparently, Android builds have to implement handlers in the source code
> directly. This makes adding new handlers for Emacs non-trivial - one
> needs to know both about .desktop file and also about Android-specific
> code (and what about MacOS-specific and Windows-specific?).

Introducing a handler for a new URL scheme only requires the
introduction of a single line of Java:

  uri.getScheme ().equals ("your-protocol")

and one line of XML in AndroidManifest.xml:

        <data android:scheme="your-protocol"/>

Much easier than introducing handlers into .desktop files, which present
potential authors with a litany of pedantic rules to be followed.

> Would it make sense to create a more generic mechanism to collect a list
> of handlers from all the Elisp sources in Emacs and then generate
> Linux/Android/etc-specific definitions automatically when Emacs is
> compiled?

That's overengineering.  What in Emacs, save for org-protocol, defines
such URL handlers?  And are they particular to Emacs to the same extent
that org-protocol is, justifying Emacs's placement within the ``Open
With'' dialog on my phone?



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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-19 11:21                         ` Ihor Radchenko
@ 2023-09-19 12:24                           ` Eli Zaretskii
  2023-09-19 13:16                             ` Ihor Radchenko
  0 siblings, 1 reply; 45+ messages in thread
From: Eli Zaretskii @ 2023-09-19 12:24 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: bjorn.bidar, stefankangas, 65469

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: Björn Bidar <bjorn.bidar@thaodan.de>,
>  65469@debbugs.gnu.org,
>  stefankangas@gmail.com
> Date: Tue, 19 Sep 2023 11:21:43 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Let me turn the table and ask you: where are those desktop files,
> > their format and contents described?  If there's some standard
> > document where they are documented, can you point me to that
> > document?
> 
> desktop files are defined in XDG spec. See
> https://www.freedesktop.org/wiki/Specifications/ and
> https://www.freedesktop.org/wiki/Specifications/desktop-entry-spec/
> 
> So, .desktop files are understood by XDG-compiant desktops and apps. Now
> every desktop environment on GNU/Linux actually supports these specs.
> Gnome and KDE do. Some others also do. Otherwise, one needs to install
> xdg-utils or similar package manually.

Then why my suggestion up-thread, viz.:

>> It applies to all operating system that use desktop environments
>> that comply with XDG so for example also BSD.
>
> Only XDG-compliant desktops? nothing else?

was rejected?  The reasons given at the time were:

  Well only those that handle xdg desktop files specific uri type
  handlers e.g. Gnome, KDE, Xfce etc.

  Not sure if there's something such as "fully XDG-compliant".

  My phrasing only intended to explain that in theory any operating system
  that uses xdg compliant desktop environments works with the change, not
  just GNU/QT/GTK/KDE/GNOME Linux.

Specifically, with the following wording be accurate and clear?

  ** On capable systems, Emacs is now the default application for 'org-protocol'.
  Org mode provides a way to quickly capture bookmarks, notes, and links
  using 'emacsclient':

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

  Previously, users had to manually configure their desktop environment
  to open 'org-protocol' links in Emacs.  On any XDG-compliant system,
  including GNU/Linux and some others, these links should now open in
  Emacs automatically, as the "emacsclient.desktop" file now arranges
  for Emacs to be the default application for the 'org-protocol' URI
  scheme.  See the Org mode manual, Info node "(org) Protocols" for more
  details.

> Also, a number of applications, expect xdg-open executable to be
> available on GNU/Linux systems as a generic way to open files using
> "right" application. Including Emacs itself - see
> `browse-url-can-use-xdg-open', for example.

Is this related to the issue with org-protocol?





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

* Re: Generic Elisp mechanism to declare file/URI handlers for Emacs
  2023-09-19 11:44                     ` Generic Elisp mechanism to declare file/URI handlers for Emacs Po Lu
@ 2023-09-19 13:06                       ` Ihor Radchenko
  2023-09-19 13:25                         ` Po Lu
  2023-09-19 13:46                         ` Generic Elisp mechanism to declare file/URI handlers for Emacs Eli Zaretskii
  0 siblings, 2 replies; 45+ messages in thread
From: Ihor Radchenko @ 2023-09-19 13:06 UTC (permalink / raw)
  To: Po Lu; +Cc: Björn Bidar, eliz, stefankangas, emacs-devel

Po Lu <luangruo@yahoo.com> writes:

> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> Apparently, Android builds have to implement handlers in the source code
>> directly. This makes adding new handlers for Emacs non-trivial - one
>> needs to know both about .desktop file and also about Android-specific
>> code (and what about MacOS-specific and Windows-specific?).
>
> Introducing a handler for a new URL scheme only requires the
> introduction of a single line of Java:
> ...

I agree that it is not difficult. But it is very easy to miss
implementing a new scheme on _all_ the supported OSes. For example, I
have no idea if Emacs even provides something similar to .desktop file
on MacOS and Windows.

>> Would it make sense to create a more generic mechanism to collect a list
>> of handlers from all the Elisp sources in Emacs and then generate
>> Linux/Android/etc-specific definitions automatically when Emacs is
>> compiled?
>
> That's overengineering.  What in Emacs, save for org-protocol, defines
> such URL handlers?  And are they particular to Emacs to the same extent
> that org-protocol is, justifying Emacs's placement within the ``Open
> With'' dialog on my phone?

I mostly thought about file type handling.
Wouldn't it be nice to allow built-in major modes also make Emacs
register as application capable to open the corresponding file
type/extension.

For example, consider that we have built-in clojure-mode at some point.
Then, it will make sense to tell OS that Emacs is able to open .clj
files. Same for any other new major mode.

Not every major mode author knows the specific ways how Emacs implements
file type handling in different OSes.

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



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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-19 12:24                           ` Eli Zaretskii
@ 2023-09-19 13:16                             ` Ihor Radchenko
  2023-09-19 13:50                               ` Eli Zaretskii
  0 siblings, 1 reply; 45+ messages in thread
From: Ihor Radchenko @ 2023-09-19 13:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: bjorn.bidar, stefankangas, 65469

Eli Zaretskii <eliz@gnu.org> writes:

> Specifically, with the following wording be accurate and clear?
>
>   ** On capable systems, Emacs is now the default application for 'org-protocol'.
>   Org mode provides a way to quickly capture bookmarks, notes, and links
>   using 'emacsclient':
>
>       emacsclient "org-protocol://store-link?url=URL&title=TITLE"
>
>   Previously, users had to manually configure their desktop environment
>   to open 'org-protocol' links in Emacs.  On any XDG-compliant system,
>   including GNU/Linux and some others, these links should now open in
>   Emacs automatically, as the "emacsclient.desktop" file now arranges
>   for Emacs to be the default application for the 'org-protocol' URI
>   scheme.  See the Org mode manual, Info node "(org) Protocols" for more
>   details.

Sounds good to me. May also add about Android (Po Lu implemented the
relevant handler in d286f6889cf).

>> Also, a number of applications, expect xdg-open executable to be
>> available on GNU/Linux systems as a generic way to open files using
>> "right" application. Including Emacs itself - see
>> `browse-url-can-use-xdg-open', for example.
>
> Is this related to the issue with org-protocol?

Yes. For example, a browser bookmarklet like

     javascript:location.href='org-protocol://capture?' +
           new URLSearchParams({
                 template: 'x', url: window.location.href,
                 title: document.title, body: window.getSelection()});

will, by default, leverage xdg-open to handle org-protocol://... link
type. xdg-open consults mime-database, built using .desktop files
provided by installed applications.

With the discussed patch, e.g. Firefox will automatically use Emacs when
clicking on the above bookmarklet. Then, strictly speaking, it is not
necessary for the GNU/Linux system to be fully XDG-compiant. It will be
enough that (1) Emacs provides .desktop file; (2) Linux has xdg-open and
its dependencies installed; (3) Firefox makes use of xdg-open.

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





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

* Re: Generic Elisp mechanism to declare file/URI handlers for Emacs
  2023-09-19 13:06                       ` Ihor Radchenko
@ 2023-09-19 13:25                         ` Po Lu
  2023-09-20  9:26                           ` Ihor Radchenko
  2023-09-19 13:46                         ` Generic Elisp mechanism to declare file/URI handlers for Emacs Eli Zaretskii
  1 sibling, 1 reply; 45+ messages in thread
From: Po Lu @ 2023-09-19 13:25 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Björn Bidar, eliz, stefankangas, emacs-devel

Ihor Radchenko <yantar92@posteo.net> writes:

> I agree that it is not difficult. But it is very easy to miss
> implementing a new scheme on _all_ the supported OSes. For example, I
> have no idea if Emacs even provides something similar to .desktop file
> on MacOS and Windows.

It does not.

> I mostly thought about file type handling.
> Wouldn't it be nice to allow built-in major modes also make Emacs
> register as application capable to open the corresponding file
> type/extension.
>
> For example, consider that we have built-in clojure-mode at some point.
> Then, it will make sense to tell OS that Emacs is able to open .clj
> files. Same for any other new major mode.
>
> Not every major mode author knows the specific ways how Emacs implements
> file type handling in different OSes.

Emacs opens all text documents, and Clojure files are a kind of text
file.

And be that as it may, operating systems use different names to
designate each kind of text file, so expecting major mode authors to
understand every one of those names is unreasonable anyway.



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

* Re: Generic Elisp mechanism to declare file/URI handlers for Emacs
  2023-09-19 13:06                       ` Ihor Radchenko
  2023-09-19 13:25                         ` Po Lu
@ 2023-09-19 13:46                         ` Eli Zaretskii
  2023-09-19 13:56                           ` Ihor Radchenko
  1 sibling, 1 reply; 45+ messages in thread
From: Eli Zaretskii @ 2023-09-19 13:46 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: luangruo, bjorn.bidar, stefankangas, emacs-devel

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: Björn Bidar <bjorn.bidar@thaodan.de>, eliz@gnu.org,
>  stefankangas@gmail.com, emacs-devel@gnu.org
> Date: Tue, 19 Sep 2023 13:06:57 +0000
> 
> I agree that it is not difficult. But it is very easy to miss
> implementing a new scheme on _all_ the supported OSes. For example, I
> have no idea if Emacs even provides something similar to .desktop file
> on MacOS and Windows.

The "Open With" feature of the file managers on MS-Windows is not
determined by files like the XDG *.desktop files, it is determined by
system-wide "file-associations" that are modified by special commands
and/or settings offered by relevant applications.  (The associations
themselves are recorded in the Registry, of course.)  Emacs on
MS-Windows can thereafter make use of these associations via the
w32-shell-execute primitive.

So I don't see how we could offer something like that for Windows; we
learned long ago that including scripts or programs that write into
the Registry is a two-edged sword, so we refrain from doing that
nowadays.

> I mostly thought about file type handling.
> Wouldn't it be nice to allow built-in major modes also make Emacs
> register as application capable to open the corresponding file
> type/extension.

Most of this setup is not in Emacs at all, it is in the OS outside
Emacs and in other applications.  At least on MS-Windows.



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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-19 13:16                             ` Ihor Radchenko
@ 2023-09-19 13:50                               ` Eli Zaretskii
  2023-09-19 13:58                                 ` Ihor Radchenko
  0 siblings, 1 reply; 45+ messages in thread
From: Eli Zaretskii @ 2023-09-19 13:50 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: bjorn.bidar, stefankangas, 65469

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: bjorn.bidar@thaodan.de, 65469@debbugs.gnu.org, stefankangas@gmail.com
> Date: Tue, 19 Sep 2023 13:16:58 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Specifically, with the following wording be accurate and clear?
> >
> >   ** On capable systems, Emacs is now the default application for 'org-protocol'.
> >   Org mode provides a way to quickly capture bookmarks, notes, and links
> >   using 'emacsclient':
> >
> >       emacsclient "org-protocol://store-link?url=URL&title=TITLE"
> >
> >   Previously, users had to manually configure their desktop environment
> >   to open 'org-protocol' links in Emacs.  On any XDG-compliant system,
> >   including GNU/Linux and some others, these links should now open in
> >   Emacs automatically, as the "emacsclient.desktop" file now arranges
> >   for Emacs to be the default application for the 'org-protocol' URI
> >   scheme.  See the Org mode manual, Info node "(org) Protocols" for more
> >   details.
> 
> Sounds good to me. May also add about Android (Po Lu implemented the
> relevant handler in d286f6889cf).

Thanks, will do.

> >> Also, a number of applications, expect xdg-open executable to be
> >> available on GNU/Linux systems as a generic way to open files using
> >> "right" application. Including Emacs itself - see
> >> `browse-url-can-use-xdg-open', for example.
> >
> > Is this related to the issue with org-protocol?
> 
> Yes. For example, a browser bookmarklet like
> 
>      javascript:location.href='org-protocol://capture?' +
>            new URLSearchParams({
>                  template: 'x', url: window.location.href,
>                  title: document.title, body: window.getSelection()});
> 
> will, by default, leverage xdg-open to handle org-protocol://... link
> type. xdg-open consults mime-database, built using .desktop files
> provided by installed applications.
> 
> With the discussed patch, e.g. Firefox will automatically use Emacs when
> clicking on the above bookmarklet. Then, strictly speaking, it is not
> necessary for the GNU/Linux system to be fully XDG-compiant. It will be
> enough that (1) Emacs provides .desktop file; (2) Linux has xdg-open and
> its dependencies installed; (3) Firefox makes use of xdg-open.

I don't understand what should the NEWS entry about org-protocol
support say, in addition to what it already says, to cover these
factoids.  The NEWS entry is about the emacsclient.desktop file and
its contribution to automatic support of org-protocol; isn't what you
say above part of that automatic support?





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

* Re: Generic Elisp mechanism to declare file/URI handlers for Emacs
  2023-09-19 13:46                         ` Generic Elisp mechanism to declare file/URI handlers for Emacs Eli Zaretskii
@ 2023-09-19 13:56                           ` Ihor Radchenko
  2023-09-20 11:15                             ` Eli Zaretskii
  0 siblings, 1 reply; 45+ messages in thread
From: Ihor Radchenko @ 2023-09-19 13:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: luangruo, bjorn.bidar, stefankangas, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> ...
> So I don't see how we could offer something like that for Windows; we
> learned long ago that including scripts or programs that write into
> the Registry is a two-edged sword, so we refrain from doing that
> nowadays.

I see. Is it the same problem on MacOS?

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



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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-19 13:50                               ` Eli Zaretskii
@ 2023-09-19 13:58                                 ` Ihor Radchenko
  2023-09-19 14:40                                   ` Eli Zaretskii
  0 siblings, 1 reply; 45+ messages in thread
From: Ihor Radchenko @ 2023-09-19 13:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: bjorn.bidar, stefankangas, 65469

Eli Zaretskii <eliz@gnu.org> writes:

>> > Is this related to the issue with org-protocol?
>> 
>>  ...
>> With the discussed patch, e.g. Firefox will automatically use Emacs when
>> clicking on the above bookmarklet. Then, strictly speaking, it is not
>> necessary for the GNU/Linux system to be fully XDG-compiant. It will be
>> enough that (1) Emacs provides .desktop file; (2) Linux has xdg-open and
>> its dependencies installed; (3) Firefox makes use of xdg-open.
>
> I don't understand what should the NEWS entry about org-protocol
> support say, in addition to what it already says, to cover these
> factoids.  The NEWS entry is about the emacsclient.desktop file and
> its contribution to automatic support of org-protocol; isn't what you
> say above part of that automatic support?

I guess it depends on the level of precision you want to have in the
NEWS entry. For me, the NEWS entry sounds good enough, but I wanted to
make things more clear after Björn's comment.

(Note that it was Björn who objected the original wording)

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





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-19 13:58                                 ` Ihor Radchenko
@ 2023-09-19 14:40                                   ` Eli Zaretskii
  2023-09-19 21:26                                     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-20  9:32                                     ` Ihor Radchenko
  0 siblings, 2 replies; 45+ messages in thread
From: Eli Zaretskii @ 2023-09-19 14:40 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: bjorn.bidar, stefankangas, 65469

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: bjorn.bidar@thaodan.de, 65469@debbugs.gnu.org, stefankangas@gmail.com
> Date: Tue, 19 Sep 2023 13:58:53 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> > Is this related to the issue with org-protocol?
> >> 
> >>  ...
> >> With the discussed patch, e.g. Firefox will automatically use Emacs when
> >> clicking on the above bookmarklet. Then, strictly speaking, it is not
> >> necessary for the GNU/Linux system to be fully XDG-compiant. It will be
> >> enough that (1) Emacs provides .desktop file; (2) Linux has xdg-open and
> >> its dependencies installed; (3) Firefox makes use of xdg-open.
> >
> > I don't understand what should the NEWS entry about org-protocol
> > support say, in addition to what it already says, to cover these
> > factoids.  The NEWS entry is about the emacsclient.desktop file and
> > its contribution to automatic support of org-protocol; isn't what you
> > say above part of that automatic support?
> 
> I guess it depends on the level of precision you want to have in the
> NEWS entry. For me, the NEWS entry sounds good enough, but I wanted to
> make things more clear after Björn's comment.

So what is imprecise in the wording I suggested a couple of messages
ago?





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

* Re: Generic Elisp mechanism to declare file/URI handlers for Emacs (was: bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol)
  2023-09-19 11:14                   ` Generic Elisp mechanism to declare file/URI handlers for Emacs (was: bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol) Ihor Radchenko
  2023-09-19 11:44                     ` Generic Elisp mechanism to declare file/URI handlers for Emacs Po Lu
@ 2023-09-19 16:28                     ` Jim Porter
  1 sibling, 0 replies; 45+ messages in thread
From: Jim Porter @ 2023-09-19 16:28 UTC (permalink / raw)
  To: Ihor Radchenko, Po Lu; +Cc: Björn Bidar, eliz, stefankangas, emacs-devel

On 9/19/2023 4:14 AM, Ihor Radchenko wrote:
> Would it make sense to create a more generic mechanism to collect a list
> of handlers from all the Elisp sources in Emacs and then generate
> Linux/Android/etc-specific definitions automatically when Emacs is
> compiled?
> 
> I imagine something akin how ;;;###autoload works - Elisp libraries that
> implement handling of certain file types or URI protocols declare this
> fact and then Emacs automatically pick this info, generating .desktop
> files and relevant parts of Andoid
> (java/org/gnu/emacs/EmacsOpenActivity.java) and whatever else necessary.

Yes please. Based on your imaginings, I'm in turn imagining something 
where I can type "emacs protocol://foo.bar" into my shell, and if I've 
enabled Emacs' handling for "protocol:" URLs somehow, this would now do 
some "protocol"-specific magic. (For org-protocol, that would be to 
start an Org capture or something; for mailto, that would be to compose 
a new message; etc.)

This would neatly resolve bug#65902 without having to mess around with 
emacsclient or the Emacs server protocol, and would hopefully let us 
remove the 'server-visit-files' advice in org-protocol. I'm sure there 
would be other interesting things we could do with an easy way of 
specifying URL handlers too (IRC links, HTTP(S) for EWW[1], etc).

[1] Probably not as the system-wide default, but "emacs 
https://example.com" could work.



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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-19 14:40                                   ` Eli Zaretskii
@ 2023-09-19 21:26                                     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-20  9:32                                     ` Ihor Radchenko
  1 sibling, 0 replies; 45+ messages in thread
From: Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-19 21:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 65469, Ihor Radchenko, stefankangas

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Ihor Radchenko <yantar92@posteo.net>
>> Cc: bjorn.bidar@thaodan.de, 65469@debbugs.gnu.org, stefankangas@gmail.com
>> Date: Tue, 19 Sep 2023 13:58:53 +0000
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> > Is this related to the issue with org-protocol?
>> >> 
>> >>  ...
>> >> With the discussed patch, e.g. Firefox will automatically use Emacs when
>> >> clicking on the above bookmarklet. Then, strictly speaking, it is not
>> >> necessary for the GNU/Linux system to be fully XDG-compiant. It will be
>> >> enough that (1) Emacs provides .desktop file; (2) Linux has xdg-open and
>> >> its dependencies installed; (3) Firefox makes use of xdg-open.
>> >
>> > I don't understand what should the NEWS entry about org-protocol
>> > support say, in addition to what it already says, to cover these
>> > factoids.  The NEWS entry is about the emacsclient.desktop file and
>> > its contribution to automatic support of org-protocol; isn't what you
>> > say above part of that automatic support?
>> 
>> I guess it depends on the level of precision you want to have in the
>> NEWS entry. For me, the NEWS entry sounds good enough, but I wanted to
>> make things more clear after Björn's comment.
>
> So what is imprecise in the wording I suggested a couple of messages
> ago?

I'm fine with the suggested wording as long as it explains that BSD or
even Hurd are also fine. My comment was only about that not
only Linux as the relevant target OS for the change.

Xdg-open is a thing on any free Unix-like system.





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

* Re: Generic Elisp mechanism to declare file/URI handlers for Emacs
  2023-09-19 13:25                         ` Po Lu
@ 2023-09-20  9:26                           ` Ihor Radchenko
  2023-09-20  9:57                             ` Po Lu
  0 siblings, 1 reply; 45+ messages in thread
From: Ihor Radchenko @ 2023-09-20  9:26 UTC (permalink / raw)
  To: Po Lu; +Cc: Björn Bidar, eliz, stefankangas, emacs-devel

Po Lu <luangruo@yahoo.com> writes:

>> For example, consider that we have built-in clojure-mode at some point.
>> Then, it will make sense to tell OS that Emacs is able to open .clj
>> files. Same for any other new major mode.
>>
>> Not every major mode author knows the specific ways how Emacs implements
>> file type handling in different OSes.
>
> Emacs opens all text documents, and Clojure files are a kind of text
> file.

AFAIK, this is not the case. At least, for .desktop file on Linux.
Emacs opens all text/plain documents, but not all text/* documents.
In addition Emacs opens

text/english;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++;

which is a closed list. If we have something like, for example,
text/markdown, it will not be open by Emacs without explicit declaration
in the .desktop file.

> And be that as it may, operating systems use different names to
> designate each kind of text file, so expecting major mode authors to
> understand every one of those names is unreasonable anyway.

I thought that mimetypes is the common standard:
https://www.iana.org/assignments/media-types/media-types.xhtml
If not, it is indeed a problem.

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



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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-19 14:40                                   ` Eli Zaretskii
  2023-09-19 21:26                                     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-20  9:32                                     ` Ihor Radchenko
  2023-09-20 13:39                                       ` Eli Zaretskii
  1 sibling, 1 reply; 45+ messages in thread
From: Ihor Radchenko @ 2023-09-20  9:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: bjorn.bidar, stefankangas, 65469

Eli Zaretskii <eliz@gnu.org> writes:

>> I guess it depends on the level of precision you want to have in the
>> NEWS entry. For me, the NEWS entry sounds good enough, but I wanted to
>> make things more clear after Björn's comment.
>
> So what is imprecise in the wording I suggested a couple of messages
> ago?

    Previously, users had to manually configure their desktop environment
    to open 'org-protocol' links in Emacs.  On any XDG-compliant system,
    including GNU/Linux and some others, these links should now open in
    Emacs automatically

1. GNU/Linux by itself is not XDG-compliant. Only some desktop
   environments are.

2. System does not have to be fully XDG-compliant. It is enough that
   some apps (like Firefox) follow XDG spec and that xdg-utils is
   installed.

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





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

* Re: Generic Elisp mechanism to declare file/URI handlers for Emacs
  2023-09-20  9:26                           ` Ihor Radchenko
@ 2023-09-20  9:57                             ` Po Lu
  2023-09-20 11:17                               ` Should Emacs declare itself as being able to open all the text/* mimetypes? (was: Generic Elisp mechanism to declare file/URI handlers for Emacs) Ihor Radchenko
  0 siblings, 1 reply; 45+ messages in thread
From: Po Lu @ 2023-09-20  9:57 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Björn Bidar, eliz, stefankangas, emacs-devel

Ihor Radchenko <yantar92@posteo.net> writes:

> AFAIK, this is not the case. At least, for .desktop file on Linux.
> Emacs opens all text/plain documents, but not all text/* documents.
> In addition Emacs opens
>
> text/english;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++;
>
> which is a closed list. If we have something like, for example,
> text/markdown, it will not be open by Emacs without explicit declaration
> in the .desktop file.

Then maybe that should be fixed, because under Android, Emacs opens all
text/* files.  (Given that Emacs is usually the sole functioning text
editor when installed on Android systems.)

> I thought that mimetypes is the common standard:
> https://www.iana.org/assignments/media-types/media-types.xhtml
> If not, it is indeed a problem.

Does the IANA standard encompass Clojure files?



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

* Re: Generic Elisp mechanism to declare file/URI handlers for Emacs
  2023-09-19 13:56                           ` Ihor Radchenko
@ 2023-09-20 11:15                             ` Eli Zaretskii
  0 siblings, 0 replies; 45+ messages in thread
From: Eli Zaretskii @ 2023-09-20 11:15 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: luangruo, bjorn.bidar, stefankangas, emacs-devel

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: luangruo@yahoo.com, bjorn.bidar@thaodan.de, stefankangas@gmail.com,
>  emacs-devel@gnu.org
> Date: Tue, 19 Sep 2023 13:56:23 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > ...
> > So I don't see how we could offer something like that for Windows; we
> > learned long ago that including scripts or programs that write into
> > the Registry is a two-edged sword, so we refrain from doing that
> > nowadays.
> 
> I see. Is it the same problem on MacOS?

I don't know about macOS, sorry.  Hopefully, someone else will chime
in and answer your question.



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

* Should Emacs declare itself as being able to open all the text/* mimetypes? (was: Generic Elisp mechanism to declare file/URI handlers for Emacs)
  2023-09-20  9:57                             ` Po Lu
@ 2023-09-20 11:17                               ` Ihor Radchenko
  2023-09-20 12:23                                 ` Should Emacs declare itself as being able to open all the text/* mimetypes? Po Lu
  0 siblings, 1 reply; 45+ messages in thread
From: Ihor Radchenko @ 2023-09-20 11:17 UTC (permalink / raw)
  To: Po Lu; +Cc: Björn Bidar, eliz, stefankangas, emacs-devel

Po Lu <luangruo@yahoo.com> writes:

>> text/english;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++;
>>
>> which is a closed list. If we have something like, for example,
>> text/markdown, it will not be open by Emacs without explicit declaration
>> in the .desktop file.
>
> Then maybe that should be fixed, because under Android, Emacs opens all
> text/* files.  (Given that Emacs is usually the sole functioning text
> editor when installed on Android systems.)

I am not sure if it is possible to use wildcards like this.

Nothing is said in the spec:
https://specifications.freedesktop.org/desktop-entry-spec/0.9.5/ar01s07.html

On the other hand, wildcards seems to work:
https://unix.stackexchange.com/questions/232525/mimetype-desktop-entry-for-all-image-files

So, your suggestion sounds reasonable.

>> I thought that mimetypes is the common standard:
>> https://www.iana.org/assignments/media-types/media-types.xhtml
>> If not, it is indeed a problem.
>
> Does the IANA standard encompass Clojure files?

Nope. It was just an example. Clojure files do not have a dedicated
mimetype:

$ xdg-mime query filetype ./project.clj 
text/plain

Other source code files might though. For example,

$ xdg-mime query filetype src/js.rs 
text/rust

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



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

* Re: Should Emacs declare itself as being able to open all the text/* mimetypes?
  2023-09-20 11:17                               ` Should Emacs declare itself as being able to open all the text/* mimetypes? (was: Generic Elisp mechanism to declare file/URI handlers for Emacs) Ihor Radchenko
@ 2023-09-20 12:23                                 ` Po Lu
  2023-09-20 12:38                                   ` Ihor Radchenko
  0 siblings, 1 reply; 45+ messages in thread
From: Po Lu @ 2023-09-20 12:23 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Björn Bidar, eliz, stefankangas, emacs-devel

Ihor Radchenko <yantar92@posteo.net> writes:

> Other source code files might though. For example,
>
> $ xdg-mime query filetype src/js.rs 
> text/rust

RFC6838 does not incorporate text/rust AFAICT.



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

* Re: Should Emacs declare itself as being able to open all the text/* mimetypes?
  2023-09-20 12:23                                 ` Should Emacs declare itself as being able to open all the text/* mimetypes? Po Lu
@ 2023-09-20 12:38                                   ` Ihor Radchenko
  0 siblings, 0 replies; 45+ messages in thread
From: Ihor Radchenko @ 2023-09-20 12:38 UTC (permalink / raw)
  To: Po Lu; +Cc: Björn Bidar, eliz, stefankangas, emacs-devel

Po Lu <luangruo@yahoo.com> writes:

> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> Other source code files might though. For example,
>>
>> $ xdg-mime query filetype src/js.rs 
>> text/rust
>
> RFC6838 does not incorporate text/rust AFAICT.

Indeed. That officially registered mimetype list in
https://www.iana.org/assignments/media-types/media-types.xhtml is rather
limited.

But xdg-mime is still recognizing a number of other types, including
text/x-makefile, which is also not on IANA list.

So, the idea of using the same mimetype for all OSes will not work.
"Standard" it too limited to rely on.

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



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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-20  9:32                                     ` Ihor Radchenko
@ 2023-09-20 13:39                                       ` Eli Zaretskii
  2023-09-20 14:01                                         ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-20 22:41                                         ` Stefan Kangas
  0 siblings, 2 replies; 45+ messages in thread
From: Eli Zaretskii @ 2023-09-20 13:39 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: bjorn.bidar, stefankangas, 65469

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: bjorn.bidar@thaodan.de, 65469@debbugs.gnu.org, stefankangas@gmail.com
> Date: Wed, 20 Sep 2023 09:32:38 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> I guess it depends on the level of precision you want to have in the
> >> NEWS entry. For me, the NEWS entry sounds good enough, but I wanted to
> >> make things more clear after Björn's comment.
> >
> > So what is imprecise in the wording I suggested a couple of messages
> > ago?
> 
>     Previously, users had to manually configure their desktop environment
>     to open 'org-protocol' links in Emacs.  On any XDG-compliant system,
>     including GNU/Linux and some others, these links should now open in
>     Emacs automatically
> 
> 1. GNU/Linux by itself is not XDG-compliant. Only some desktop
>    environments are.

How about this minor variation:

    Previously, users had to manually configure their desktop environment
    to open 'org-protocol' links in Emacs.  On any XDG-compliant desktop
    environment, including KDE and GNOME on GNU/Linux, and some others,
    these links should now open in Emacs automatically

> 2. System does not have to be fully XDG-compliant. It is enough that
>    some apps (like Firefox) follow XDG spec and that xdg-utils is
>    installed.

Does the above change solve this problem as well?  Or maybe try this
variant:

  ** On capable systems, Emacs is now the default application for 'org-protocol'.
  Org mode provides a way to quickly capture bookmarks, notes, and links
  using 'emacsclient':

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

  Previously, users had to manually configure their desktop environment
  to open 'org-protocol' links in Emacs.  On any XDG-compliant desktop
  environment, including KDE and GNOME on GNU/Linux, and some others,
  these links should now open in Emacs automatically if the application
  that opens the link follows the XDG spec and xdg-utils are installed.
  This is because the "emacsclient.desktop" file now arranges for Emacs
  to be the default application for the 'org-protocol' URI scheme.  See
  the Org mode manual, Info node "(org) Protocols" for more details.





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-20 13:39                                       ` Eli Zaretskii
@ 2023-09-20 14:01                                         ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-20 15:01                                           ` Eli Zaretskii
  2023-09-20 22:41                                         ` Stefan Kangas
  1 sibling, 1 reply; 45+ messages in thread
From: Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-20 14:01 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 65469, Ihor Radchenko, stefankangas

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Ihor Radchenko <yantar92@posteo.net>
>> Cc: bjorn.bidar@thaodan.de, 65469@debbugs.gnu.org,
>> stefankangas@gmail.com
>> Date: Wed, 20 Sep 2023 09:32:38 +0000
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> I guess it depends on the level of precision you want to have in
>> >> the
>> >> NEWS entry. For me, the NEWS entry sounds good enough, but I
>> >> wanted to
>> >> make things more clear after Björn's comment.
>> >
>> > So what is imprecise in the wording I suggested a couple of
>> > messages
>> > ago?
>> 
>>     Previously, users had to manually configure their desktop environment
>>     to open 'org-protocol' links in Emacs.  On any XDG-compliant system,
>>     including GNU/Linux and some others, these links should now open in
>>     Emacs automatically
>> 
>> 1. GNU/Linux by itself is not XDG-compliant. Only some desktop
>>    environments are.
>
> How about this minor variation:
>
>     Previously, users had to manually configure their desktop
> environment
>     to open 'org-protocol' links in Emacs.  On any XDG-compliant
> desktop
>     environment, including KDE and GNOME on GNU/Linux, and some
> others,
>     these links should now open in Emacs automatically
>
>> 2. System does not have to be fully XDG-compliant. It is enough that
>>    some apps (like Firefox) follow XDG spec and that xdg-utils is
>>    installed.
>
> Does the above change solve this problem as well?  Or maybe try this
> variant:
>
>   ** On capable systems, Emacs is now the default application for 'org-protocol'.
>   Org mode provides a way to quickly capture bookmarks, notes, and links
>   using 'emacsclient':
>
>       emacsclient "org-protocol://store-link?url=URL&title=TITLE"
>
>   Previously, users had to manually configure their desktop environment
>   to open 'org-protocol' links in Emacs.  On any XDG-compliant desktop
>   environment, including KDE and GNOME on GNU/Linux, and some others,
>   these links should now open in Emacs automatically if the application
>   that opens the link follows the XDG spec and xdg-utils are installed.
>   This is because the "emacsclient.desktop" file now arranges for Emacs
>   to be the default application for the 'org-protocol' URI scheme.  See
>   the Org mode manual, Info node "(org) Protocols" for more details.

Why the focus on Linux? For example, you can install KDE on BSD and have
the same benefit of the change as on Linux.





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-20 14:01                                         ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-20 15:01                                           ` Eli Zaretskii
  2023-09-23 21:35                                             ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 45+ messages in thread
From: Eli Zaretskii @ 2023-09-20 15:01 UTC (permalink / raw)
  To: Björn Bidar; +Cc: 65469, yantar92, stefankangas

> From: Björn Bidar <bjorn.bidar@thaodan.de>
> Cc: Ihor Radchenko <yantar92@posteo.net>,  65469@debbugs.gnu.org,
>   stefankangas@gmail.com
> Date: Wed, 20 Sep 2023 17:01:27 +0300
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >   ** On capable systems, Emacs is now the default application for 'org-protocol'.
> >   Org mode provides a way to quickly capture bookmarks, notes, and links
> >   using 'emacsclient':
> >
> >       emacsclient "org-protocol://store-link?url=URL&title=TITLE"
> >
> >   Previously, users had to manually configure their desktop environment
> >   to open 'org-protocol' links in Emacs.  On any XDG-compliant desktop
> >   environment, including KDE and GNOME on GNU/Linux, and some others,
> >   these links should now open in Emacs automatically if the application
> >   that opens the link follows the XDG spec and xdg-utils are installed.
> >   This is because the "emacsclient.desktop" file now arranges for Emacs
> >   to be the default application for the 'org-protocol' URI scheme.  See
> >   the Org mode manual, Info node "(org) Protocols" for more details.
> 
> Why the focus on Linux?

Not focus, but preference.  It's because GNU/Linux is our main target
system and its users are our main audience.

> For example, you can install KDE on BSD and have the same benefit of
> the change as on Linux.

The above text says "and some others", and it also says "any
XDG-compliant desktop environment".  Why is this not enough?  We don't
have to promote *BSD systems.





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-20 13:39                                       ` Eli Zaretskii
  2023-09-20 14:01                                         ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-20 22:41                                         ` Stefan Kangas
  1 sibling, 0 replies; 45+ messages in thread
From: Stefan Kangas @ 2023-09-20 22:41 UTC (permalink / raw)
  To: Eli Zaretskii, Ihor Radchenko; +Cc: bjorn.bidar, 65469

Eli Zaretskii <eliz@gnu.org> writes:

>   ** On capable systems, Emacs is now the default application for 'org-protocol'.
>   Org mode provides a way to quickly capture bookmarks, notes, and links
>   using 'emacsclient':
>
>       emacsclient "org-protocol://store-link?url=URL&title=TITLE"
>
>   Previously, users had to manually configure their desktop environment
>   to open 'org-protocol' links in Emacs.  On any XDG-compliant desktop
>   environment, including KDE and GNOME on GNU/Linux, and some others,

Perhaps simpler:

    environment, such as KDE and GNOME on GNU/Linux,

But my understanding is that KDE and GNOME desktop environments are XDG
compliant on all supported platforms.  Is that correct?  If it is,
perhaps it could be even simpler:

    environment, such as KDE and GNOME,

(I'd mention GNOME first due to its historical connection to GNU, but
that's probably a nitpick in this context.)

>   these links should now open in Emacs automatically if the application
>   that opens the link follows the XDG spec and xdg-utils are installed.
>   This is because the "emacsclient.desktop" file now arranges for Emacs
>   to be the default application for the 'org-protocol' URI scheme.  See
>   the Org mode manual, Info node "(org) Protocols" for more details.

Other than that, LGTM.





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

* bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol
  2023-09-20 15:01                                           ` Eli Zaretskii
@ 2023-09-23 21:35                                             ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 45+ messages in thread
From: Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-23 21:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 65469, yantar92, stefankangas

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Björn Bidar <bjorn.bidar@thaodan.de>
>> Cc: Ihor Radchenko <yantar92@posteo.net>,  65469@debbugs.gnu.org,
>>   stefankangas@gmail.com
>> Date: Wed, 20 Sep 2023 17:01:27 +0300
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >   ** On capable systems, Emacs is now the default application for 'org-protocol'.
>> >   Org mode provides a way to quickly capture bookmarks, notes, and links
>> >   using 'emacsclient':
>> >
>> >       emacsclient "org-protocol://store-link?url=URL&title=TITLE"
>> >
>> >   Previously, users had to manually configure their desktop environment
>> >   to open 'org-protocol' links in Emacs.  On any XDG-compliant desktop
>> >   environment, including KDE and GNOME on GNU/Linux, and some others,
>> >   these links should now open in Emacs automatically if the application
>> >   that opens the link follows the XDG spec and xdg-utils are installed.
>> >   This is because the "emacsclient.desktop" file now arranges for Emacs
>> >   to be the default application for the 'org-protocol' URI scheme.  See
>> >   the Org mode manual, Info node "(org) Protocols" for more details.
>> 
>> Why the focus on Linux?
>
> Not focus, but preference.  It's because GNU/Linux is our main target
> system and its users are our main audience.
>
>> For example, you can install KDE on BSD and have the same benefit of
>> the change as on Linux.
>
> The above text says "and some others", and it also says "any
> XDG-compliant desktop environment".  Why is this not enough?  We don't
> have to promote *BSD systems.
And some others wasn't clear to me because of the long sentence and
because mentioning KDE and GNOME on Linux while them being on Linux or
elsewhere doesn't make an impact on their XDG support.

Writing: "On any XDG-compliant desktop environment, including KDE and GNOME, and some others,
these links should now open in Emacs automatically if the application
that opens the link follows the XDG spec is installed. xdg-utils is
recommended to be installed but is not always a requirement."

(XDG-utils provides a shell-script that wraps around various desktop
environments "open/mime-handler" applications but only some programs use
it e.g. Chromium/Chrome).

To mention the target operating system for the feature I would write
this:
"XDG-compliant desktop environments are usually found on various
Unix-like systems use as Linux".

To be honest the discussion on this is taking quite long, I was only
concerned that simply mentioning only Linux was technically incorrect.





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

end of thread, other threads:[~2023-09-23 21:35 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-23  9:30 bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol Ihor Radchenko
2023-08-23 22:39 ` Stefan Kangas
2023-09-01 18:50   ` Stefan Kangas
2023-09-17 13:09     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-17 13:16       ` Stefan Kangas
2023-09-17 14:18         ` Eli Zaretskii
2023-09-17 14:31           ` Stefan Kangas
2023-09-18  8:30         ` Ihor Radchenko
2023-09-18 11:02           ` Stefan Kangas
2023-09-18 11:15           ` Eli Zaretskii
2023-09-18 11:18             ` Stefan Kangas
2023-09-18 13:00             ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-18 13:20               ` Ihor Radchenko
2023-09-18 13:32                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-19 11:14                   ` Generic Elisp mechanism to declare file/URI handlers for Emacs (was: bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol) Ihor Radchenko
2023-09-19 11:44                     ` Generic Elisp mechanism to declare file/URI handlers for Emacs Po Lu
2023-09-19 13:06                       ` Ihor Radchenko
2023-09-19 13:25                         ` Po Lu
2023-09-20  9:26                           ` Ihor Radchenko
2023-09-20  9:57                             ` Po Lu
2023-09-20 11:17                               ` Should Emacs declare itself as being able to open all the text/* mimetypes? (was: Generic Elisp mechanism to declare file/URI handlers for Emacs) Ihor Radchenko
2023-09-20 12:23                                 ` Should Emacs declare itself as being able to open all the text/* mimetypes? Po Lu
2023-09-20 12:38                                   ` Ihor Radchenko
2023-09-19 13:46                         ` Generic Elisp mechanism to declare file/URI handlers for Emacs Eli Zaretskii
2023-09-19 13:56                           ` Ihor Radchenko
2023-09-20 11:15                             ` Eli Zaretskii
2023-09-19 16:28                     ` Generic Elisp mechanism to declare file/URI handlers for Emacs (was: bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol) Jim Porter
2023-09-18 14:33               ` bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs default application for org-protocol Eli Zaretskii
2023-09-18 23:04                 ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-19  2:31                   ` Eli Zaretskii
2023-09-19  7:59                     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-19 11:06                       ` Eli Zaretskii
2023-09-19 11:21                         ` Ihor Radchenko
2023-09-19 12:24                           ` Eli Zaretskii
2023-09-19 13:16                             ` Ihor Radchenko
2023-09-19 13:50                               ` Eli Zaretskii
2023-09-19 13:58                                 ` Ihor Radchenko
2023-09-19 14:40                                   ` Eli Zaretskii
2023-09-19 21:26                                     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-20  9:32                                     ` Ihor Radchenko
2023-09-20 13:39                                       ` Eli Zaretskii
2023-09-20 14:01                                         ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-20 15:01                                           ` Eli Zaretskii
2023-09-23 21:35                                             ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-20 22:41                                         ` Stefan Kangas

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.