[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs script options
|
From: |
Greg Minshall |
|
Subject: |
Re: Emacs script options |
|
Date: |
Sat, 18 Nov 2023 11:36:52 -0800 |
Eli Zaretskii <eliz@gnu.org> wrote:
> How would you pass these -F, -d, -V etc. options to Emacs, or use them
> in any other way in the script, whose contents is supposed to be an
> Emacs Lisp program? There's something I'm missing here. I asked my
> question because I thought you had a real-life example of a script you
> wanted to use, but in your response you don't show any such example.
> Can you show it?
in this case, the -F, -d, -V are aimed at the elisp code running in the
script, not for Emacs itself.
think of wanting to convert some random unix utility to run as an Emacs
script (rather than as a shell script, say), and trying to make the
command line options (and invocation) the same as the original shell
script. does that help clarify?
in my case, i have the beginnings of a shell script that is to set up
some state and then invoke Emacs to do some work (org mode stuff). its
projected getopt(1) strings look like
----
getopt -o "B:C:dhP:V" -l
"base-dir:,config-file:,debug,help,publish-dir:,version"
----
presumably most of those options (especially the long ones) don't
conflict with any Emacs command line options. but, some might ("-d"
does, as it turns out).
i'd like the users (hah!) to be able to type
----
./random-script -d --base-dir ${PWD}/foo
----
rather than
----
./random-script -- -d --base-dir ${PWD}/foo
----
cheers, Greg
(truth in advertising: in addition to this *application*, i also -- for
this application, really -- wrote some emacs-getopt package that would
probably benefit from such a facility.)
Re: Emacs script options, Greg Minshall, 2023/11/26
Re: Emacs script options, Sebastian Miele, 2023/11/18