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: Ihor Radchenko
Subject: Re: Generic Elisp mechanism to declare file/URI handlers for Emacs
Date: Tue, 19 Sep 2023 13:06:57 +0000

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>



reply via email to

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