GNU bug report logs -
#57752
28.1.91; emacsclient-mail.desktop doesn't work for me
Previous Next
Full log
Message #113 received at 57752 <at> debbugs.gnu.org (full text, mbox):
On 9/19/2022 1:12 AM, Lars Ingebrigtsen wrote:
> Jim Porter <jporterbugs <at> gmail.com> writes:
>
>> This is actually the trickiest part about this to me. If I were
>> designing this, I'd say that '--apply' consumes every positional
>> argument up to the next flag.
>
> Sorry, that would just be a very fiddly, often-breaking interface. If
> you say
>
> emacs --apply foo $1 $2
>
> and $2 happens to be "-*hakuna-matata*-", then you'd get a failure.
In my suggestion, this would be spelled
emacs --apply foo -- $1 $2
However...
> Morover, there's no way to separate
>
> emacs --apply foo param1 param2
>
> from
>
> emacs --apply foo param1 file-to-be-opened
>
> So we need "--" to end the parameter list.
This would indeed be impossible in my suggestion (at least not without
having 'foo' call 'find-file'). Just to make sure I understand your
suggestion: '--apply' would consume *every* argument after it until it
sees a '--'? So to apply 2 functions, you'd say:
emacs --apply func1 arg1 arg2 -- --apply func2 arg3 arg4
That seems like it would probably be ok, so long as no one wanted to
pass a literal '--' to the function. I don't think there's much of a
security risk either, since the worst that would happen is someone
sending "-- foobar", causing "foobar" to get opened as a file.
This bug report was last modified 1 year and 282 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.