lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev [PATCH] Forced exit capability for command scripts


From: Thomas Dickey
Subject: Re: lynx-dev [PATCH] Forced exit capability for command scripts
Date: Sat, 29 Jun 2002 08:46:56 -0400
User-agent: Mutt/1.3.27i

On Sat, Jun 29, 2002 at 03:30:37PM +0300, Ville Herva wrote:
> [Please CC - I'm not subscribed to lynx-dev.]
> 
> Thomas Dickey wrote:
> > > Thinking of the busy loop patch I sent earlier: on the other hand it makes
> > > sense to continue when the script stream runs dry - that way you can make
> > > a script that logs you in to somewhere and then continue interactively.
> > > OTOH, when you use -cmd_script from scripts (as I do) you really want lynx
> > > to exits once everything is done.
> > >
> > > The attached patch implements an "exit" statement to cmd_scripts. Once 
> > > exit
> > > is encountered, lynx is forced to exit. 
> > 
> > actually it already has a "quit" command.
> 
> Hmm. I feel stupid now :).

no need (I wrote the related code)
 
> Anyhow:
> 
> 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.

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]