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 08:17:33 -0700

On 9/16/2022 2:54 AM, Lars Ingebrigtsen wrote:
> I've idly wondered before whether we should add a general mechanism for
> this to avoid having to create functions that look at
> `command-line-args-left' themselves.  (And --eval is problematic in
> circumstances like this.)
> 
> So something like
> 
> --function foo --function-args bar zot gazonk
> 
> would result in calling `foo' with those arguments.
> 
> Hm...  would we need some way to say "here's the end of
> --function-args", perhaps?  "--"?  So:
> 
> --function foo --function-args bar zot gazonk --
> 
> Anybody have any thoughts here?

I have two thoughts:

1) Instead of specifying the function args with a flag, I think I'd go 
the other way and specify the function as being special, e.g.:

   emacs --apply func arg1 arg2

2) Even better, why not just use --function and pass some higher-order 
function:

   emacs --function apply-from-command-line func arg1 arg2

That way, it's easy to substitute in some other higher-order function if 
you want. emacsclient would still need to add a --function flag though, 
and probably some changes to how it forwards arguments to the main emacs 
so that you can do stuff like this.