lynx-dev
[Top][All Lists]
Advanced

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

LYNX-DEV extended "show color" choice


From: Klaus Weide
Subject: LYNX-DEV extended "show color" choice
Date: Thu, 24 Jul 1997 11:40:15 -0500 (CDT)

On Thu, 24 Jul 1997, Alex Lyons  AEA Technology Winfrith wrote:

> Sounds to me like whar's needed is a 3-state colour option:
>  OFF   - never use colour regardless of terminal type;
>  MAYBE - use color if the terminal type indicates that it is supported;
>  ON    - always try to use color regardless of terminal type.
> The default would be MAYBE, but could be changed by a saved setting in 
> .lynxrc,
> and finally could be changed to ON or OFF by the command line options.

Yes, that's similar to what I've been thinking.  But there are really
two things involved, think of it as two different variables: (1) the
persistent "show_color" preference, which can get inherited across
sessions, and which can have the three states above (MAYBE is
equivalent to absense of a "show_color:" line in the .lynxrc file).
(2) The current state, indicating whether color is being used right
now.  The value can be turned ON or OFF on the 'O'ptions Screen, and
should appear there always indicating the current state correctly.
On startup, its initial value depends on various things, among them
the persistent "show_color" preference (1).

Here is what I have come up with to combine this into one "show color"
field on the 'O'ptions Screen:

If the binary doesn't support color, the option does not appear.
Otherwise, for anonymous users (if .lynxrc saving is not supported),
there is just ON and OFF.  This is all as before.

For non-anonymous users with color supported, "show color (&)" is a
four-way choice between:
          Always OFF
          OFF
          ON
          Always ON

Selecting one of the "Always" alternatives means that the setting will
be saved in .lynxrc (if '>' is pressed later), in addition to turning
color OFF or ON immediately.  Selecting just "OFF" or "ON" means that
not preference will be saved in .lynxrc when '>' is pressed
(equivalent to Alex's MAYBE).  (This is modified for the case of color-
curses with a non-color terminal, so that ON cannot be selected.)

Generating the initial choice (when the 'O'ptions Screen is shown for
the first time, before a user presses '&') is tricky, because that
determines what gets written to .lynxrc if the user saves without
bothering to change or even look at the "show color" field.  I set it
to just plain "OFF" or "ON" if no "show_color:" line was in .lynxrc
before; to "Always OFF" or "Always ON" if such a line was found AND
the preference given by it is still in effect; and to plain "OFF" or
"ON" if a "show_color:" line was present but was overriden by a
command line flag.  This should prevent accidentally saving a
show_color preference in all cases if it wasn't already there, and
also should prevent accidentally "losing" a preference when saving
with '>' under normal circumstances.

Does this make sense?  I have code which does what I tried to describe,
and I'll put it in the development code if nobody protests.


     Klaus



;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

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