unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Po Lu <luangruo@yahoo.com>
Cc: "Björn Bidar" <bjorn.bidar@thaodan.de>,
	eliz@gnu.org, stefankangas@gmail.com, emacs-devel@gnu.org
Subject: Re: Generic Elisp mechanism to declare file/URI handlers for Emacs
Date: Tue, 19 Sep 2023 13:06:57 +0000	[thread overview]
Message-ID: <87cyyenwge.fsf@localhost> (raw)
In-Reply-To: <87wmwmv13q.fsf@yahoo.com>

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	other threads:[~2023-09-19 13:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87v8d66r7l.fsf@localhost>
     [not found] ` <CADwFkmmr=9DpCXDqgh_z+EFJPAvmchJfzuzReWM9z=T63oC2NA@mail.gmail.com>
     [not found]   ` <CADwFkm=AejxJ2saoH37Eo_OLRXKT7BALZM7NF4V_c3vQGXUiyA@mail.gmail.com>
     [not found]     ` <87led53q0c.fsf@thaodan.de>
     [not found]       ` <CADwFkmm9SOp5Cx4MsHkSs9NVq9-aDAy8uu8MUPbY2RZnWQRx3Q@mail.gmail.com>
     [not found]         ` <87fs3bkho4.fsf@localhost>
     [not found]           ` <835y47g2b2.fsf@gnu.org>
     [not found]             ` <zaqt9p.s16mth.rtvd7y-qmf@thaodan.de>
     [not found]               ` <874jjrk48q.fsf@localhost>
     [not found]                 ` <87cyyfwqs5.fsf@yahoo.com>
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cyyenwge.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=bjorn.bidar@thaodan.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).