emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generic Elisp mechanism to declare file/URI handlers for Emacs


From: Po Lu
Subject: Re: Generic Elisp mechanism to declare file/URI handlers for Emacs
Date: Tue, 19 Sep 2023 19:44:41 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]