* bug#25670: Feature request: ignore --help in --script mode
@ 2017-02-09 21:00 Clément Pit--Claudel
2017-02-10 4:40 ` Glenn Morris
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Clément Pit--Claudel @ 2017-02-09 21:00 UTC (permalink / raw)
To: 25670
[-- Attachment #1.1: Type: text/plain, Size: 619 bytes --]
Hi bug-gnu-emacs,
Event with --script, Emacs still displays its help when passed --help. This is confusing for users (they might write emacs --script some-script.el --help expecting to get help on the script, but instead they get Emacs' help), and it force ELisp scripts to use --usage or some other harder-to-guess synonym.
Could this be changed so that emacs --script a.el --help does not show Emacs' help?
More generally, could we guarantee that options that appear *after* "--script" aren't processed by Emacs itself (and instead left to the script)? Or would that break things?
Thanks!
Clément.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#25670: Feature request: ignore --help in --script mode
2017-02-09 21:00 bug#25670: Feature request: ignore --help in --script mode Clément Pit--Claudel
@ 2017-02-10 4:40 ` Glenn Morris
2017-02-10 15:05 ` Ted Zlatanov
2017-02-18 9:59 ` Eli Zaretskii
2 siblings, 0 replies; 9+ messages in thread
From: Glenn Morris @ 2017-02-10 4:40 UTC (permalink / raw)
To: Clément Pit--Claudel; +Cc: 25670
AFAICS a simple shell-script wrapper removes the need for --script
altogether, so it's hard to get motivated to improve it. Eg
#!/bin/sh
... --help parsing goes here ...
exec emacs -batch -l script.el
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#25670: Feature request: ignore --help in --script mode
2017-02-09 21:00 bug#25670: Feature request: ignore --help in --script mode Clément Pit--Claudel
2017-02-10 4:40 ` Glenn Morris
@ 2017-02-10 15:05 ` Ted Zlatanov
2017-02-10 16:52 ` Clément Pit--Claudel
2017-02-18 9:59 ` Eli Zaretskii
2 siblings, 1 reply; 9+ messages in thread
From: Ted Zlatanov @ 2017-02-10 15:05 UTC (permalink / raw)
To: Clément Pit--Claudel; +Cc: 25670
On Thu, 9 Feb 2017 16:00:59 -0500 Clément Pit--Claudel <clement.pitclaudel@live.com> wrote:
CP> More generally, could we guarantee that options that appear *after* "--script" aren't processed by Emacs itself (and instead left to the script)? Or would that break things?
Typically I've seen "--" used to indicate the end of parseable options.
Would it help?
If so, I think it makes sense to support that in Emacs. There may be
other future uses of it besides scripting.
Ted
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#25670: Feature request: ignore --help in --script mode
2017-02-09 21:00 bug#25670: Feature request: ignore --help in --script mode Clément Pit--Claudel
2017-02-10 4:40 ` Glenn Morris
2017-02-10 15:05 ` Ted Zlatanov
@ 2017-02-18 9:59 ` Eli Zaretskii
2017-02-18 13:46 ` Clément Pit--Claudel
2 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2017-02-18 9:59 UTC (permalink / raw)
To: Clément Pit--Claudel; +Cc: 25670
> From: Clément Pit--Claudel <clement.pitclaudel@live.com>
> Date: Thu, 9 Feb 2017 16:00:59 -0500
>
> Event with --script, Emacs still displays its help when passed --help. This is confusing for users (they might write emacs --script some-script.el --help expecting to get help on the script, but instead they get Emacs' help), and it force ELisp scripts to use --usage or some other harder-to-guess synonym.
>
> Could this be changed so that emacs --script a.el --help does not show Emacs' help?
What should be done with --help in that case?
(In general, I'd expect such script not to use --help or --version at
all.)
> More generally, could we guarantee that options that appear *after* "--script" aren't processed by Emacs itself (and instead left to the script)? Or would that break things?
Which other options should be processed when --script is given? Are
there any requirements for what command-line-args-left should have
when the script is loaded?
IOW, it is not clear to me what are the expectations in this use case.
Please take a look at how the command-line arguments are processed at
startup, in emacs.c and in startup.el, and make a more detailed
proposal. Then we could see if it's easy to implement without
potentially breaking anything.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#25670: Feature request: ignore --help in --script mode
2017-02-18 9:59 ` Eli Zaretskii
@ 2017-02-18 13:46 ` Clément Pit--Claudel
2017-02-18 14:18 ` Eli Zaretskii
0 siblings, 1 reply; 9+ messages in thread
From: Clément Pit--Claudel @ 2017-02-18 13:46 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 25670
[-- Attachment #1.1: Type: text/plain, Size: 559 bytes --]
On 2017-02-18 04:59, Eli Zaretskii wrote:
> IOW, it is not clear to me what are the expectations in this use case.
> Please take a look at how the command-line arguments are processed at
> startup, in emacs.c and in startup.el, and make a more detailed
> proposal. Then we could see if it's easy to implement without
> potentially breaking anything.
Ted's pointer to Emacs' support for "--" solved this problem for me: when I pass "--" before "--help", Emacs doesn't process "--". So I don't --script to be special-cased any more :)
Clément.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#25670: Feature request: ignore --help in --script mode
2017-02-18 13:46 ` Clément Pit--Claudel
@ 2017-02-18 14:18 ` Eli Zaretskii
0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2017-02-18 14:18 UTC (permalink / raw)
To: Clément Pit--Claudel; +Cc: 25670
> Cc: 25670@debbugs.gnu.org
> From: Clément Pit--Claudel <clement.pitclaudel@live.com>
> Date: Sat, 18 Feb 2017 08:46:07 -0500
>
> Ted's pointer to Emacs' support for "--" solved this problem for me: when I pass "--" before "--help", Emacs doesn't process "--". So I don't --script to be special-cased any more :)
OK, thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-02-18 14:18 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-09 21:00 bug#25670: Feature request: ignore --help in --script mode Clément Pit--Claudel
2017-02-10 4:40 ` Glenn Morris
2017-02-10 15:05 ` Ted Zlatanov
2017-02-10 16:52 ` Clément Pit--Claudel
2017-02-10 17:36 ` Glenn Morris
2017-02-10 20:23 ` Clément Pit--Claudel
2017-02-18 9:59 ` Eli Zaretskii
2017-02-18 13:46 ` Clément Pit--Claudel
2017-02-18 14:18 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.