Jim Porter writes: > On 9/12/2023 7:30 PM, sbaugh@catern.com wrote: >> tags 65902 + patch >> quit >> This patch avoids the complicated scripting needed for >> emacsclient-mail.desktop by adding a new flag to emacsclient, --funcall, >> which mirrors emacs --funcall and allows emacsclient-mail.desktop to be >> basically the same as emacs-mail.desktop. > > I think this is actually the same as the (very long) bug#57752, so > thanks for working on this. (It was on my list of things to get to, > but I just haven't had time.) > > Over there, we agreed that something like your patch is wanted, albeit > with two caveats: > > 1. Since "--funcall" for the regular "emacs" binary doesn't pass > arguments to the function, how about we call this option "--apply" > instead? Ah, for some reason I thought --funcall passed arguments. Done in attached patch. > 2. It would be great if we could get "--apply" for the regular "emacs" > binary too, so that both programs work the same way (at least in this > regard). Done. Although the behavior is slightly different: emacs --apply calls the function with subsequent FILE arguments, and emacsclient --apply calls the function with all FILE arguments. The "subsequent FILE arguments" behavior is probably better, but I don't know a way to do that with getopt (which emacsclient uses). > Even better, if you could forward "--apply" from > "emacsclient" to the alternate editor (which would be "emacs" 99% of > the time) automatically. That works, in a roundabout way, for the > Emacs daemon, but not if the alternate editor is "emacs". This happens automatically anyway: When emacsclient starts the daemon, it sends the --apply request. I think that's exactly what you'd want.