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

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Wed, 23 Aug 2023 09:31:02 UTC

Severity: normal

Tags: patch

Fixed in version 29.2

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #78 received at 65469 <at> debbugs.gnu.org (full text, mbox):

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: bjorn.bidar <at> thaodan.de, stefankangas <at> gmail.com, 65469 <at> debbugs.gnu.org
Subject: Re: bug#65469: [PATCH] * etc/emacsclient.desktop: Make Emacs
 default application for org-protocol
Date: Tue, 19 Sep 2023 13:16:58 +0000
Eli Zaretskii <eliz <at> 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>




This bug report was last modified 1 year and 292 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.