lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev broken "toggle" options (was Command-line options syntax)


From: Klaus Weide
Subject: lynx-dev broken "toggle" options (was Command-line options syntax)
Date: Mon, 2 Aug 1999 10:40:39 -0500 (CDT)

On Sun, 1 Aug 1999, Doug Kaufman wrote:
> On Sun, 1 Aug 1999, Klaus Weide wrote:
> 
> > > when the initial boolean value is FALSE. When the initial value is
> > > TRUE, this can give unexpected results (e.g. -show_cursor shows the
> > > cursor only when -showcursor=off). 
> > 
> > I think you meant: 
> >   (e.g. -show_cursor shows the cursor only when -show_cursor=on)
> > 
> > Or do I misunderstand?
> 
> I meant exactly what I said. You get the exact opposite result as
> would be expected.

Sorry, I could have checked myself - which I have finally done now.
Yes, I see the same with 2.8.3dev.4.

Your cautious formulations ("can give unexpected results") made me
think you must mean something more subtle.  Had you just said "It is
completely broken" (which it is), I would have understood better. :)

This seems to have been broken for quite some time.  At least the
Debian lynx 2.8.1-3 package shows the same behavior.

However, if show_cursor defaults to TRUE, by .lynxrc or (if no .lynxrc)
by lynx.cfg, then -show_cursor+, -show_cursor=on, -show_cursor-, and
-show_cursor=off turn out to do the expected thing!

It turns out popup is similarly broken.  Only in this case the default
for LYSelectPopups is TRUE for most people, so the error appears only
for people who have changed the default in userdefs.h / lynx.cfg / .lynxrc.

> -show_cursor is equivalent to -show_cursor=off or
> to -show_cursor-. This starts with BOOLEAN TRUE and is toggled to
> FALSE by -show_cursor. 

The whole problem comes from using two variables for controlling the
show_cursor setting, LYShowCursor and LYUseDefShoCur.  This circuitous
route shouldn't be necessary at all.  LYShowCursor should be manipulated
directly in LYMain.c, as for numerous other boolean options, we can
get rid of LYUseDefShoCur.  The more direct approach seems to work for
other boolean options, I see no reason why show_cursor should be
different.

LYSelectPopups / LYUseDefSelPop seems to be another case of this.

I looked at older code (2.7.1dev.something), and couldn't find a good
*reason* for the different handling of these two flags from others
there either.  But at least things worked as expected, because the two
options were handled differently in parse_arg() from other toggles:
...
    } else if (strncmp(argv[0], "-show_cursor", 12) == 0) {
        LYUseDefShoCur = FALSE;
...
and
    } else if (strncmp(argv[0], "-popup", 6) == 0) {
        LYUseDefSelPop = FALSE;

...
as compared to (just one example for another toggle):
...
    if (strncmp(argv[0], "-image_links", 12) == 0) {
        if (clickable_images)
            clickable_images = FALSE;
        else
            clickable_images = TRUE;
...

Hmm, now that I compare these I notice there *is* a difference in
*toggling* behavior.  Describing the 2.7.1dev version now,
corresponding to the code snippets above:
 - The -show_cursor and -popup options revert the sense of the
   default (from userdefs.h, lynx.cfg, .lynxrc), but not of
   previous occurrences of the same option on the command line.
   'lynx -show_cursor -show_cursor' is the same as
   'lynx -show_cursor'.
 - other toggles really toggle...
   'lynx -image_links -image_links' is not the same as 
   'lynx -image_links'.

So either this difference in behavior is not worth preserving (or
reverting to), then we can get rid of the LYUseDef* variables; or it
is worth preserving, and then -show_cursor and -popup need to be fixed
some other way (by changing the way LYUseDefShoCur and LYUseDefSelPop
are handled when -show_cursor and -popup are encountered).

  Klaus


reply via email to

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