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

From: [email-masked]
Date: Thu, 14 Sep 2023 11:35:24 +0000 (UTC)

[email-masked] writes:
> - Finally, a fourth approach is to teach emacsclient to be able to send
>   this arbitrary data to Emacs on its own.  Such as by adding --apply.
>   There are a bunch of designs for that, but all of them require
>   modifying emacsclient.

BTW, if this specific approach of --apply seems inelegant to you, I
could make a different design work.  As long as Lisp code gets direct
access to the arguments as strings, without needing escaping.

One person in the previous thread proposed making a
command-line-args-left equivalent for emacsclient.  If we did this, it
wouldn't require adding any new arguments to the emacsclient interface.

This could be called server-eval-args-left, so that --apply could be
done instead as:

emacsclient --eval
'(progn (apply func server-eval-args-left) (setq server-eval-args-left nil))'
arg1 arg2

I can do that if you prefer that, but it will require some more
significant changes to the internals (because currently server.el
processes -eval commands one at a time and doesn't have access to the
subsequent ones).