[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs script options
From: |
Eli Zaretskii |
Subject: |
Re: Emacs script options |
Date: |
Sat, 18 Nov 2023 09:36:36 +0200 |
> From: Greg Minshall <minshall@umich.edu>
> Date: Fri, 17 Nov 2023 19:13:56 -0800
>
> hi. i would like to be able to write Emacs scripts ("#!...") that allow
> a user to enter almost any option to the script itself, *without* having
> to use double dashes ("--") to avoid colliding with Emacs option
> processing.
>
> looking at "--script" and "-x", this doesn't seem possible.
>
> as a test case, given a simple script foo.sh (*), using "-x", and
> invoking it with an option "--eval" gives this error:
>
> ----
> % ./foo.sh --eval
> emacs: Option '--eval' requires an argument
> ----
>
> (that bare "--eval" *should* be an error if it were meant for Emacs
> itself; however, it is meant for the Emacs script, which may have other
> ideas of the syntax/semantics of "--eval".)
But if we change that, how can we pass additional options to Emacs
when invoking it from a script? That is also an important capability,
and replacing it with what you want seems to be an incompatible
change, which takes away a capability we have now.
If we want to be able to pass options to the script itself, we need to
do it in a compatible way, that doesn't lose what we have now.
In any case, could you please show a real-life case where this is
needed? The -x option was intended to support the use cases where the
rest of the script is Emacs Lisp code, so what would such a script do
with an option that is not interpreted by Emacs, and why is that
needed?
Thanks.
Re: Emacs script options, Greg Minshall, 2023/11/26
Re: Emacs script options, Sebastian Miele, 2023/11/18