On Sat, Jun 29, 2002 at 08:46:56AM -0400, you [Thomas Dickey] wrote: > > > > k.script > > ---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<--- > > key g > > key h > > key t > > key t > > key p > > key : > > key / > > key / > > exit > > ---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<--- > > > > Doing > > > > lynx -cmd_script=/tmp/k.script http://www.hut.fi > > > > with the exit-patch, lynx immediately exits. > > > > If I replace "exit" with "quit", it doesn't. (This is with 2.8.5dev8). > > Also, grep -i quit **/*.[ch] doesn't immediately reveal where the "quit" > > command is implemented... > > it's probably in the yes/no prompt code (a "key y" and "key \n" might fix it) > > Look for uppercase "QUIT", in src/LYKeymap.c > > Basically all of the single-keystrokes are mapped into commands which can be > typed by entering ":" first. I implemented the ":" prompt to be like vi/ex, so > I could add other commands which did not happen to be bound to single > keystrokes.
If I understand this correctly, the difference is, that "exit" will exit immediately and unconditionally. In the example script above, we are entering an URL after a 'g' command. Pressing 'Q' then does not work. The example is dull, but the reasoning is that if the web page changes (or there is some other unanticipated condition, such as a network problem), we may be in any unexpected state when the command script ends. If command scripts are executed from shell scripts it is important that lynx will exit no matter what rather than waiting for a key press. You can propably achieve this with a suitable combination such as "key ^C" - "key Q", but I thought an explicit command was cleaner (although my implementation necessarly isn't.) -- v -- [EMAIL PROTECTED] ; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to [EMAIL PROTECTED]
