Subject: bug#25671: Feature request: emacs -Q --script as a single binary

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 18 Apr 2022 13:01:10 +0200

Glenn Morris <[email-masked]> writes:

>> OTOH I'd be happy to see a new argument that lets you provide various
>> args as one.  E.g. "emacs --args=-Q,--script" which would be more
>> generally useful to deal with the limit of only one arg in shebang.
>> Given the size limit of shebang lines, we'd also want this extra arg to
>> be shortish.
>>
>> An alternative would be to combine --args and --script, so you could
>> say "emacs --script=-Q" to get what you're asking for.
>
> Apparently it's somewhat conventional (perl, ruby) to use "-x" for this
> purpose. A nice write-up at
>
> https://github.com/smikes/node/blob/minus-x-switch/doc/Minus-X-Switch-Proposal.md
>
> Amazingly, "-x" is available as an Emacs command-line switch...

I think that sounds really attractive, so I've added this to Emacs 29.
The new -x switch is like --script, but will kill Emacs when it reaches
the end of the script, and return the value of the final form as the
return value, so you can say use 0 at the end to signal success to the
caller.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no