diff options
-rw-r--r-- | CHANGES | 10 | ||||
-rw-r--r-- | lynx.cfg | 6 | ||||
-rw-r--r-- | lynx.hlp | 454 | ||||
-rw-r--r-- | lynx.man | 5 | ||||
-rw-r--r-- | src/LYCurses.c | 73 | ||||
-rw-r--r-- | src/LYCurses.h | 7 | ||||
-rw-r--r-- | src/LYGlobalDefs.h | 5 | ||||
-rw-r--r-- | src/LYMain.c | 11 | ||||
-rw-r--r-- | src/LYOptions.c | 62 | ||||
-rw-r--r-- | src/LYReadCFG.c | 40 | ||||
-rw-r--r-- | src/LYReadCFG.h | 3 | ||||
-rw-r--r-- | src/LYStyle.c | 14 |
12 files changed, 414 insertions, 276 deletions
diff --git a/CHANGES b/CHANGES index 83c43e8a..57bf4618 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,15 @@ --- $LynxId: CHANGES,v 1.645 2013/05/29 01:08:07 tom Exp $ +-- $LynxId: CHANGES,v 1.648 2013/06/02 20:03:10 tom Exp $ =============================================================================== Changes since Lynx 2.8 release =============================================================================== -2013-05-28 (2.8.8dev.16) +2013-06-02 (2.8.8dev.16) +* add on/off toggles to options menu for the color-style and default-colors + features, to help deal with packages which enable default colors without + adjusting the color-style settings to avoid having yellow text on a white + background (report by Stephen Isard) -TD +* add -default-colors command-line option to allow toggling the state of the + DEFAULT_COLORS setting from lynx.cfg -TD * improve discussion of -dump and -force_html in manpage (Ubuntu #1112568) -TD * cleanup quoting and use of ASCII "-" versus hyphen in manpage -TD * add checks for zero-length strings in a few places to prevent infinite loop diff --git a/lynx.cfg b/lynx.cfg index 8cff66f2..9f36dbe0 100644 --- a/lynx.cfg +++ b/lynx.cfg @@ -1,4 +1,4 @@ -# $LynxId: lynx.cfg,v 1.224 2013/04/30 09:50:29 tom Exp $ +# $LynxId: lynx.cfg,v 1.225 2013/06/02 20:06:02 tom Exp $ # lynx.cfg file. # The default placement for this file is /usr/local/lib/lynx.cfg (Unix) # or Lynx_Dir:lynx.cfg (VMS) @@ -2915,7 +2915,9 @@ MINIMAL_COMMENTS:TRUE .h1 Appearance .h2 COLOR -# COLORS (only available if compiled with SVr4 curses or slang) +# COLORS are only available if compiled with SVr4 curses or slang. This is +# the old color configuration. The COLOR_STYLE configuration is compiled-in +# and can simulate this if the ".lss" filename is empty. # # The line must be of the form: # diff --git a/lynx.hlp b/lynx.hlp index 414b002c..7358a174 100644 --- a/lynx.hlp +++ b/lynx.hlp @@ -209,6 +209,10 @@ -debug_partial separate incremental display stages with MessageSecs delay + -default-colors + toggles the default-colors feature which is normally set in the + lynx.cfg file. + -delay add DebugSecs delay after each progress-message -display=DISPLAY @@ -218,30 +222,30 @@ set the charset for the terminal output. -dont_wrap_pre - inhibit wrapping of text when -dump'ing and -crawl'ing, mark + inhibit wrapping of text when -dump'ing and -crawl'ing, mark wrapped lines of <pre> in interactive session. - -dump dumps the formatted output of the default document or those - specified on the command line to standard output. Unlike + -dump dumps the formatted output of the default document or those + specified on the command line to standard output. Unlike interactive mode, all documents are processed. This can be used in the following way: lynx -dump http://www.subir.com/lynx.html - Files specified on the command line are formatted as HTML if - their names end with one of the standard web suffixes such as - ".htm" or ".html". Use the -force_html option to format files + Files specified on the command line are formatted as HTML if + their names end with one of the standard web suffixes such as + ".htm" or ".html". Use the -force_html option to format files whose names do not follow this convention. -editor=EDITOR - enable external editing, using the specified EDITOR. (vi, ed, + enable external editing, using the specified EDITOR. (vi, ed, emacs, etc.) -emacskeys enable emacs-like key movement. -enable_scrollback - toggles compatibility with communication programs' scrollback + toggles compatibility with communication programs' scrollback keys (may be incompatible with some curses packages). -error_file=FILE @@ -254,20 +258,20 @@ -find_leaks toggle memory leak-checking. Normally this is not compiled-into - your executable, but when it is, it can be disabled for a + your executable, but when it is, it can be disabled for a session. -force_empty_hrefless_a - force HREF-less `A' elements to be empty (close them as soon as + force HREF-less `A' elements to be empty (close them as soon as they are seen). -force_html - forces the first document to be interpreted as HTML. This is - most useful when processing files specified on the command line - which have an unrecognized suffix (or the suffix is associated - with a non-HTML type, such as ".txt" for plain text files). + forces the first document to be interpreted as HTML. This is + most useful when processing files specified on the command line + which have an unrecognized suffix (or the suffix is associated + with a non-HTML type, such as ".txt" for plain text files). Lynx recognizes these file suffixes as HTML: - ".ht3", ".htm", ".html3", ".html", ".htmlx", ".php3", ".php", + ".ht3", ".htm", ".html3", ".html", ".htmlx", ".php3", ".php", ".phtml", ".sht", and ".shtml". -force_secure @@ -281,7 +285,7 @@ -ftp disable ftp access. -get_data - properly formatted data for a get form are read in from the + properly formatted data for a get form are read in from the standard input and passed to the form. Input is terminated by a line that starts with `---'. @@ -293,14 +297,14 @@ control the display of hidden links. merge - hidden links show up as bracketed numbers and are numbered + hidden links show up as bracketed numbers and are numbered together with other links in the sequence of their occurrence in the document. listonly - hidden links are shown only on L)ist screens and listings - generated by -dump or from the P)rint menu, but appear - separately at the end of those lists. This is the default + hidden links are shown only on L)ist screens and listings + generated by -dump or from the P)rint menu, but appear + separately at the end of those lists. This is the default behavior. ignore @@ -318,7 +322,7 @@ -index=URL set the default index file to the specified URL. - -ismap toggles inclusion of ISMAP links when client-side MAPs are + -ismap toggles inclusion of ISMAP links when client-side MAPs are present. -justify @@ -334,17 +338,17 @@ disable URLs that point to remote hosts. -locexec - enable local program execution from local files only (if Lynx + enable local program execution from local files only (if Lynx was compiled with local execution enabled). -lss=FILENAME - specify filename containing color-style information. The + specify filename containing color-style information. The default is lynx.lss. If you give an empty filename, lynx uses a - built-in monochrome scheme which imitates the non-color-style + built-in monochrome scheme which imitates the non-color-style configuration. -mime_header - prints the MIME header of a fetched document along with its + prints the MIME header of a fetched document along with its source. -minimal @@ -366,11 +370,11 @@ disable directory browsing. -nocc disable Cc: prompts for self copies of mailings. Note that this - does not disable any CCs which are incorporated within a mailto + does not disable any CCs which are incorporated within a mailto URL or form ACTION. -nocolor - force color mode off, overriding terminal capabilities and any + force color mode off, overriding terminal capabilities and any -color flags, COLORTERM variable, and saved .lynxrc settings. -noexec @@ -391,13 +395,13 @@ disable -more- string in statusline messages. -nonrestarting_sigwinch - This flag is not available on all systems, Lynx needs to be - compiled with HAVE_SIGACTION defined. If available, this flag - may cause Lynx to react more immediately to window changes when + This flag is not available on all systems, Lynx needs to be + compiled with HAVE_SIGACTION defined. If available, this flag + may cause Lynx to react more immediately to window changes when run within an xterm. -nonumbers - disable link- and field-numbering. This overrides + disable link- and field-numbering. This overrides -number_fields and -number_links. -nopause @@ -407,7 +411,7 @@ disable most print functions. -noredir - prevents automatic redirection and prints a message with a link + prevents automatic redirection and prints a message with a link to the new URL. -noreferer @@ -445,20 +449,20 @@ toggles passive ftp connections. -pauth=ID:PASSWD - set authorization ID and password for a protected proxy server - at startup. Be sure to protect any script files which use this + set authorization ID and password for a protected proxy server + at startup. Be sure to protect any script files which use this switch. - -popup toggles handling of single-choice SELECT options via popup + -popup toggles handling of single-choice SELECT options via popup windows or as lists of radio buttons. -post_data - properly formatted data for a post form are read in from the + properly formatted data for a post form are read in from the standard input and passed to the form. Input is terminated by a line that starts with `---'. -preparsed - show HTML source preparsed and reformatted when used with + show HTML source preparsed and reformatted when used with -source or in source view. -prettysrc @@ -469,7 +473,7 @@ -pseudo_inlines toggles pseudo-ALTs for inline images with no ALT string. - -raw toggles default setting of 8-bit character translations or CJK + -raw toggles default setting of 8-bit character translations or CJK mode for the startup character set. -realm restricts access to URLs in the starting realm. @@ -478,12 +482,12 @@ Sets the read-timeout, where N is given in seconds. -reload - flushes the cache on a proxy server (only the first document + flushes the cache on a proxy server (only the first document affected). -restrictions=[option][,option][,option]... - allows a list of services to be disabled selectively. Dashes - and underscores in option names can be intermixed. The + allows a list of services to be disabled selectively. Dashes + and underscores in option names can be intermixed. The following list is printed if no options are specified. all @@ -496,18 +500,18 @@ disallow execution links via the bookmark file. change_exec_perms - disallow changing the eXecute permission on files (but still - allow it for directories) when local file management is + disallow changing the eXecute permission on files (but still + allow it for directories) when local file management is enabled. default - same as command line option -anonymous. Disables default - services for anonymous users. Set to all restricted, except - for: inside_telnet, outside_telnet, inside_ftp, outside_ftp, - inside_rlogin, outside_rlogin, inside_news, outside_news, + same as command line option -anonymous. Disables default + services for anonymous users. Set to all restricted, except + for: inside_telnet, outside_telnet, inside_ftp, outside_ftp, + inside_rlogin, outside_rlogin, inside_news, outside_news, telnet_port, jump, mail, print, exec, and goto. The settings - for these, as well as additional goto restrictions for - specific URL schemes that are also applied, are derived from + for these, as well as additional goto restrictions for + specific URL schemes that are also applied, are derived from definitions within userdefs.h. dired_support @@ -520,7 +524,7 @@ disallow access to, or creation of, hidden (dot) files. download - disallow some downloaders in the download menu (does not + disallow some downloaders in the download menu (does not imply disk_save restriction). editor @@ -533,12 +537,12 @@ disallow the user from changing the local execution option. externals - disallow some "EXTERNAL" configuration lines if support for + disallow some "EXTERNAL" configuration lines if support for passing URLs to external applications (with the EXTERN command) is compiled in. file_url - disallow using G)oto, served links or bookmarks for file: + disallow using G)oto, served links or bookmarks for file: URLs. goto @@ -549,15 +553,15 @@ required for selectivity). inside_news - disallow USENET news posting for people coming from inside + disallow USENET news posting for people coming from inside your domain (utmp required for selectivity). inside_rlogin - disallow rlogins for people coming from inside your domain + disallow rlogins for people coming from inside your domain (utmp required for selectivity). inside_telnet - disallow telnets for people coming from inside your domain + disallow telnets for people coming from inside your domain (utmp required for selectivity). jump @@ -576,22 +580,22 @@ disallow saving options in .lynxrc. outside_ftp - disallow ftps for people coming from outside your domain + disallow ftps for people coming from outside your domain (utmp required for selectivity). outside_news - disallow USENET news reading and posting for people coming - from outside your domain (utmp required for selectivity). - This restriction applies to "news", "nntp", "newspost", and - "newsreply" URLs, but not to "snews", "snewspost", or + disallow USENET news reading and posting for people coming + from outside your domain (utmp required for selectivity). + This restriction applies to "news", "nntp", "newspost", and + "newsreply" URLs, but not to "snews", "snewspost", or "snewsreply" in case they are supported. outside_rlogin - disallow rlogins for people coming from outside your domain + disallow rlogins for people coming from outside your domain (utmp required for selectivity). outside_telnet - disallow telnets for people coming from outside your domain + disallow telnets for people coming from outside your domain (utmp required for selectivity). print @@ -610,8 +614,8 @@ disallow modifications of the User-Agent header. -resubmit_posts - toggles forced resubmissions (no-cache) of forms with method - POST when the documents they returned are sought with the + toggles forced resubmissions (no-cache) of forms with method + POST when the documents they returned are sought with the PREV_DOC command or from the History List. -rlogin @@ -637,7 +641,7 @@ saves session to specified file. -short_url - show very long URLs in the status line with "..." to represent + show very long URLs in the status line with "..." to represent the portion which cannot be displayed. The beginning and end of the URL are displayed, rather than suppressing the end. @@ -646,31 +650,31 @@ and exit. -show_cursor - If enabled the cursor will not be hidden in the right hand - corner but will instead be positioned at the start of the + If enabled the cursor will not be hidden in the right hand + corner but will instead be positioned at the start of the currently selected link. Show cursor is the default for systems - without FANCY_CURSES capabilities. The default configuration - can be changed in userdefs.h or lynx.cfg. The command line + without FANCY_CURSES capabilities. The default configuration + can be changed in userdefs.h or lynx.cfg. The command line switch toggles the default. -show_rate - If enabled the transfer rate is shown in bytes/second. If - disabled, no transfer rate is shown. Use lynx.cfg or the + If enabled the transfer rate is shown in bytes/second. If + disabled, no transfer rate is shown. Use lynx.cfg or the options menu to select KB/second and/or ETA. -soft_dquotes - toggles emulation of the old Netscape and Mosaic bug which + toggles emulation of the old Netscape and Mosaic bug which treated `>' as a co-terminator for double-quotes and tags. -source - works the same as dump but outputs HTML source instead of + works the same as dump but outputs HTML source instead of formatted text. For example lynx -source . >foo.html - generates HTML source listing the files in the current - directory. Each file is marked by an HREF relative to the - parent directory. Add a trailing slash to make the HREF's + generates HTML source listing the files in the current + directory. Each file is marked by an HREF relative to the + parent directory. Add a trailing slash to make the HREF's relative to the current directory: lynx -source ./ >foo.html @@ -682,9 +686,9 @@ allow non-http startfile and homepage with -validate. -stderr - When dumping a document using -dump or -source, Lynx normally - does not display alert (error) messages that you see on the - screen in the status line. Use the -stderr option to tell Lynx + When dumping a document using -dump or -source, Lynx normally + does not display alert (error) messages that you see on the + screen in the status line. Use the -stderr option to tell Lynx to write these messages to the standard error. -stdin read the startfile from standard input (UNIX only). @@ -702,25 +706,25 @@ disable recognition of telnet commands. -term=TERM - tell Lynx what terminal type to assume it is talking to. (This - may be useful for remote execution, when, for example, Lynx - connects to a remote TCP/IP port that starts a script that, in + tell Lynx what terminal type to assume it is talking to. (This + may be useful for remote execution, when, for example, Lynx + connects to a remote TCP/IP port that starts a script that, in turn, starts another Lynx process.) -timeout=N - For win32, sets the network read-timeout, where N is given in + For win32, sets the network read-timeout, where N is given in seconds. - -tlog toggles between using a Lynx Trace Log and stderr for trace + -tlog toggles between using a Lynx Trace Log and stderr for trace output from the session. -tna turns on "Textfields Need Activation" mode. - -trace turns on Lynx trace mode. Destination of trace output depends + -trace turns on Lynx trace mode. Destination of trace output depends on -tlog. -trace_mask=value - turn on optional traces, which may result in very large trace + turn on optional traces, which may result in very large trace files. Logically OR the values to combine options: 1 SGML character parsing states @@ -729,7 +733,7 @@ 4 TRST (table layout) - 8 configuration (lynx.cfg, .lynxrc, .lynx-keymaps, mime.types + 8 configuration (lynx.cfg, .lynxrc, .lynx-keymaps, mime.types and mailcap contents) 16 binary string copy/append, used in form data construction. @@ -745,9 +749,9 @@ timing -traversal - traverse all http links derived from startfile. When used with - -crawl, each link that begins with the same string as startfile - is output to a file, intended for indexing. See CRAWL.announce + traverse all http links derived from startfile. When used with + -crawl, each link that begins with the same string as startfile + is output to a file, intended for indexing. See CRAWL.announce for more information. -trim_input_fields @@ -760,29 +764,29 @@ toggles use of _underline_ format in dumps. -unique_urls - check for duplicate link numbers in each page and corresponding + check for duplicate link numbers in each page and corresponding lists, and reuse the original link number. -use_mouse - turn on mouse support, if available. Clicking the left mouse - button on a link traverses it. Clicking the right mouse button - pops back. Click on the top line to scroll up. Click on the - bottom line to scroll down. The first few positions in the top - and bottom line may invoke additional functions. Lynx must be - compiled with ncurses or slang to support this feature. If - ncurses is used, clicking the middle mouse button pops up a - simple menu. Mouse clicks may only work reliably while Lynx is + turn on mouse support, if available. Clicking the left mouse + button on a link traverses it. Clicking the right mouse button + pops back. Click on the top line to scroll up. Click on the + bottom line to scroll down. The first few positions in the top + and bottom line may invoke additional functions. Lynx must be + compiled with ncurses or slang to support this feature. If + ncurses is used, clicking the middle mouse button pops up a + simple menu. Mouse clicks may only work reliably while Lynx is idle waiting for input. -useragent=Name set alternate Lynx User-Agent header. -validate - accept only http URLs (for validation). Complete security + accept only http URLs (for validation). Complete security restrictions also are implemented. -verbose - toggle [LINK], [IMAGE] and [INLINE] comments with filenames of + toggle [LINK], [IMAGE] and [INLINE] comments with filenames of these images. -version @@ -792,13 +796,13 @@ enable vi-like key movement. -wdebug - enable Waterloo tcp/ip packet debug (print to watt debugfile). - This applies only to DOS versions compiled with WATTCP or + enable Waterloo tcp/ip packet debug (print to watt debugfile). + This applies only to DOS versions compiled with WATTCP or WATT-32. -width=NUMBER - number of columns for formatting of dumps, default is 80. This - is limited by the number of columns that Lynx could display, + number of columns for formatting of dumps, default is 80. This + is limited by the number of columns that Lynx could display, typically 1024 (the MAX_LINE symbol). -with_backspaces @@ -816,183 +820,183 @@ o Left Arrow will retreat from a link. - o Type "H" or "?" for online help and descriptions of key-stroke + o Type "H" or "?" for online help and descriptions of key-stroke commands. - o Type "K" for a complete list of the current key-stroke command + o Type "K" for a complete list of the current key-stroke command mappings. 2 Environment - In addition to various "standard" environment variables such as HOME, - PATH, USER, DISPLAY, TMPDIR, etc, Lynx utilizes several Lynx-specific + In addition to various "standard" environment variables such as HOME, + PATH, USER, DISPLAY, TMPDIR, etc, Lynx utilizes several Lynx-specific environment variables, if they exist. - Others may be created or modified by Lynx to pass data to an external + Others may be created or modified by Lynx to pass data to an external program, or for other reasons. These are listed separately below. - See also the sections on SIMULATED CGI SUPPORT and NATIVE LANGUAGE + See also the sections on SIMULATED CGI SUPPORT and NATIVE LANGUAGE SUPPORT, below. - Note: Not all environment variables apply to all types of platforms - supported by Lynx, though most do. Feedback on platform dependencies + Note: Not all environment variables apply to all types of platforms + supported by Lynx, though most do. Feedback on platform dependencies is solicited. Environment Variables Used By Lynx: COLORTERM If set, color capability for the terminal is forced - on at startup time. The actual value assigned to - the variable is ignored. This variable is only + on at startup time. The actual value assigned to + the variable is ignored. This variable is only meaningful if Lynx was built using the slang screen-handling library. - LYNX_CFG This variable, if set, will override the default - location and name of the global configuration file - (normally, lynx.cfg) that was defined by the + LYNX_CFG This variable, if set, will override the default + location and name of the global configuration file + (normally, lynx.cfg) that was defined by the LYNX_CFG_FILE constant in the userdefs.h file, - during installation. See the userdefs.h file for + during installation. See the userdefs.h file for more information. LYNX_HELPFILE If set, this variable overrides the compiled-in URL and configuration file URL for the Lynx help file. - LYNX_LOCALEDIR If set, this variable overrides the compiled-in - location of the locale directory which contains + LYNX_LOCALEDIR If set, this variable overrides the compiled-in + location of the locale directory which contains native language (NLS) message text. - LYNX_LSS This variable, if set, specifies the location of - the default Lynx character style sheet file. - [Currently only meaningful if Lynx was built using + LYNX_LSS This variable, if set, specifies the location of + the default Lynx character style sheet file. + [Currently only meaningful if Lynx was built using experimental color style support.] - LYNX_SAVE_SPACE This variable, if set, will override the default + LYNX_SAVE_SPACE This variable, if set, will override the default path prefix for files saved to disk that is defined - in the lynx.cfg SAVE_SPACE: statement. See the + in the lynx.cfg SAVE_SPACE: statement. See the lynx.cfg file for more information. - LYNX_TEMP_SPACE This variable, if set, will override the default - path prefix for temporary files that was defined - during installation, as well as any value that may + LYNX_TEMP_SPACE This variable, if set, will override the default + path prefix for temporary files that was defined + during installation, as well as any value that may be assigned to the TMPDIR variable. MAIL This variable specifies the default inbox Lynx will - check for new mail, if such checking is enabled in + check for new mail, if such checking is enabled in the lynx.cfg file. - NEWS_ORGANIZATION This variable, if set, provides the string used in - the Organization: header of USENET news postings. - It will override the setting of the ORGANIZATION - environment variable, if it is also set (and, on + NEWS_ORGANIZATION This variable, if set, provides the string used in + the Organization: header of USENET news postings. + It will override the setting of the ORGANIZATION + environment variable, if it is also set (and, on UNIX, the contents of an /etc/organization file, if present). - NNTPSERVER If set, this variable specifies the default NNTP - server that will be used for USENET news reading + NNTPSERVER If set, this variable specifies the default NNTP + server that will be used for USENET news reading and posting with Lynx, via news: URL's. - ORGANIZATION This variable, if set, provides the string used in - the Organization: header of USENET news postings. - On UNIX, it will override the contents of an + ORGANIZATION This variable, if set, provides the string used in + the Organization: header of USENET news postings. + On UNIX, it will override the contents of an /etc/organization file, if present. PROTOCOL_proxy Lynx supports the use of proxy servers that can act as firewall gateways and caching servers. They are - preferable to the older gateway servers (see - WWW_access_GATEWAY, below). Each protocol used by - Lynx, (http, ftp, gopher, etc), can be mapped - separately by setting environment variables of the - form PROTOCOL_proxy (literally: http_proxy, + preferable to the older gateway servers (see + WWW_access_GATEWAY, below). Each protocol used by + Lynx, (http, ftp, gopher, etc), can be mapped + separately by setting environment variables of the + form PROTOCOL_proxy (literally: http_proxy, ftp_proxy, gopher_proxy, etc), to - "http://some.server.dom:port/". See Lynx Users + "http://some.server.dom:port/". See Lynx Users Guide for additional details and examples. - SSL_CERT_DIR Set to the directory containing trusted + SSL_CERT_DIR Set to the directory containing trusted certificates. - SSL_CERT_FILE Set to the full path and filename for your file of + SSL_CERT_FILE Set to the full path and filename for your file of trusted certificates. - WWW_access_GATEWAY Lynx still supports use of gateway servers, with - the servers specified via "WWW_access_GATEWAY" - variables (where "access" is lower case and can be - "http", "ftp", "gopher" or "wais"), however most - gateway servers have been discontinued. Note that + WWW_access_GATEWAY Lynx still supports use of gateway servers, with + the servers specified via "WWW_access_GATEWAY" + variables (where "access" is lower case and can be + "http", "ftp", "gopher" or "wais"), however most + gateway servers have been discontinued. Note that you do not include a terminal `/' for gateways, but - do for proxies specified by PROTOCOL_proxy - environment variables. See Lynx Users Guide for + do for proxies specified by PROTOCOL_proxy + environment variables. See Lynx Users Guide for details. - WWW_HOME This variable, if set, will override the default - startup URL specified in any of the Lynx + WWW_HOME This variable, if set, will override the default + startup URL specified in any of the Lynx configuration files. Environment Variables Set or Modified By Lynx: - LYNX_PRINT_DATE This variable is set by the Lynx p(rint) function, - to the Date: string seen in the document's - "Information about" page (= cmd), if any. It is - created for use by an external program, as defined - in a lynx.cfg PRINTER: definition statement. If - the field does not exist for the document, the - variable is set to a null string under UNIX, or "No - Date" under VMS. - - LYNX_PRINT_LASTMOD This variable is set by the Lynx p(rint) function, - to the Last Mod: string seen in the document's + LYNX_PRINT_DATE This variable is set by the Lynx p(rint) function, + to the Date: string seen in the document's "Information about" page (= cmd), if any. It is created for use by an external program, as defined in a lynx.cfg PRINTER: definition statement. If the field does not exist for the document, the variable is set to a null string under UNIX, or "No - LastMod" under VMS. + Date" under VMS. - LYNX_PRINT_TITLE This variable is set by the Lynx p(rint) function, - to the Linkname: string seen in the document's + LYNX_PRINT_LASTMOD This variable is set by the Lynx p(rint) function, + to the Last Mod: string seen in the document's "Information about" page (= cmd), if any. It is created for use by an external program, as defined in a lynx.cfg PRINTER: definition statement. If the field does not exist for the document, the variable is set to a null string under UNIX, or "No - Title" under VMS. + LastMod" under VMS. - LYNX_PRINT_URL This variable is set by the Lynx p(rint) function, - to the URL: string seen in the document's + LYNX_PRINT_TITLE This variable is set by the Lynx p(rint) function, + to the Linkname: string seen in the document's "Information about" page (= cmd), if any. It is created for use by an external program, as defined in a lynx.cfg PRINTER: definition statement. If the field does not exist for the document, the variable is set to a null string under UNIX, or "No + Title" under VMS. + + LYNX_PRINT_URL This variable is set by the Lynx p(rint) function, + to the URL: string seen in the document's + "Information about" page (= cmd), if any. It is + created for use by an external program, as defined + in a lynx.cfg PRINTER: definition statement. If + the field does not exist for the document, the + variable is set to a null string under UNIX, or "No URL" under VMS. LYNX_TRACE If set, causes Lynx to write a trace file as if the -trace option were supplied. LYNX_TRACE_FILE If set, overrides the compiled-in name of the trace - file, which is either Lynx.trace or LY-TRACE.LOG - (the latter on the DOS platform). The trace file + file, which is either Lynx.trace or LY-TRACE.LOG + (the latter on the DOS platform). The trace file is in either case relative to the home directory. - LYNX_VERSION This variable is always set by Lynx, and may be - used by an external program to determine if it was - invoked by Lynx. See also the comments in the - distribution's sample mailcap file, for notes on + LYNX_VERSION This variable is always set by Lynx, and may be + used by an external program to determine if it was + invoked by Lynx. See also the comments in the + distribution's sample mailcap file, for notes on usage in such a file. - TERM Normally, this variable is used by Lynx to - determine the terminal type being used to invoke + TERM Normally, this variable is used by Lynx to + determine the terminal type being used to invoke Lynx. If, however, it is unset at startup time (or - has the value "unknown"), or if the -term command- - line option is used (see OPTIONS section above), - Lynx will set or modify its value to the user - specified terminal type (for the Lynx execution - environment). Note: If set/modified by Lynx, the - values of the LINES and/or COLUMNS environment + has the value "unknown"), or if the -term command- + line option is used (see OPTIONS section above), + Lynx will set or modify its value to the user + specified terminal type (for the Lynx execution + environment). Note: If set/modified by Lynx, the + values of the LINES and/or COLUMNS environment variables may also be changed. 2 Simulated Cgi Support If built with the cgi-links option enabled, Lynx allows access to a cgi script directly without the need for an http daemon. - When executing such "lynxcgi scripts" (if enabled), the following + When executing such "lynxcgi scripts" (if enabled), the following variables may be set for simulating a CGI environment: CONTENT_LENGTH @@ -1021,98 +1025,98 @@ SERVER_SOFTWARE - Other environment variables are not inherited by the script, unless - they are provided via a LYNXCGI_ENVIRONMENT statement in the - configuration file. See the lynx.cfg file, and the (draft) CGI 1.1 + Other environment variables are not inherited by the script, unless + they are provided via a LYNXCGI_ENVIRONMENT statement in the + configuration file. See the lynx.cfg file, and the (draft) CGI 1.1 Specification <http://Web.Golux.Com/coar/cgi/draft-coar-cgi-v11-00.txt> for the definition and usage of these variables. - The CGI Specification, and other associated documentation, should be + The CGI Specification, and other associated documentation, should be consulted for general information on CGI script programming. 2 Native Language Support - If configured and installed with Native Language Support, Lynx will + If configured and installed with Native Language Support, Lynx will display status and other messages in your local language. See the file - ABOUT_NLS in the source distribution, or at your local GNU site, for + ABOUT_NLS in the source distribution, or at your local GNU site, for more information about internationalization. - The following environment variables may be used to alter default + The following environment variables may be used to alter default settings: - LANG This variable, if set, will override the default + LANG This variable, if set, will override the default message language. It is an ISO 639 two-letter code - identifying the language. Language codes are NOT + identifying the language. Language codes are NOT the same as the country codes given in ISO 3166. - LANGUAGE This variable, if set, will override the default + LANGUAGE This variable, if set, will override the default message language. This is a GNU extension that has - higher priority for setting the message catalog + higher priority for setting the message catalog than LANG or LC_ALL. LC_ALL and - LC_MESSAGES These variables, if set, specify the notion of + LC_MESSAGES These variables, if set, specify the notion of native language formatting style. They are POSIXly correct. LINGUAS This variable, if set prior to configuration, - limits the installed languages to specific values. - It is a space-separated list of two-letter codes. + limits the installed languages to specific values. + It is a space-separated list of two-letter codes. Currently, it is hard-coded to a wish list. - NLSPATH This variable, if set, is used as the path prefix + NLSPATH This variable, if set, is used as the path prefix for message catalogs. 2 Notes This is the Lynx v2.8.7 Release; development is in progress for 2.8.8. If you wish to contribute to the further development of Lynx, subscribe - to our mailing list. Send email to <lynx-dev-request@nongnu.org> with + to our mailing list. Send email to <lynx-dev-request@nongnu.org> with "subscribe lynx-dev" as the only line in the body of your message. - Send bug reports, comments, suggestions to <lynx-dev@nongnu.org> after + Send bug reports, comments, suggestions to <lynx-dev@nongnu.org> after subscribing. - Unsubscribe by sending email to <lynx-dev-request@nongnu.org> with - "unsubscribe lynx-dev" as the only line in the body of your message. + Unsubscribe by sending email to <lynx-dev-request@nongnu.org> with + "unsubscribe lynx-dev" as the only line in the body of your message. Do not send the unsubscribe message to the lynx-dev list, itself. 2 See Also - catgets(3), curses(3), environ(7), execve(2), ftp(1), gettext(GNU), - localeconv(3), ncurses(3), setlocale(3), slang(?), termcap(5), + catgets(3), curses(3), environ(7), execve(2), ftp(1), gettext(GNU), + localeconv(3), ncurses(3), setlocale(3), slang(?), termcap(5), terminfo(5), wget(GNU) Note that man page availability and section numbering is somewhat platform dependent, and may vary from the above references. - A section shown as (GNU), is intended to denote that the topic may be + A section shown as (GNU), is intended to denote that the topic may be available via an info page, instead of a man page (i.e., try "info subject", rather than "man subject"). - A section shown as (?) denotes that documentation on the topic exists, - but is not part of an established documentation retrieval system (see - the distribution files associated with the topic, or contact your System + A section shown as (?) denotes that documentation on the topic exists, + but is not part of an established documentation retrieval system (see + the distribution files associated with the topic, or contact your System Administrator for further information). 2 Acknowledgments - Lynx has incorporated code from a variety of sources along the way. - The earliest versions of Lynx included code from Earl Fogel of Comput- - ing Services at the University of Saskatchewan, who implemented HYPER- - REZ in the Unix environment. HYPERREZ was developed by Niel Larson of - Think.com and served as the model for the early versions of Lynx. + Lynx has incorporated code from a variety of sources along the way. + The earliest versions of Lynx included code from Earl Fogel of Comput- + ing Services at the University of Saskatchewan, who implemented HYPER- + REZ in the Unix environment. HYPERREZ was developed by Niel Larson of + Think.com and served as the model for the early versions of Lynx. Those versions also incorporated libraries from the Unix Gopher clients - developed at the University of Minnesota, and the later versions of - Lynx rely on the WWW client library code developed by Tim Berners-Lee - and the WWW community. Also a special thanks to Foteos Macrides who + developed at the University of Minnesota, and the later versions of + Lynx rely on the WWW client library code developed by Tim Berners-Lee + and the WWW community. Also a special thanks to Foteos Macrides who ported much of Lynx to VMS and did or organized most of its development - since the departures of Lou Montulli and Garrett Blythe from the Uni- - versity of Kansas in the summer of 1994 through the release of v2.7.2, - and to everyone on the net who has contributed to Lynx's development + since the departures of Lou Montulli and Garrett Blythe from the Uni- + versity of Kansas in the summer of 1994 through the release of v2.7.2, + and to everyone on the net who has contributed to Lynx's development either directly (through patches, comments or bug reports) or indirect- ly (through inspiration and development of other systems). 2 Authors - Lou Montulli, Garrett Blythe, Craig Lavender, Michael Grobe, Charles + Lou Montulli, Garrett Blythe, Craig Lavender, Michael Grobe, Charles Rezac Academic Computing Services University of Kansas diff --git a/lynx.man b/lynx.man index 07df679c..c3c2bac7 100644 --- a/lynx.man +++ b/lynx.man @@ -1,4 +1,4 @@ -.\" $LynxId: lynx.man,v 1.96 2013/05/29 01:04:13 tom Exp $ +.\" $LynxId: lynx.man,v 1.97 2013/06/02 20:34:05 tom Exp $ .\" ************************************************************************** .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds AQ \(aq @@ -265,6 +265,9 @@ Toggling this option makes the feature altogether unavailable. .B \-debug_partial separate incremental display stages with MessageSecs delay .TP +.B \-default-colors +toggles the default-colors feature which is normally set in the lynx.cfg file. +.TP .B \-delay add DebugSecs delay after each progress-message .TP diff --git a/src/LYCurses.c b/src/LYCurses.c index 06816c06..0959b716 100644 --- a/src/LYCurses.c +++ b/src/LYCurses.c @@ -1,4 +1,4 @@ -/* $LynxId: LYCurses.c,v 1.169 2013/05/03 23:19:18 tom Exp $ */ +/* $LynxId: LYCurses.c,v 1.173 2013/06/02 18:20:02 tom Exp $ */ #include <HTUtils.h> #include <HTAlert.h> @@ -914,12 +914,16 @@ void LYnoVideo(int a) } #define NEWTERM_NAME "newterm" -#if !defined(VMS) && !defined(USE_SLANG) -/* - * If newterm is not defined, assume a curses subset which - * supports only initscr. --gil - */ -#if defined(HAVE_NEWTERM) && defined(HAVE_DELSCREEN) && !defined(PDCURSES) && !(defined(NCURSES) && defined(HAVE_RESIZETERM)) + +#if !defined(VMS) && !defined(USE_SLANG) +#if defined(NCURSES) && defined(HAVE_RESIZETERM) + +static SCREEN *LYscreen = NULL; + +#define LYDELSCR() /* ncurses does not need this */ + +#elif defined(HAVE_NEWTERM) && defined(HAVE_DELSCREEN) && !defined(PDCURSES) + static SCREEN *LYscreen = NULL; #define LYDELSCR() { \ @@ -927,10 +931,13 @@ if (recent_sizechange) { \ CTRACE((tfp, "Screen size: delscreen()\n")); \ delscreen(LYscreen); \ LYscreen = NULL; } } -/* - * Surrogates for newterm and delscreen - */ + #else /* HAVE_NEWTERM */ + + /* + * If newterm is not defined, assume a curses subset which + * supports only initscr. --gil + */ static WINDOW *LYscreen = NULL; #undef NEWTERM_NAME @@ -939,12 +946,14 @@ static WINDOW *LYscreen = NULL; #define newterm(type, out, in) (initscr()) #define LYDELSCR() /* nothing */ #endif /* HAVE_NEWTERM */ + #else /* !defined(VMS) && !defined(USE_SLANG) */ -/* - * Provide last recourse definitions of LYscreen and LYDELSCR for - * stop_curses, which only tests LYscreen for zero/nonzero but - * never uses it as a pointer or L-value. - */ + + /* + * Provide last recourse definitions of LYscreen and LYDELSCR for + * stop_curses, which only tests LYscreen for zero/nonzero but + * never uses it as a pointer or L-value. + */ #define LYscreen TRUE #define LYDELSCR() /* nothing */ #endif /* !defined(VMS) && !defined(USE_SLANG) */ @@ -1143,6 +1152,39 @@ void recoverWindowSize(void) } #endif +#if defined(USE_DEFAULT_COLORS) +void restart_curses(void) +{ + SCREEN *oldscreen = LYscreen; + + if (!(LYscreen = newterm(NULL, stdout, stdin))) { /* start curses */ + fprintf(tfp, "%s\n", + gettext("Terminal reinitialisation failed - unknown terminal type?")); + exit_immediately(EXIT_FAILURE); + } + + /* force xterm mouse-mode off in the physical terminal */ + lynx_enable_mouse(0); + keypad(LYwin, FALSE); + wrefresh(LYwin); + + LYwin = stdscr; + /* reenable xterm mouse-mode in the new screen */ + keypad(LYwin, TRUE); + lynx_enable_mouse(1); + + if (-1 == lynx_initialize_keymaps()) { + endwin(); + exit_immediately(EXIT_FAILURE); + } + if (has_colors()) { + start_color(); + } + + delscreen(oldscreen); +} +#endif + void start_curses(void) { #ifdef USE_SLANG @@ -1400,6 +1442,7 @@ void start_curses(void) #endif #ifdef USE_DEFAULT_COLORS + update_default_colors(); if (LYuse_default_colors) { #if defined(EXP_ASSUMED_COLOR) && defined(USE_COLOR_TABLE) /* diff --git a/src/LYCurses.h b/src/LYCurses.h index e4abcb69..0a9c0ebe 100644 --- a/src/LYCurses.h +++ b/src/LYCurses.h @@ -1,4 +1,4 @@ -/* $LynxId: LYCurses.h,v 1.88 2011/06/05 19:19:26 tom Exp $ */ +/* $LynxId: LYCurses.h,v 1.90 2013/05/31 00:23:39 tom Exp $ */ #ifndef LYCURSES_H #define LYCURSES_H @@ -502,10 +502,11 @@ extern "C" { #if defined(USE_COLOR_STYLE) extern void curses_css(char *name, int dir); extern void curses_style(int style, int dir); + extern void curses_w_style(WINDOW * win, int style, int dir); extern void setHashStyle(int style, int color, int cattr, int mono, const char *element); extern void setStyle(int style, int color, int cattr, int mono); + extern void update_color_style(void); extern void wcurses_css(WINDOW * win, char *name, int dir); - extern void curses_w_style(WINDOW * win, int style, int dir); # define LynxChangeStyle(style,dir) curses_style(style,dir) # define LynxWChangeStyle(win,style,dir) curses_w_style(win,style,dir) @@ -806,6 +807,8 @@ FANCY_CURSES. Check your config.log to see why the FANCY_CURSES test failed. extern void lynx_stop_reverse(void); extern void lynx_stop_underline(void); + extern void restart_curses(void); + /* * To prevent corrupting binary data on DOS, MS-WINDOWS or OS/2 we open files * and stdout in BINARY mode by default. Where necessary we should open and diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h index d448a878..f7154528 100644 --- a/src/LYGlobalDefs.h +++ b/src/LYGlobalDefs.h @@ -1,5 +1,5 @@ /* - * $LynxId: LYGlobalDefs.h,v 1.134 2013/04/30 09:51:46 tom Exp $ + * $LynxId: LYGlobalDefs.h,v 1.135 2013/05/30 00:00:31 tom Exp $ * * global variable definitions */ @@ -211,9 +211,7 @@ extern "C" { extern BOOLEAN LYCursesON; /* start_curses()->TRUE, stop_curses()->FALSE */ extern BOOLEAN LYJumpFileURL; /* URL from the jump file shortcuts? */ extern BOOLEAN LYNewsPosting; /* News posting supported if TRUE */ -#ifdef USE_SESSIONS extern BOOLEAN LYAutoSession; /* Auto restore/save session? */ -#endif extern BOOLEAN LYShowCursor; /* Show the cursor or hide it? */ extern BOOLEAN LYShowTransferRate; extern BOOLEAN LYUnderlineLinks; /* Show the links underlined vs bold */ @@ -629,6 +627,7 @@ extern "C" { #endif /* !VMS */ #if defined(USE_COLOR_STYLE) + extern int LYuse_color_style; /* color-style vs oldlynx */ extern char *lynx_lss_file; #endif diff --git a/src/LYMain.c b/src/LYMain.c index 02917d55..3c01234b 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYMain.c,v 1.241 2013/05/02 10:41:09 tom Exp $ + * $LynxId: LYMain.c,v 1.243 2013/05/30 08:58:21 tom Exp $ */ #include <HTUtils.h> #include <HTTP.h> @@ -685,8 +685,9 @@ static void FatalProblem(int sig); #endif /* !VMS */ #if defined(USE_COLOR_STYLE) -char *lynx_lss_file2 = NULL; /* from command-line options */ +int LYuse_color_style = TRUE; char *lynx_lss_file = NULL; /* from config-file, etc. */ +static char *lynx_lss_file2 = NULL; /* from command-line options */ #endif #ifdef USE_DEFAULT_COLORS @@ -3477,6 +3478,12 @@ with -dump, format output as with -traversal, but to stdout" "incremental display stages with MessageSecs delay" ), #endif +#ifdef USE_DEFAULT_COLORS + PARSE_SET( + "default_colors", 4|TOGGLE_ARG, LYuse_default_colors, + "use terminal default foreground/background colors" + ), +#endif PARSE_INT( "delay", 4|NEED_TIME_ARG, DelaySecs, "=NNN\nset NNN-second delay at statusline message" diff --git a/src/LYOptions.c b/src/LYOptions.c index d533a3dc..90025a69 100644 --- a/src/LYOptions.c +++ b/src/LYOptions.c @@ -1,4 +1,4 @@ -/* $LynxId: LYOptions.c,v 1.150 2012/11/14 01:07:12 tom Exp $ */ +/* $LynxId: LYOptions.c,v 1.154 2013/06/02 19:37:05 tom Exp $ */ #include <HTUtils.h> #include <HTFTP.h> #include <HTTP.h> /* 'reloading' flag */ @@ -2205,6 +2205,14 @@ static OptValues show_color_values[] = }; #endif +#ifdef USE_COLOR_STYLE +static const char *color_style_string = RC_COLOR_STYLE; +#endif + +#ifdef USE_DEFAULT_COLORS +static const char *default_colors_string = RC_DEFAULT_COLORS; +#endif + static const char *show_cursor_string = RC_SHOW_CURSOR; static const char *underline_links_string = RC_UNDERLINE_LINKS; @@ -2638,6 +2646,9 @@ int postoptions(DocInfo *newdoc) #if defined(USE_SLANG) || defined(COLOR_CURSES) int CurrentShowColor = LYShowColor; #endif +#ifdef USE_DEFAULT_COLORS + BOOLEAN current_default_colors = LYuse_default_colors; +#endif /*------------------------------------------------- * kludge a link from mbm_menu, the URL was: @@ -2887,13 +2898,42 @@ int postoptions(DocInfo *newdoc) if (CurrentShowColor != LYShowColor) { lynx_force_repaint(); } - CurrentShowColor = LYShowColor; #ifdef USE_SLANG SLtt_Use_Ansi_Colors = (LYShowColor > SHOW_COLOR_OFF ? TRUE : FALSE); #endif } #endif /* USE_SLANG || COLOR_CURSES */ +#ifdef USE_COLOR_STYLE + /* Color Style: ON/OFF */ + if (!strcmp(data[i].tag, color_style_string) + && GetOptValues(bool_values, data[i].value, &code)) { + LYuse_color_style = (BOOLEAN) code; + update_color_style(); + lynx_force_repaint(); + } +#endif + +#ifdef USE_DEFAULT_COLORS + /* Default Colors: ON/OFF */ + if (!strcmp(data[i].tag, default_colors_string) + && GetOptValues(bool_values, data[i].value, &code)) { + LYuse_default_colors = (BOOLEAN) code; + if (current_default_colors != LYuse_default_colors) { + CTRACE((tfp, "default_colors changed, updating colors...\n")); + if (has_colors()) { + if (LYuse_default_colors) { + use_default_colors(); + } else { + restart_curses(); + } + update_default_colors(); + lynx_force_repaint(); + } + } + } +#endif + /* Show Cursor: ON/OFF */ if (!strcmp(data[i].tag, show_cursor_string) && GetOptValues(bool_values, data[i].value, &code)) { @@ -3762,6 +3802,24 @@ static int gen_options(char **newfile) EndSelect(fp0); #endif /* USE_SLANG || COLOR_CURSES */ +#ifdef USE_COLOR_STYLE + /* Color style: ON/OFF */ + PutLabel(fp0, gettext("Color style"), color_style_string); + BeginSelect(fp0, color_style_string); + PutOptValues(fp0, LYuse_color_style, bool_values); + EndSelect(fp0); +#endif + +#ifdef USE_DEFAULT_COLORS + /* Default colors: ON/OFF */ + if (has_colors()) { + PutLabel(fp0, gettext("Default colors"), default_colors_string); + BeginSelect(fp0, default_colors_string); + PutOptValues(fp0, LYuse_default_colors, bool_values); + EndSelect(fp0); + } +#endif + /* Show cursor: ON/OFF */ PutLabel(fp0, gettext("Show cursor"), show_cursor_string); BeginSelect(fp0, show_cursor_string); diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c index 3e048117..21a39b3b 100644 --- a/src/LYReadCFG.c +++ b/src/LYReadCFG.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYReadCFG.c,v 1.172 2013/05/04 12:24:06 tom Exp $ + * $LynxId: LYReadCFG.c,v 1.176 2013/05/30 23:16:56 tom Exp $ */ #ifndef NO_RULES #include <HTRules.h> @@ -634,16 +634,6 @@ static int assumed_color_fun(char *buffer) if (default_fg == ERR_COLOR || default_bg == ERR_COLOR) exit_with_color_syntax(buffer); -#ifdef USE_SLANG - /* - * Sorry - the order of initialization of slang precludes setting the - * default colors from the lynx.cfg file, since slang is already - * initialized before the file is read, and there is no interface - * defined for setting it from the application (that's one of the - * problems with using environment variables rather than a programmable - * interface) -TD - */ -#endif FREE(temp_fg); } else { CTRACE((tfp, "...ignored since DEFAULT_COLORS:off\n")); @@ -661,21 +651,33 @@ static int color_fun(char *value) #endif #ifdef USE_DEFAULT_COLORS -static int default_colors_fun(char *value) +void update_default_colors(void) { - LYuse_default_colors = is_true(value); + int old_fg = default_fg; + int old_bg = default_bg; + + default_color_reset = !LYuse_default_colors; if (LYuse_default_colors) { + default_color_reset = FALSE; default_fg = DEFAULT_COLOR; default_bg = DEFAULT_COLOR; } else { default_color_reset = TRUE; - if (default_fg == DEFAULT_COLOR || - default_bg == DEFAULT_COLOR) { - default_fg = COLOR_WHITE; - default_bg = COLOR_BLACK; - lynx_setup_colors(); - } + default_fg = COLOR_WHITE; + default_bg = COLOR_BLACK; } + if (old_fg != default_fg || old_bg != default_bg) { + lynx_setup_colors(); +#ifdef USE_COLOR_STYLE + update_color_style(); +#endif + } +} + +static int default_colors_fun(char *value) +{ + LYuse_default_colors = is_true(value); + update_default_colors(); return 0; } #endif diff --git a/src/LYReadCFG.h b/src/LYReadCFG.h index 94928e80..9ddd9ce4 100644 --- a/src/LYReadCFG.h +++ b/src/LYReadCFG.h @@ -1,5 +1,5 @@ /* - * $LynxId: LYReadCFG.h,v 1.27 2012/08/13 00:09:50 tom Exp $ + * $LynxId: LYReadCFG.h,v 1.28 2013/05/30 09:32:16 tom Exp $ */ #ifndef LYREADCFG_H #define LYREADCFG_H @@ -46,6 +46,7 @@ extern "C" { extern int check_color(const char *color, int the_default); extern const char *lookup_color(int code); + extern void update_default_colors(void); #endif extern void read_cfg(const char *cfg_filename, diff --git a/src/LYStyle.c b/src/LYStyle.c index 5f1aa2af..40c419c7 100644 --- a/src/LYStyle.c +++ b/src/LYStyle.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYStyle.c,v 1.71 2012/02/10 01:24:18 tom Exp $ + * $LynxId: LYStyle.c,v 1.73 2013/06/02 19:17:06 tom Exp $ * * character level styles for Lynx * (c) 1996 Rob Partington -- donated to the Lyncei (if they want it :-) @@ -561,7 +561,7 @@ static void style_initialiseHashTable(void) void parse_userstyles(void) { char *name; - HTList *cur = lss_styles; + HTList *cur = LYuse_color_style ? lss_styles : 0; colorPairs = 0; style_initialiseHashTable(); @@ -807,4 +807,14 @@ void FreeCachedStyles(void) } } +/* + * Recompute the pairs associated with the color style. + */ +void update_color_style(void) +{ + CTRACE((tfp, "update_color_style %p\n", lss_styles)); + memset(our_pairs, 0, sizeof(our_pairs)); + parse_userstyles(); +} + #endif /* USE_COLOR_STYLE */ |