Subject: Re: bug#57752: 28.1.91; emacsclient-mail.desktop doesn't work for me

From: Jim Porter <[email-masked]>
Date: Fri, 16 Sep 2022 12:42:34 -0700

On 9/13/2022 5:19 AM, Lars Ingebrigtsen wrote:

> I'd prefer to have a .desktop file that works without any helper
> scripts.   Can't the emacsclient-mail.desktop file be rewritten to not
> use quoting here?

Here's another strategy for handling this, inspired by org-protocol[1].
For those who haven't used it, org-protocol invokes emacsclient with an 
"org-protocol://..." URL to let you do things like capture text from 
another application.

Extending from that, what if Emacs introduced URL handlers, so that these:

   emacs mailto:[email-masked]
   emacsclient mailto:[email-masked]

would look up a "mailto:" handler defined somewhere in Emacs[2] (e.g. 
'message-mailto') and call that function instead of 'find-file'. This is 
roughly how the org-protocol module handles this, although it only works 
for emacsclient (it adds advice to a few functions from server.el).

This would be less flexible than having a generic way of feeding certain 
command-line arguments to an Emacs Lisp function, but I'm not sure what 
practical uses we'd need that for aside from handling URLs, as in this 
bug or for org-protocol. If there are some other uses people have for 
the more-flexible implementation, I think it would help to list those so 
we can be sure the chosen solution addresses them.

[1] https://orgmode.org/manual/Protocols.html
[2] Possibly opt-in in the user's config. I don't have any preferences here.