Subject: bug#65902: 29.0.92; emacsclient-mail.desktop fails due to complicated escaping

From: Eli Zaretskii <[email-masked]>
Date: Sat, 16 Sep 2023 17:02:50 +0300

> From: Björn Bidar <[email-masked]>
> Cc: Jim Porter <[email-masked]>,  [email-masked],
>   [email-masked],  [email-masked]
> Date: Sat, 16 Sep 2023 16:43:20 +0300
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > People might agree, but I don't.  Please consider the perspective.
> > This started as an obscure and rare problem in a desktop file (which
> > we provided solely out of good will, since it really isn't our job to
> > do so, it's the job of downstream distros).
> 
> Programs ship their own desktop files.

Programs are shipped by distros.  Emacs as a project does not ship
anything, we just release the sources in a form that makes building
Emacs easy.  Our source tarballs cannot be installed, so they are not
a finished, ready-to-use product.  Distros, by contrast, do ship
programs ready to be used.

> It is not the job of the downstream to provide desktop files unless
> it is because of a patch from said downstream.
> 
> In any case it doesn't make sense for each downstream to ship their own
> desktop file and fix their own.

I disagree.  Desktop files are specific to the target OS, but Emacs as
the project does not target any specific OS (although there are OSes
that we treat more favorably when considering features).  The know-how
about what exactly is needed for the desktop integration is also
something that the distros have and we don't, except by chance.

Each distro targets a single OS, and so it is reasonable to expect
them to arrange for the necessary desktop integration.  For example,
no one would expect us to provide desktop shortcuts for MS-Windows,
except as a sign of good will and when we have the necessary expertise
on board.

> >From my pov letting Emacs do all work in passing arguments is the best
> solution as escaping is error prone. I haven't seen any program besides
> Emacs using escaped shell syntax to pass the escaped syntax of their
> target language. Most just have options to pass the target file or deal
> with the dbus activation/interface.

We don't require any escapes except those needed by Lisp.

Note that in this case, at least some of the escapes are because the
desktop shortcut invokes emacsclient via "sh -c "COMMAND STRING",
something that should be considered an Emacs problem or a problem we
must solve.