>>>> "SY" == Steve Youngs
<youngs(a)xemacs.org> writes:
SJT> Why should XEmacs quit?
SY> Consistency. A large proportion of the software that I use
SY> (all open source, predominately GNU) seem to do things this
SY> way.
There's only one that's anything like XEmacs. And you don't use that,
do you? ;-)
Seriously, quitting and displaying help is a reasonable fallback, but
we should be able to do better.
SY> OK, this might sound like a really silly question, but why
SY> wouldn't parsing the command line args be one of the first
SY> things that XEmacs does on startup?
Because it's done in Lisp. The first thing XEmacs does is to _sort_
the arguments according to a priority list. This ensures that -kill
is always last, -batch and -nw (and a couple others) always first.
The file specs and action options (-i, -f, -l, -eval) are sorted
stably. Parsing them and doing sane things with them however is much
more sanely done in Lisp (and the action options cannot be executed
until then, anyway).
[There are notes in emacs.c and startup.el that indicate that somebody
(probably Mr. Preprocessor) would like to get everything except the
pdump options -sd and -nd out of emacs.c and into Lisp (those two
can't practically be moved out of C as they have to work right before
startup.el can be loaded).]
The second thing XEmacs does is set up the console. This is done
for technical reasons that may or may not be valid any more (they had
to do with the Xt event loop). This is not cheap if you're talking
about an X connection.
The third thing XEmacs does is initialize the Lisp engine. This
includes reading the dumpfile (if pdump).
Finally, XEmacs enters the normal top level read-eval-redisplay loop,
which is self-initializing. Part of the initialization is to finish
processing the command line.
SY> Yes it is[1]. So '--help' wouldn't be appropriate here. But
SY> a very terse "Illegal option: '-something'; if
'-something' is
SY> a filename please use '--file=-something'" would be enough.
This implies executing XEmacs three times to accomplish the task if
they aren't interested in editing a file with name beginning with "-",
but really forgot what option they want.
Since most users only use the command line for the -help, -version,
and -nw options (and maybe -vanilla), maybe that's not so bad, but
that's the kind of thing I mean by "we should be able to do better."
SY> [1] Incidently, M-! xemacs --help RET produced an output
SY> buffer of 104 lines here.
I believe I see some graffiti ... looking closer ... "Ben wuz here." :-)
I actually weeded out the verbiage in the 21.4 version at one point.
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.