about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1997-07-22 11:57:03 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1997-07-22 11:57:03 -0400
commit36863953e4886d5269a325c93bd433847694a5fb (patch)
tree485d1197eea38785b908bcdc1e0f228ab90b80e1 /src
parent57bfc74ff4ec4c2980b2330f2badc54a8990842d (diff)
downloadlynx-snapshots-36863953e4886d5269a325c93bd433847694a5fb.tar.gz
snapshot of project "lynx", label v2-7-1ac_0-38
Diffstat (limited to 'src')
-rw-r--r--src/GridText.c10
-rw-r--r--src/HTAlert.c8
-rw-r--r--src/HTAlert.h4
-rw-r--r--src/HTFWriter.c2
-rw-r--r--src/LYBookmark.c4
-rw-r--r--src/LYCgi.c2
-rw-r--r--src/LYClean.c2
-rw-r--r--src/LYClean.h5
-rw-r--r--src/LYCurses.c181
-rw-r--r--src/LYCurses.h13
-rw-r--r--src/LYForms.c65
-rw-r--r--src/LYGetFile.c6
-rw-r--r--src/LYGlobalDefs.h1
-rw-r--r--src/LYHistory.c3
-rw-r--r--src/LYKeymap.h79
-rw-r--r--src/LYMail.c3
-rw-r--r--src/LYMain.c22
-rw-r--r--src/LYMainLoop.c6
-rw-r--r--src/LYMap.c3
-rw-r--r--src/LYNews.c2
-rw-r--r--src/LYNews.h4
-rw-r--r--src/LYOptions.c1611
-rw-r--r--src/LYOptions.h13
-rw-r--r--src/LYStrings.c7
-rw-r--r--src/LYStrings.h16
-rw-r--r--src/LYUtils.c20
-rw-r--r--src/LYexit.c1
27 files changed, 1066 insertions, 1027 deletions
diff --git a/src/GridText.c b/src/GridText.c
index f7b46419..0c4290f5 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -109,7 +109,7 @@ PUBLIC char * unchecked_radio = "( )";
 PUBLIC BOOLEAN underline_on = OFF;
 PUBLIC BOOLEAN bold_on      = OFF;
 
-#if defined(USE_COLOR_STYLE) || defined(SLCS)
+#if defined(USE_COLOR_STYLE)
 #define MAX_STYLES_ON_LINE 64
 
 typedef struct _stylechange {
@@ -127,7 +127,7 @@ typedef struct _line {
 	int unsigned	size;		/* Number of characters */
 	BOOL	split_after;		/* Can we split after? */
 	BOOL	bullet;			/* Do we bullet? */
-#if defined(USE_COLOR_STYLE) || defined(SLCS)
+#if defined(USE_COLOR_STYLE)
 	HTStyleChange	styles[MAX_STYLES_ON_LINE];
 	int	numstyles;
 #endif
@@ -992,7 +992,7 @@ PRIVATE void display_page ARGS3(
      */
     if (line) {
 	char *data;
-	int offset, LineOffset, HitOffset, LenNeeded;
+	int offset, HitOffset, LenNeeded;
 	for (i = 0; i < (display_lines); i++)  {
 	    /*
 	     *  Verify and display each line.
@@ -1404,7 +1404,7 @@ PRIVATE void display_page ARGS3(
 	/*
 	 *  For non-multibyte curses.
 	 */
-        clearok(curscr, TRUE);
+        lynx_force_repaint();
     }
     refresh();
 
@@ -1480,7 +1480,7 @@ PRIVATE void split_line ARGS2(
     previous->next->prev = line;
     line->prev = previous;
     line->next = previous->next;
-#if defined(USE_COLOR_STYLE) || defined(SLCS)
+#if defined(USE_COLOR_STYLE)
 #define LastStyle (previous->numstyles-1)
     line->numstyles = 0;
     inew = MAX_STYLES_ON_LINE - 1;
diff --git a/src/HTAlert.c b/src/HTAlert.c
index 78a931e0..926a2b71 100644
--- a/src/HTAlert.c
+++ b/src/HTAlert.c
@@ -420,7 +420,7 @@ PUBLIC BOOL HTConfirmCookie ARGS6(
 **	----------------------------
 **
 **  On entry,
-**      redirecting_url             is the Location.
+**      Redirecting_url             is the Location.
 **
 **  On exit,
 **      Returns 0 on cancel,
@@ -428,7 +428,7 @@ PUBLIC BOOL HTConfirmCookie ARGS6(
 **	303 for redirect as GET without content
 */
 PUBLIC int HTConfirmPostRedirect ARGS1(
-	CONST char *,	redirecting_url)
+	CONST char *,	Redirecting_url)
 {
     char *show_POST_url = NULL;
     char url[256];
@@ -449,13 +449,13 @@ PUBLIC int HTConfirmPostRedirect ARGS1(
 	clrtoeol();
         move(LYlines-1, 0);
 	sprintf(url, "URL: %.*s",
-		    (LYcols < 250 ? LYcols-6 : 250), redirecting_url);
+		    (LYcols < 250 ? LYcols-6 : 250), Redirecting_url);
         addstr(url);
 	clrtoeol();
         _statusline(PROCEED_GET_CANCEL);
     } else {
 	StrAllocCopy(show_POST_url, LOCATION_HEADER);
-	StrAllocCat(show_POST_url, redirecting_url);
+	StrAllocCat(show_POST_url, Redirecting_url);
     }
     while (1) {
 	int c;  
diff --git a/src/HTAlert.h b/src/HTAlert.h
index ec1d2397..744a2a35 100644
--- a/src/HTAlert.h
+++ b/src/HTAlert.h
@@ -111,7 +111,7 @@ extern BOOL HTConfirmCookie PARAMS((
 /*      Confirm redirection of POST.		HTConfirmPostRedirect()
 **	----------------------------
 **  On entry,
-**      redirecting_url             is the Location.
+**      Redirecting_url             is the Location.
 **
 **  On exit,
 **      Returns 0 on cancel,
@@ -119,7 +119,7 @@ extern BOOL HTConfirmCookie PARAMS((
 **	303 for redirect as GET without content
 */
 extern int HTConfirmPostRedirect PARAMS((
-	CONST char *	redirecting_url));
+	CONST char *	Redirecting_url));
 
 /*
 
diff --git a/src/HTFWriter.c b/src/HTFWriter.c
index 3589811b..711774b1 100644
--- a/src/HTFWriter.c
+++ b/src/HTFWriter.c
@@ -194,7 +194,7 @@ PRIVATE void HTFWriter_free ARGS1(HTStream *, me)
 		    fclose(fp);
 		    fp = NULL;
 		    if (!dump_output_immediately) {
-		        clearok(curscr, TRUE);
+		        lynx_force_repaint();
 			refresh();
 		    }
 		    HTAlert(ERROR_UNCOMPRESSING_TEMP);
diff --git a/src/LYBookmark.c b/src/LYBookmark.c
index c5f26577..9018e483 100644
--- a/src/LYBookmark.c
+++ b/src/LYBookmark.c
@@ -638,7 +638,7 @@ get_advanced_choice:
 	    /*
 	     *  Refresh the screen.
 	     */
-	    clearok(curscr, TRUE);
+	    lynx_force_repaint();
 	    refresh();
 	    goto get_advanced_choice;
 	}
@@ -825,7 +825,7 @@ get_bookmark_choice:
 	/*
 	 *  Refresh the screen.
 	 */
-	clearok(curscr, TRUE);
+	lynx_force_repaint();
 	refresh();
 	goto get_bookmark_choice;
     }
diff --git a/src/LYCgi.c b/src/LYCgi.c
index 531c237e..6a431122 100644
--- a/src/LYCgi.c
+++ b/src/LYCgi.c
@@ -62,8 +62,6 @@ PRIVATE char user_agent[64];
 PRIVATE char server_software[64];
 #endif /* LYNXCGI_LINKS */
 
-extern BOOLEAN reloading;
-
 PRIVATE void add_environment_value PARAMS((char *env_value));
 
 
diff --git a/src/LYClean.c b/src/LYClean.c
index 1b411319..aefb6810 100644
--- a/src/LYClean.c
+++ b/src/LYClean.c
@@ -50,7 +50,7 @@ PUBLIC void cleanup_sig ARGS1(
         /*
 	 *  Refresh screen to get rid of "cancel" message, then query.
 	 */
-	clearok(curscr, TRUE);
+	lynx_force_repaint();
 	refresh();
 
 	/*
diff --git a/src/LYClean.h b/src/LYClean.h
index 2920c88b..e9502010 100644
--- a/src/LYClean.h
+++ b/src/LYClean.h
@@ -1,7 +1,10 @@
-
 #ifndef LYCLEAN_H
 #define LYCLEAN_H
 
+#ifdef VMS
+extern BOOLEAN HadVMSInterrupt;
+#endif
+
 extern void cleanup_sig PARAMS((int sig));
 extern BOOLEAN setup PARAMS((char *terminal));
 extern void cleanup NOPARAMS;
diff --git a/src/LYCurses.c b/src/LYCurses.c
index 1424417e..c3968b6d 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -65,7 +65,7 @@ PUBLIC int PHYSICAL_SLtt_Screen_Cols = 10;
 PUBLIC void LY_SLrefresh NOARGS
 {
     if (FullRefresh) {
-        SLsmg_touch_lines(0, LYlines);
+	SLsmg_touch_lines(0, LYlines);
 	FullRefresh = FALSE;
     }
     SLsmg_refresh();
@@ -136,10 +136,10 @@ PRIVATE void sl_suspend ARGS1(
 #ifdef SIGSTOP
 #ifndef VMS
     int r, c;
-   
+
     lynx_enable_mouse (0);
     if (sig == SIGTSTP)
-        SLsmg_suspend_smg();
+	SLsmg_suspend_smg();
     SLang_reset_tty();
     kill(getpid(),SIGSTOP);
 #if SLANG_VERSION > 9929
@@ -152,7 +152,7 @@ PRIVATE void sl_suspend ARGS1(
     SLtty_set_suspend_state(1);
 #endif
     if (sig == SIGTSTP)
-        SLsmg_resume_smg();
+	SLsmg_resume_smg();
     /*
      *  Get new window size in case it changed.
      */
@@ -169,7 +169,7 @@ PRIVATE void sl_suspend ARGS1(
 }
 #endif /* USE_SLANG */
 
-#if defined(USE_COLOR_STYLE) || defined(SLCS)
+#if defined(USE_COLOR_STYLE)
 PRIVATE int last_styles[128];
 PRIVATE int last_ptr=0;
 #endif
@@ -193,15 +193,15 @@ PUBLIC void setStyle ARGS4(int,style,int,color,int,cattr,int,mono)
 
 PUBLIC void setHashStyle ARGS5(int,style,int,color,int,cattr,int,mono,char*,element)
 {
-        bucket* ds=&hashStyles[style];
-        if (TRACE)
-                fprintf(stderr, "CSS(SET): <%s> hash=%d, ca=%d, ma=%d\n", element, style, color, mono);
-        ds->color=color;
-        ds->cattr=cattr;
-        ds->mono=mono;
-        ds->code=style;
-        ds->name=malloc(sizeof(char)*(strlen(element)+2));
-        strcpy(ds->name, element);
+    bucket* ds=&hashStyles[style];
+    if (TRACE)
+	fprintf(stderr, "CSS(SET): <%s> hash=%d, ca=%d, ma=%d\n", element, style, color, mono);
+    ds->color=color;
+    ds->cattr=cattr;
+    ds->mono=mono;
+    ds->code=style;
+    ds->name=malloc(sizeof(char)*(strlen(element)+2));
+    strcpy(ds->name, element);
 }
 
 /*
@@ -211,7 +211,7 @@ PRIVATE int LYAttrset ARGS3(WINDOW*,win,int,color,int,mono)
 {
 	if (TRACE)
 		fprintf(stderr, "CSS:LYAttrset (%d, %d)\n", color, mono);
-	if (has_color && color > -1)
+	if (has_color && LYShowColor && color > -1)
 	{
 		wattrset(win,color);
 #if 0
@@ -268,7 +268,7 @@ PUBLIC void curses_w_style ARGS4(WINDOW*,win,int,style,int,dir,int,previous)
 		return;
 
 	case STACK_ON: /* remember the current attributes */
-	    	if (last_ptr > 127) {
+		if (last_ptr > 127) {
 		    if (TRACE)
 			fprintf(stderr,"........... %s (0x%x) %s\r\n",
 				"attribute cache FULL, dropping last",
@@ -327,7 +327,7 @@ PUBLIC void wcurses_css ARGS3(WINDOW *,win,char*,name,int,dir)
 			char *class=strrchr(name, '.');
 			if (TRACE) fprintf(stderr, "undefined, trimming at %p\n", class);
 			if (class)	*class='\0';
-			else 		try_again=0;
+			else		try_again=0;
 		} else {
 			if (TRACE) fprintf(stderr, "ok (%d)\n", hash_code(name));
 			curses_w_style(win, hash_code(name), dir, 0);
@@ -343,13 +343,13 @@ PUBLIC void curses_css ARGS2(char *,name,int,dir)
 
 PUBLIC void curses_style ARGS3(int,style,int,dir,int,previous)
 {
-        curses_w_style(stdscr, style, dir, previous);
+    curses_w_style(stdscr, style, dir, previous);
 }
 
 #ifdef NOT_USED
 void attribute ARGS2(int,style,int,dir)
 {
-        curses_style(style, dir, 0);
+    curses_style(style, dir, 0);
 }
 #endif
 #endif /* USE_COLOR_STYLE */
@@ -394,7 +394,7 @@ PRIVATE struct {
  */
 PRIVATE void LYsetWAttr ARGS1(WINDOW *, win)
 {
-    if (lynx_uses_color) {
+    if (lynx_uses_color && LYShowColor) {
 	int code = 0;
 	int attr = A_NORMAL;
 	int offs = 1;
@@ -405,7 +405,7 @@ PRIVATE void LYsetWAttr ARGS1(WINDOW *, win)
 #ifndef DOSPATH
 		have_underline = tigetstr("smul") != 0;
 #else
-                have_underline = 1;
+		have_underline = 1;
 #endif /* DOSPATH */
 	}
 
@@ -462,7 +462,7 @@ PRIVATE void lynx_map_color ARGS1(int, n)
 		lynx_color_pairs[n+m+1].fg,
 		lynx_color_pairs[n+m+1].bg);
 	}
-	if (n == 0)
+	if (n == 0 && LYShowColor)
 	    bkgd(COLOR_PAIR(9));
     }
 }
@@ -488,7 +488,7 @@ PUBLIC int lynx_chg_color ARGS3(
 
 PUBLIC void lynx_set_color ARGS1(int, a)
 {
-    if (lynx_uses_color) {
+    if (lynx_uses_color && LYShowColor) {
 	attrset(lynx_color_cfg[a].attr | COLOR_PAIR(a+1));
     }
 }
@@ -517,7 +517,7 @@ PRIVATE void lynx_init_colors NOARGS
 			lynx_color_pairs[n+m+1].fg,
 			lynx_color_pairs[n+m+1].bg);
 	    }
-	    if (n == 0)
+	    if (n == 0 && LYShowColor)
 		bkgd(COLOR_PAIR(9));
 	}
     }
@@ -549,8 +549,8 @@ PUBLIC void start_curses NOARGS
 		  keypad(stdscr, TRUE);
 		  fflush(stdin);
 		  fflush(stdout);
-                  lynx_init_colors();
-                  lynx_called_initscr = TRUE;
+		  lynx_init_colors();
+		  lynx_called_initscr = TRUE;
 
  /* Inform pdcurses that we're interested in knowing when mouse
     buttons are clicked.  Maybe someday pdcurses will support it.
@@ -570,7 +570,7 @@ PUBLIC void start_curses NOARGS
     static int slinit;
 
     if (LYCursesON)
-        return;
+	return;
 
     if (slinit == 0) {
 	SLtt_get_terminfo();
@@ -585,7 +585,7 @@ PUBLIC void start_curses NOARGS
 	 *  intensity background (rxvt and maybe Linux console).
 	 */
 	if (Lynx_Color_Flags & SL_LYNX_USE_BLINK)
-	    SLtt_Blink_Mode = 1;	       
+	    SLtt_Blink_Mode = 1;
 	else
 	    SLtt_Blink_Mode = 0;
     }
@@ -634,13 +634,13 @@ PUBLIC void start_curses NOARGS
 	 *  and one time only!
 	 */
 	if (initscr() == NULL) {  /* start curses */
-	    fprintf(stderr, 
+	    fprintf(stderr,
 	        "Terminal initialisation failed - unknown terminal type?\n");
 #ifndef NOSIGHUP
-            (void) signal(SIGHUP, SIG_DFL);
+	    (void) signal(SIGHUP, SIG_DFL);
 #endif /* NOSIGHUP */
-            (void) signal(SIGTERM, SIG_DFL);
-            (void) signal(SIGINT, SIG_DFL);
+	    (void) signal(SIGTERM, SIG_DFL);
+	    (void) signal(SIGINT, SIG_DFL);
 #ifdef SIGTSTP
 	    if (no_suspend)
 	        (void) signal(SIGTSTP,SIG_DFL);
@@ -651,9 +651,9 @@ PUBLIC void start_curses NOARGS
 	has_color = has_colors();
 	if (has_color)
 		start_color();
-	parse_userstyles();	
+	parse_userstyles();
 #endif
-        first_time = FALSE;
+	first_time = FALSE;
 #if USE_COLOR_TABLE
 	lynx_init_colors();
 	lynx_called_initscr = TRUE;
@@ -698,7 +698,7 @@ PUBLIC void start_curses NOARGS
 
 PUBLIC void lynx_enable_mouse ARGS1(int,state)
 {
-   if (LYUseMouse == 0) 
+   if (LYUseMouse == 0)
      return;
 
 #ifdef USE_SLANG_MOUSE
@@ -740,8 +740,8 @@ PUBLIC void stop_curses NOARGS
      *	05-28-94 Lynx 2-3-1 Garrett Arch Blythe
      */
     if(LYCursesON == TRUE)	{
-         lynx_enable_mouse (0);
-         endwin();	/* stop curses */
+	 lynx_enable_mouse (0);
+	 endwin();	/* stop curses */
     }
 
     fflush(stdout);
@@ -781,7 +781,7 @@ PUBLIC BOOLEAN setup ARGS1(
      *  see if it is available from the environment.
      */
     if ((display = getenv(DISPLAY)) != NULL && *display == '\0')
-        display = NULL;
+	display = NULL;
 
     /*
      *  Get terminal type, and convert to lower case.
@@ -789,17 +789,17 @@ PUBLIC BOOLEAN setup ARGS1(
     term[0] = '\0';
     longname(dummy, term);
     if (term[0] == '\0' && (form_get_data || form_post_data)) {
-        /*
+	/*
 	 *  Some yoyo used these under conditions which require
 	 *  -dump, so force that mode here. - FM
 	 */
 	dump_output_immediately = TRUE;
-        LYcols = 80;
+	LYcols = 80;
 	if (keypad_mode == NUMBERS_AS_ARROWS)
 	    keypad_mode = LINKS_ARE_NUMBERED;
 	status = mainloop();
-        (void) signal (SIGHUP, SIG_DFL);
-        (void) signal (SIGTERM, SIG_DFL);
+	(void) signal (SIGHUP, SIG_DFL);
+	(void) signal (SIGTERM, SIG_DFL);
 #ifdef SIGTSTP
 	if (no_suspend)
 	  (void) signal(SIGTSTP,SIG_DFL);
@@ -813,7 +813,7 @@ PUBLIC BOOLEAN setup ARGS1(
     printf("Terminal = %s\n", term);
     sleep(InfoSecs);
     if ((strlen(term) < 5) ||
-        strncmp(term, "vt", 2) || !isdigit(term[2])) {
+	strncmp(term, "vt", 2) || !isdigit(term[2])) {
 	printf(
 	    "You must use a vt100, 200, etc. terminal with this program.\n");
 	printf("Proceed (n/y)? ");
@@ -831,9 +831,9 @@ PUBLIC BOOLEAN setup ARGS1(
     LYlines = LINES;
     LYcols = COLS;
     if (LYlines <= 0)
-        LYlines = 24;
+	LYlines = 24;
     if (LYcols <= 0)
-        LYcols = 80;
+	LYcols = 80;
 
     return(TRUE);
 }
@@ -854,7 +854,7 @@ PUBLIC BOOLEAN setup ARGS1(
     *  see if it is available from the environment .
     */
     if ((display = getenv(DISPLAY)) != NULL && *display == '\0')
-        display = NULL;
+	display = NULL;
 
     if (terminal != NULL) {
 	sprintf(term_putenv,"TERM=%s",terminal);
@@ -875,8 +875,8 @@ PUBLIC BOOLEAN setup ARGS1(
 	    *s = '\0';
 
 	if (strlen(buffer) == 0)
-	    strcpy(buffer,"vt100"); 
-	
+	    strcpy(buffer,"vt100");
+
 	sprintf(term_putenv,"TERM=%s", buffer);
 	putenv(term_putenv);
 	printf("\nTERMINAL TYPE IS SET TO %s\n",getenv("TERM"));
@@ -897,9 +897,9 @@ PUBLIC BOOLEAN setup ARGS1(
     LYlines = LINES;
     LYcols = COLS;
     if (LYlines <= 0)
-        LYlines = 24;
+	LYlines = 24;
     if (LYcols <= 0)
-        LYcols = 80;
+	LYcols = 80;
 
     return(1);
 }
@@ -1088,8 +1088,8 @@ PUBLIC void VMSexit NOARGS
      *  attempt a cleanup and reset the terminal.
      */
     if (!DidCleanup) {
-        if (LYOutOfMemory == FALSE) {
-            fprintf(stderr,
+	if (LYOutOfMemory == FALSE) {
+	    fprintf(stderr,
 "\nA Fatal error has occured in %s Ver. %s\n", LYNX_NAME, LYNX_VERSION);
 	    fprintf(stderr,
 "\nPlease notify your system administrator to confirm a bug, and if\n");
@@ -1110,13 +1110,14 @@ PUBLIC void VMSexit NOARGS
 	    _statusline(MEMORY_EXHAUSTED_ABORT);
 	    sleep(AlertSecs);
 	}
-        cleanup();
+	cleanup();
     }
     if (LYOutOfMemory == TRUE) {
 	printf("\r\n%s\r\n\r\n", MEMORY_EXHAUSTED_ABORT);
 	fflush(stdout);
 	fflush(stderr);
     }
+    *stderr = LYOrigStderr;
 }
 
 /*
@@ -1238,14 +1239,14 @@ PUBLIC int ttgetc NOARGS
     unsigned short iosb[4];
 
     if (in_pos < in_len)
-        return(buffer[in_pos++]);
+	return(buffer[in_pos++]);
 
     status = sys$qiow(EFN, iochan,
 		      IO$_READVBLK|IO$M_NOECHO|IO$M_NOFILTR,
 		      &iosb, 0, 0,
 		      &buffer, 1, 0, 0, 0, 0);
     if ((status&1) == 1)
-        status = iosb[0];
+	status = iosb[0];
     if (status == SS$_PARTESCAPE) {
 	/*
 	 *  Escape sequence in progress.  Fake a successful read.
@@ -1253,7 +1254,7 @@ PUBLIC int ttgetc NOARGS
 	status = 1;
     }
     if ((status&1) != 1 && status != SS$_DATAOVERUN)
-        exit(status);
+	exit(status);
     in_pos = 1;
     in_len = iosb[1] + iosb[3];
     return(buffer[0]);
@@ -1270,10 +1271,10 @@ PUBLIC int typeahead NOARGS
     unsigned short iosb[4];
 
     if (dump_output_immediately)
-        return -1;
+	return -1;
 
     if (in_pos < in_len)
-        return(buffer[in_pos++]);
+	return(buffer[in_pos++]);
 
 again:
     status = sys$qiow (EFN, iochan,
@@ -1281,7 +1282,7 @@ again:
 		       &iosb, 0, 0,
 		       &buffer, 1, 0, 0, 0, 0);
     if ((status&1) == 1)
-        status = iosb[0];
+	status = iosb[0];
     if (status == SS$_PARTESCAPE) {
 	/*
 	 *  Escape sequence in progress, finish reading it.
@@ -1292,7 +1293,7 @@ again:
     in_pos = 1;
     in_len = iosb[1] + iosb[3];
     if (status == SS$_TIMEOUT || status == SS$_DATAOVERUN)
-        return(-1);
+	return(-1);
     return (buffer[0]);
 }
 
@@ -1389,7 +1390,7 @@ PRIVATE int DCLspawn_exception ARGS2(
 {
 #endif /* __DECC */
      int status;
-     
+
      status = lib$sig_to_ret(sigarr, mecharr);
      return(SS$_UNWIND);
 }
@@ -1412,7 +1413,7 @@ PRIVATE int spawn_DCLprocess ARGS1(
 
 #ifdef __ALPHA /** OpenVMS/AXP lacked the TRUSTED flag before v6.1 **/
      if (VersionVMS[1] > '6' ||
-         (VersionVMS[1] == '6' && VersionVMS[2] == '.' &&
+	 (VersionVMS[1] == '6' && VersionVMS[2] == '.' &&
 	  VersionVMS[3] >= '1')) {
 #else
      if (VersionVMS[1] >= '6') {
@@ -1421,22 +1422,22 @@ PRIVATE int spawn_DCLprocess ARGS1(
 	  *  Include TRUSTED flag.
 	  */
 	 unsigned long trusted = CLI$M_TRUSTED;
-         status = lib$spawn(&command_desc,0,0,&trusted,
-	 		    0,0,&Status);
+	 status = lib$spawn(&command_desc,0,0,&trusted,
+			    0,0,&Status);
 	 /*
 	  *  If it was invalid, try again without the flag.
 	  */
-         if (status == LIB$_INVARG)
-            status = lib$spawn(&command_desc,0,0,0,
-	    		       0,0,&Status );
+	 if (status == LIB$_INVARG)
+	    status = lib$spawn(&command_desc,0,0,0,
+			       0,0,&Status );
      } else
 	 status = lib$spawn(&command_desc,0,0,0,
-	 		    0,0,&Status);
+			    0,0,&Status);
      /*
       *  Return -1 on error.
       */
      if ((status&1) != 1 || (Status&1) != 1)
-         return(-1);
+	 return(-1);
      /*
       *  Return 0 on success.
       */
@@ -1448,7 +1449,7 @@ PUBLIC int DCLsystem ARGS1(
 {
      int status;
      extern void controlc();
-     
+
      VMSsignal(SIGINT, SIG_IGN);
      status = spawn_DCLprocess(command);
      VMSsignal(SIGINT, cleanup_sig);
@@ -1476,9 +1477,9 @@ PUBLIC void VMSbox ARGS3(
        waddch(win, 'q');
     waddch(win, 'k');
     for (i = 1; i < height-1; i++) {
-        wmove(win, i, 0);
+	wmove(win, i, 0);
 	waddch(win, 'x');
-        wmove(win, i, width-1);
+	wmove(win, i, width-1);
 	waddch(win, 'x');
     }
     wmove(win, i, 0);
@@ -1490,26 +1491,34 @@ PUBLIC void VMSbox ARGS3(
 #endif /* !USE_SLANG */
 #endif /* VMS */
 
-
+PUBLIC void lynx_force_repaint NOARGS
+{
+#if defined(COLOR_CURSES)
+    chtype a = (LYShowColor) ? COLOR_PAIR(9) : A_NORMAL;
+    bkgd(a | ' ');
+    attrset(a);
+#endif
+    clearok(curscr, TRUE);
+}
 
 PUBLIC void lynx_start_underline_color NOARGS
 {
-   start_underline ();
+    start_underline ();
 }
 
 PUBLIC void lynx_stop_underline_color NOARGS
 {
-   stop_underline ();
+    stop_underline ();
 }
 
 PUBLIC void lynx_start_bold_color NOARGS
 {
-   start_bold ();
+    start_bold ();
 }
 
 PUBLIC void lynx_stop_bold_color NOARGS
 {
-   stop_bold ();
+    stop_bold ();
 }
 
 PUBLIC void lynx_start_title_color NOARGS
@@ -1526,7 +1535,7 @@ PUBLIC void lynx_start_link_color ARGS2(
 {
     if (flag) {
 	/* makes some terminals work wrong because
-	 * they can't handle two attributes at the 
+	 * they can't handle two attributes at the
 	 * same time
 	 */
 	/* start_bold();  */
@@ -1595,19 +1604,21 @@ PUBLIC void lynx_start_target_color NOARGS
 PUBLIC void lynx_start_status_color NOARGS
 {
 #if USE_COLOR_TABLE && defined(COLOR_CURSES)
-   lynx_set_color (2);
-#else
-   start_reverse ();
+    if (lynx_uses_color && LYShowColor)
+	lynx_set_color (2);
+    else
 #endif
+	start_reverse ();
 }
 
 PUBLIC void lynx_stop_status_color NOARGS
 {
 #if USE_COLOR_TABLE && defined(COLOR_CURSES)
-   lynx_set_color (0);
-#else
-   stop_reverse ();
+    if (lynx_uses_color && LYShowColor)
+	lynx_set_color (0);
+    else
 #endif
+	stop_reverse ();
 }
 
 PUBLIC void lynx_start_h1_color NOARGS
@@ -1648,5 +1659,3 @@ PUBLIC void lynx_stop_all_colors NOARGS
    stop_reverse ();
    stop_bold ();
 }
-   
-	
diff --git a/src/LYCurses.h b/src/LYCurses.h
index 8ea9ce78..5bccb8b9 100644
--- a/src/LYCurses.h
+++ b/src/LYCurses.h
@@ -98,6 +98,18 @@ extern void LYsubwindow PARAMS((WINDOW * param));
 #define CR FROMASCII('\015')
 #endif /* REDEFINE_CR */
 
+#ifdef ALT_CHAR_SET
+#define BOXVERT 0   /* use alt char set for popup window vertical borders */
+#define BOXHORI 0   /* use alt char set for popup window vertical borders */
+#endif
+
+#ifndef BOXVERT
+#define BOXVERT '*'	/* character for popup window vertical borders */
+#endif
+#ifndef BOXHORI
+#define BOXHORI '*'	/* character for popup window horizontal borders */
+#endif
+
 extern int LYlines;  /* replaces LINES */
 extern int LYcols;   /* replaces COLS */
 
@@ -311,6 +323,7 @@ extern int  lynx_chg_color PARAMS((int, int, int));
 #endif /* USE_SLANG */
 
 extern void lynx_enable_mouse PARAMS((int));
+extern void lynx_force_repaint NOPARAMS;
 extern void lynx_start_underline_color NOPARAMS;
 extern void lynx_stop_underline_color NOPARAMS;
 extern void lynx_start_bold_color NOPARAMS;
diff --git a/src/LYForms.c b/src/LYForms.c
index 83f41bf0..283634e3 100644
--- a/src/LYForms.c
+++ b/src/LYForms.c
@@ -6,7 +6,7 @@
 #include "LYCurses.h"
 #include "GridText.h"
 #include "LYUtils.h"
-#include "LYStructs.h"	/* includes HTForms.h */
+#include "LYStructs.h"  /* includes HTForms.h */
 #include "LYStrings.h"
 #include "LYGlobalDefs.h"
 #include "LYKeymap.h"
@@ -19,25 +19,13 @@
 #include "LYHash.h"
 #endif
 
-#ifdef ALT_CHAR_SET
-#define BOXVERT 0   /* use alt char set for popup window vertical borders */
-#define BOXHORI 0   /* use alt char set for popup window vertical borders */
-#endif
-
-#ifndef BOXVERT
-#define BOXVERT '*'	/* character for popup window vertical borders */
-#endif
-#ifndef BOXHORI
-#define BOXHORI '*'	/* character for popup window horizontal borders */
-#endif
-
 extern HTCJKlang HTCJK;
 
 PRIVATE int form_getstr PARAMS((
 	struct link *	form_link));
 PRIVATE int popup_options PARAMS((
 	int		cur_selection,
-	OptionType *	list, 
+	OptionType *	list,
 	int		ly,
 	int		lx,
 	int		width,
@@ -46,13 +34,12 @@ PRIVATE int popup_options PARAMS((
 
 PUBLIC int change_form_link ARGS6(
 	struct link *,	form_link,
-	int,		mode, 
+	int,		mode,
 	document *,	newdoc,
 	BOOLEAN *,	refresh_screen,
 	char *,		link_name,
 	char *,		link_value)
 {
-    extern BOOL reloading;
     FormInfo *form = form_link->form;
     int c = DO_NOTHING;
     int OrigNumValue;
@@ -112,7 +99,7 @@ PUBLIC int change_form_link ARGS6(
 				form->size_l, form->disabled);
 
 	    {
-    	        OptionType * opt_ptr = form->select_list;
+		OptionType * opt_ptr = form->select_list;
 		int i;
 		for (i = 0; i < form->num_value; i++, opt_ptr = opt_ptr->next)
 		    ; /* null body */
@@ -157,7 +144,7 @@ PUBLIC int change_form_link ARGS6(
 		lynx_start_radio_color ();
 		for (i = 0; i < nlinks; i++) {
 		    if (links[i].type == WWW_FORM_LINK_TYPE &&
-		        links[i].form->type == F_RADIO_TYPE &&
+			links[i].form->type == F_RADIO_TYPE &&
 			links[i].form->number == form->number &&
 			/*
 			 *  If it has the same name and its on...
@@ -167,7 +154,7 @@ PUBLIC int change_form_link ARGS6(
 			move(links[i].ly, links[i].lx);
 			addstr(unchecked_radio);
 			links[i].hightext = unchecked_radio;
-		     }
+		    }
 		}
 		lynx_stop_radio_color ();
 		/*
@@ -262,8 +249,8 @@ PUBLIC int change_form_link ARGS6(
     }
 
     return(c);
-
 }
+
 PRIVATE int form_getstr ARGS1(
 	struct link *,	form_link)
 {
@@ -523,10 +510,10 @@ PRIVATE void paddstr ARGS3(
 	int,		width,
 	char *, 	the_string)
 {
-	width -= strlen(the_string);
-	waddstr(the_window, the_string);
-	while (width-- > 0)
-		waddstr(the_window, " ");
+    width -= strlen(the_string);
+    waddstr(the_window, the_string);
+    while (width-- > 0)
+	waddstr(the_window, " ");
 }
 #endif
 
@@ -587,7 +574,7 @@ PRIVATE int popup_options ARGS7(
      *  Set display_lines based on the user_mode global.
      */
     if (user_mode == NOVICE_MODE)
-        display_lines = LYlines-4;
+	display_lines = LYlines-4;
     else
 	display_lines = LYlines-2;
 
@@ -618,9 +605,9 @@ PRIVATE int popup_options ARGS7(
      *  the number of real options.
      */
     if (!i_length) {
-        i_length = num_options;
+	i_length = num_options;
     } else {
-        /*
+	/*
 	 *  Otherwise, it is really one number too high.
 	 */
 	i_length--;
@@ -634,7 +621,7 @@ PRIVATE int popup_options ARGS7(
     bottom = top + i_length + 3;
 
     /*
-     *  Hmm...	If the bottom goes beyond the number of lines available,
+     *  Hmm...  If the bottom goes beyond the number of lines available,
      */
     if (bottom > display_lines) {
 	/*
@@ -681,7 +668,7 @@ PRIVATE int popup_options ARGS7(
     SLsmg_fill_region(top, lx - 1, bottom - top, width + 4, ' ');
 #else
     if (!(form_window = newwin(bottom - top, width + 4, top, lx - 1)) &&
-        !(form_window = newwin(bottom - top, 0, top, 0))) {
+	!(form_window = newwin(bottom - top, 0, top, 0))) {
 	HTAlert(POPUP_FAILED);
 	return(orig_selection);
     }
@@ -713,10 +700,10 @@ PRIVATE int popup_options ARGS7(
 		(((num_options + 1) + (length - 1))/(length))
 					  : 1;
 /*
- * OH!	I LOVE GOTOs! hack hack hack
- *    07-11-94 GAB
- *  MORE hack hack hack
- *    09-05-94 FM
+ * OH!  I LOVE GOTOs! hack hack hack
+ *        07-11-94 GAB
+ *      MORE hack hack hack
+ *        09-05-94 FM
  */
 redraw:
     opt_ptr = list;
@@ -1201,7 +1188,7 @@ redraw:
 		break;
 
 	    case LYK_REFRESH:
-		clearok(curscr, TRUE);
+		lynx_force_repaint();
 		refresh();
 		break;
 
@@ -1264,10 +1251,10 @@ check_recall:
 			FirstRecall = FALSE;
 			if (*prev_target_buffer) {
 			    for (QueryNum = (QueryTotal - 1);
-			         QueryNum > 0; QueryNum--) {
+				 QueryNum > 0; QueryNum--) {
 				if ((cp = (char *)HTList_objectAt(
 							search_queries,
-	    						QueryNum)) != NULL &&
+							QueryNum)) != NULL &&
 				    !strcmp(prev_target_buffer, cp)) {
 				    break;
 				}
@@ -1287,7 +1274,7 @@ check_recall:
 			 */
 			QueryNum = 0;
 		    if ((cp = (char *)HTList_objectAt(search_queries,
-	    					      QueryNum)) != NULL) {
+						      QueryNum)) != NULL) {
 			strcpy(prev_target, cp);
 			if (*prev_target_buffer &&
 			    !strcmp(prev_target_buffer, prev_target)) {
@@ -1322,7 +1309,7 @@ check_recall:
 			     QueryNum < (QueryTotal - 1); QueryNum++) {
 			    if ((cp = (char *)HTList_objectAt(
 							search_queries,
-	    						QueryNum)) != NULL &&
+							QueryNum)) != NULL &&
 				!strcmp(prev_target_buffer, cp)) {
 				    break;
 			    }
@@ -1342,7 +1329,7 @@ check_recall:
 		     */
 		    QueryNum = (QueryTotal - 1);
 		    if ((cp = (char *)HTList_objectAt(search_queries,
-	    					      QueryNum)) != NULL) {
+						      QueryNum)) != NULL) {
 			strcpy(prev_target, cp);
 			if (*prev_target_buffer &&
 			    !strcmp(prev_target_buffer, prev_target)) {
diff --git a/src/LYGetFile.c b/src/LYGetFile.c
index 3ac5ca37..2faa38cf 100644
--- a/src/LYGetFile.c
+++ b/src/LYGetFile.c
@@ -1,5 +1,6 @@
 #include "HTUtils.h"
 #include "tcp.h"
+#include "HTTP.h"
 #include "HTAnchor.h"       /* Anchor class */
 #include "HTAccess.h"
 #include "HTParse.h"
@@ -46,13 +47,11 @@
 
 PRIVATE int fix_http_urls PARAMS((document *doc));
 extern char * WWW_Download_File;
-extern BOOL redirect_post_content;
-extern BOOL reloading;
 #ifdef VMS
 extern BOOLEAN LYDidRename;
 #endif /* VMS */
 
-
+#if 0 /* UNUSED */
 #ifdef DIRED_SUPPORT
 PRIVATE char * LYSanctify ARGS1(
 	char *,		href) 
@@ -84,6 +83,7 @@ PRIVATE char * LYSanctify ARGS1(
     return href;
 }
 #endif /* DIRED_SUPPORT */
+#endif
 
 
 PUBLIC BOOLEAN getfile ARGS1(
diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h
index 111b2a43..c8df5cbb 100644
--- a/src/LYGlobalDefs.h
+++ b/src/LYGlobalDefs.h
@@ -98,6 +98,7 @@ extern char star_string[MAX_LINE + 1]; /* from GridText.c */
  ((n) >= MAX_LINE ? star_string : &star_string[(MAX_LINE-1)] - (n))
 #define DIRNAMESIZE 256
 
+extern BOOLEAN LYShowColor;	/* Show color or monochrome?	    */
 extern BOOLEAN LYShowCursor;	/* Show the cursor or hide it?	    */
 extern BOOLEAN LYUseDefShoCur;	/* Command line -show_cursor toggle */
 extern BOOLEAN LYCursesON;  /* start_curses()->TRUE, stop_curses()->FALSE */
diff --git a/src/LYHistory.c b/src/LYHistory.c
index 741ebe52..142703dd 100644
--- a/src/LYHistory.c
+++ b/src/LYHistory.c
@@ -1,5 +1,6 @@
 #include "HTUtils.h"
 #include "tcp.h"
+#include "HTTP.h"
 #include "HTAlert.h"
 #include "HText.h"
 #include "LYGlobalDefs.h"
@@ -476,8 +477,6 @@ PUBLIC int showhistory ARGS1(
     return(0);
 }
 
-extern BOOL reloading;
-
 /* 
  *  This function makes the history page seem like any other type of
  *  file since more info is needed than can be provided by the normal
diff --git a/src/LYKeymap.h b/src/LYKeymap.h
index b704c2d3..a426d2ba 100644
--- a/src/LYKeymap.h
+++ b/src/LYKeymap.h
@@ -1,4 +1,3 @@
-
 #ifndef LYKEYMAP_H
 #define LYKEYMAP_H
 
@@ -22,20 +21,20 @@ extern char override[];
 
 #define CURRENT_KEYMAP_TITLE "Current Key Map"
 
-#define       LYK_1     	1
-#define       LYK_2     	2
-#define       LYK_3     	3
-#define       LYK_4     	4
-#define       LYK_5     	5
-#define       LYK_6     	6
-#define       LYK_7     	7
-#define       LYK_8     	8
-#define       LYK_9     	9
+#define       LYK_1             1
+#define       LYK_2             2
+#define       LYK_3             3
+#define       LYK_4             4
+#define       LYK_5             5
+#define       LYK_6             6
+#define       LYK_7             7
+#define       LYK_8             8
+#define       LYK_9             9
 #define       LYK_SOURCE        10
 #define       LYK_RELOAD        11
-#define       LYK_PIPE  	12
-#define       LYK_QUIT  	13
-#define       LYK_ABORT 	14
+#define       LYK_PIPE          12
+#define       LYK_QUIT          13
+#define       LYK_ABORT         14
 #define       LYK_NEXT_PAGE     15
 #define       LYK_PREV_PAGE     16
 #define       LYK_UP_TWO        17
@@ -43,8 +42,8 @@ extern char override[];
 #define       LYK_UP_HALF       19
 #define       LYK_DOWN_HALF     20
 #define       LYK_REFRESH       21
-#define       LYK_HOME  	22
-#define       LYK_END   	23
+#define       LYK_HOME          22
+#define       LYK_END           23
 #define       LYK_PREV_LINK     24
 #define       LYK_NEXT_LINK     25
 #define       LYK_UP_LINK       26
@@ -54,26 +53,26 @@ extern char override[];
 #define       LYK_HISTORY       30
 #define       LYK_PREV_DOC      31
 #define       LYK_ACTIVATE      32
-#define       LYK_GOTO  	33
-#define       LYK_ECGOTO  	34
-#define       LYK_HELP  	35
-#define       LYK_INDEX 	36
+#define       LYK_GOTO          33
+#define       LYK_ECGOTO        34
+#define       LYK_HELP          35
+#define       LYK_INDEX         36
 #define       LYK_NOCACHE       37
 #define       LYK_INTERRUPT     38
 #define       LYK_MAIN_MENU     39
 #define       LYK_OPTIONS       40
 #define       LYK_INDEX_SEARCH  41
 #define       LYK_WHEREIS       42
-#define       LYK_NEXT  	43
+#define       LYK_NEXT          43
 #define       LYK_COMMENT       44
-#define       LYK_EDIT  	45
-#define       LYK_INFO  	46
-#define       LYK_PRINT 	47
+#define       LYK_EDIT          45
+#define       LYK_INFO          46
+#define       LYK_PRINT         47
 #define       LYK_ADD_BOOKMARK  48
 #define       LYK_DEL_BOOKMARK  49
 #define       LYK_VIEW_BOOKMARK 50
-#define       LYK_VLINKS	51
-#define       LYK_SHELL 	52
+#define       LYK_VLINKS        51
+#define       LYK_SHELL         52
 #define       LYK_DOWNLOAD      53
 #define       LYK_TRACE_TOGGLE  54
 #define       LYK_TRACE_LOG     55
@@ -81,29 +80,30 @@ extern char override[];
 #define       LYK_INLINE_TOGGLE 57
 #define       LYK_HEAD          58
 #define       LYK_DO_NOTHING    59
-#define       LYK_TOGGLE_HELP	60
-#define       LYK_JUMP		61
-#define       LYK_KEYMAP	62
-#define       LYK_LIST		63
-#define       LYK_TOOLBAR	64
-#define       LYK_HISTORICAL	65
-#define       LYK_MINIMAL	66
-#define       LYK_SOFT_DQUOTES	67
-#define       LYK_RAW_TOGGLE	68
+#define       LYK_TOGGLE_HELP   60
+#define       LYK_JUMP          61
+#define       LYK_KEYMAP        62
+#define       LYK_LIST          63
+#define       LYK_TOOLBAR       64
+#define       LYK_HISTORICAL    65
+#define       LYK_MINIMAL       66
+#define       LYK_SOFT_DQUOTES  67
+#define       LYK_RAW_TOGGLE    68
 #define       LYK_COOKIE_JAR    69
 #define       LYK_F_LINK_NUM    70
-#define       LYK_SWITCH_DTD	71
+#define       LYK_SWITCH_DTD    71
 
 #ifdef USE_EXTERNALS
-#define       LYK_EXTERN    72
+#define       LYK_EXTERN        72
 #if defined(VMS) || defined(DIRED_SUPPORT)
-#define		LYK_DIRED_MENU	73
+#define       LYK_DIRED_MENU    73
 #endif /* VMS || DIRED_SUPPORT */
 #else  /* USE_EXTERNALS */
 #if defined(VMS) || defined(DIRED_SUPPORT)
-#define		LYK_DIRED_MENU	72
+#define       LYK_DIRED_MENU    72
 #endif /* VMS || DIRED_SUPPORT */
 #endif /* !defined(USE_EXTERNALS) */
+
 #ifdef DIRED_SUPPORT
 #define       LYK_CREATE        (LYK_DIRED_MENU+1)
 #define       LYK_REMOVE        (LYK_DIRED_MENU+2)
@@ -112,8 +112,9 @@ extern char override[];
 #define       LYK_UPLOAD        (LYK_DIRED_MENU+5)
 #define       LYK_INSTALL       (LYK_DIRED_MENU+6)
 #endif /* DIRED_SUPPORT */
+
 #ifdef NOT_USED
-#define       LYK_VERSION	80
+#define       LYK_VERSION       80
 #define       LYK_FORM_UP       81
 #define       LYK_FORM_DOWN     82
 #endif /* NOT_USED */
diff --git a/src/LYMail.c b/src/LYMail.c
index d85a12ae..9e93fba2 100644
--- a/src/LYMail.c
+++ b/src/LYMail.c
@@ -329,7 +329,6 @@ PUBLIC void mailmsg ARGS4(int,cur, char *,owner_address,
     FILE *fd, *fp;
     char *address = NULL;
     char cmd[512], *cp, *cp0, *cp1;
-    int i;
 #if defined(VMS) || defined(DOSPATH)
     char my_tempfile[256];
     char *address_ptr1, *address_ptr2;
@@ -1251,7 +1250,7 @@ PRIVATE void terminate_letter ARGS1(int,sig)
 #if defined(VMS) || defined(DOSPATH)
     /* Refresh the screen to get rid of the "interrupt" message */
     if (!dump_output_immediately) {
-	clearok(curscr, TRUE);
+	lynx_force_repaint();
 	refresh();
     }
 #endif /* VMS */
diff --git a/src/LYMain.c b/src/LYMain.c
index b6d4297f..8b4e48e6 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,5 +1,6 @@
 #include "HTUtils.h"
 #include "tcp.h"
+#include "HTTP.h"
 #include "HTParse.h"
 #include "HTAccess.h"
 #include "HTList.h"
@@ -153,6 +154,7 @@ PUBLIC lynx_html_item_type *externals = NULL;
 #endif
 PUBLIC lynx_html_item_type *uploaders = NULL;
 PUBLIC int port_syntax = 1;
+PUBLIC BOOLEAN LYShowColor = SHOW_COLOR; /* to show or not to show */
 PUBLIC BOOLEAN LYShowCursor = SHOW_CURSOR; /* to show or not to show */
 PUBLIC BOOLEAN LYUseDefShoCur = TRUE;	/* Command line -show_cursor toggle */
 PUBLIC BOOLEAN LYforce_no_cache = FALSE;
@@ -362,7 +364,6 @@ PUBLIC char *log_file_name = NULL; /* for WAIS log file name    in libWWW */
 PUBLIC FILE *logfile = NULL;	   /* for WAIS log file output  in libWWW */
 #endif /* DECLARE_WAIS_LOGFILES */
 
-extern BOOL reloading;	    /* For Flushing Cache on Proxy Server (HTTP.c)  */
 extern int HTNewsChunkSize; /* Number of news articles per chunk (HTNews.c) */
 extern int HTNewsMaxChunk;  /* Max news articles before chunking (HTNews.c) */
 
@@ -875,14 +876,14 @@ PUBLIC int main ARGS2(
 		 */
 		while (fgets(buf, sizeof(buf), stdin) &&
 		       strncmp(buf, "---", 3) != 0) {
-		    int j;
+		    int j2;
 
 		    /*
 		     *  Strip line terminators.
 		     */
-		    for (j = strlen(buf) - 1; j >= 0 &&
-			 (buf[j] == CR || buf[j] == LF); j--) {
-			buf[j] = '\0';
+		    for (j2 = strlen(buf) - 1; j2 >= 0 &&
+			 (buf[j2] == CR || buf[j2] == LF); j2--) {
+			buf[j2] = '\0';
 		    }
 		    StrAllocCat(*get_data, buf);
 		}
@@ -913,14 +914,14 @@ PUBLIC int main ARGS2(
 		 */
 		while (fgets(buf, sizeof(buf), stdin) &&
 		       strncmp(buf, "---", 3) != 0) {
-		    int j;
+		    int j2;
 
 		     /*
 		      *  Strip line terminators.
 		      */
-		    for (j = strlen(buf) - 1; j >= 0 &&
-			 (buf[j] == CR || buf[j] == LF); j--) {
-			buf[j] = '\0';
+		    for (j2 = strlen(buf) - 1; j2 >= 0 &&
+			 (buf[j2] == CR || buf[j2] == LF); j2--) {
+			buf[j2] = '\0';
 		    }
 		    StrAllocCat(*post_data, buf);
 		}
@@ -2165,6 +2166,9 @@ PRIVATE void parse_arg ARGS3(
     } else if (strncmp(argv[0], "-nobrowse", 9) == 0) {
 	HTDirAccess = HT_DIR_FORBID;
 
+    } else if (strncmp(argv[0], "-nocolor", 8) == 0) {
+	LYShowColor = FALSE;
+
 #if defined(EXEC_LINKS) || defined(EXEC_SCRIPTS)
     } else if (strncmp(argv[0], "-noexec", 7) == 0) {
 	local_exec = FALSE;
diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c
index e751496b..69a618dd 100644
--- a/src/LYMainLoop.c
+++ b/src/LYMainLoop.c
@@ -56,8 +56,6 @@
 #include "LYexit.h"
 #include "LYLeaks.h"
 
-extern BOOL reloading;		/* For Flushing Cache on Proxy Server */
-
 PRIVATE int are_different PARAMS((document *doc1, document *doc2));
 PRIVATE int are_phys_different PARAMS((document *doc1, document *doc2));
 PUBLIC void HTGotoURLs_free NOPARAMS;
@@ -1748,7 +1746,7 @@ new_cmd:  /*
 #endif /* NO_ASSUME_SAME_DOC */
 	    FREE(curdoc.address); /* so it doesn't get pushed */
 #ifdef VMS
-	    clearok(curscr, TRUE);
+	    lynx_force_repaint();
 #endif /* VMS */
 	    /*
 	     *  Reload should force a cache refresh on a proxy.
@@ -2009,7 +2007,7 @@ new_cmd:  /*
 	case LYK_REFRESH:
 	   refresh_screen = TRUE;
 #if defined(VMS) || defined(USE_SLANG)
-	   clearok(curscr, TRUE);
+	   lynx_force_repaint();
 #endif /* VMS || USE_SLANG */
 	   break;
 
diff --git a/src/LYMap.c b/src/LYMap.c
index f15421cc..103a41eb 100644
--- a/src/LYMap.c
+++ b/src/LYMap.c
@@ -7,6 +7,7 @@
 
 #include "HTUtils.h"
 #include "tcp.h"
+#include "HTTP.h"
 #include "HTAnchor.h"
 #include "HTAccess.h"
 #include "HTFormat.h"
@@ -30,8 +31,6 @@
  
 #define FREE(x) if (x) {free(x); x=NULL;}
 
-extern BOOL reloading;    /* For Flushing Cache on Proxy Server */
-
 typedef struct _LYMapElement {
    char * address;
    char * title;
diff --git a/src/LYNews.c b/src/LYNews.c
index 917bc137..d4dafc64 100644
--- a/src/LYNews.c
+++ b/src/LYNews.c
@@ -433,7 +433,7 @@ PRIVATE void terminate_message ARGS1(
     /*
      *  Refresh the screen to get rid of the "interrupt" message.
      */
-    clearok(curscr, TRUE);
+    lynx_force_repaint();
     refresh();
 #endif /* VMS */
 }
diff --git a/src/LYNews.h b/src/LYNews.h
index 14d0e6bd..17d9d48a 100644
--- a/src/LYNews.h
+++ b/src/LYNews.h
@@ -1,5 +1,3 @@
-
-
 #ifndef LYNEWSPOST_H
 #define LYNEWSPOST_H
 
@@ -7,6 +5,8 @@
 #include "LYStructs.h"
 #endif /* LYSTRUCTS_H */
 
+extern BOOLEAN term_message;
+
 extern char *LYNewsPost PARAMS((char *newsgroups, BOOLEAN followup));
 
 #endif /* LYNEWSPOST_H */
diff --git a/src/LYOptions.c b/src/LYOptions.c
index 774279d2..ed870958 100644
--- a/src/LYOptions.c
+++ b/src/LYOptions.c
@@ -1,5 +1,6 @@
 #include "HTUtils.h"
 #include "tcp.h"
+#include "userdefs.h"
 #include "HTFTP.h"
 #include "HTML.h"
 #include "LYCurses.h"
@@ -19,21 +20,6 @@
 
 #include "LYLeaks.h"
 
-#ifndef BOXVERT
-#ifdef ALT_CHAR_SET
-#define BOXVERT 0   /* use alt char set for popup window vertical borders */
-#else
-#define BOXVERT '*'	/* character for popup window vertical borders */
-#endif
-#endif
-#ifndef BOXHORI
-#ifdef ALT_CHAR_SET
-#define BOXHORI 0   /* use alt char set for popup window horizontal borders */
-#else
-#define BOXHORI '*'	/* character for popup window horizontal borders */
-#endif
-#endif
-
 #define FREE(x) if (x) {free(x); x = NULL;}
 
 #ifdef VMS
@@ -55,7 +41,7 @@ PRIVATE int popup_choice PARAMS((
 	int		cur_choice,
 	int		line,
 	int		column,
-	char **		choices, 
+	char **		choices,
 	int		i_length,
 	int		disabled));
 
@@ -68,13 +54,13 @@ PRIVATE void option_statusline ARGS1(
      *  Make sure we have a pointer to a string.
      */
     if (text == NULL)
-        return;
+	return;
 
     /*
      *  Don't print statusline messages if dumping to stdout.
      */
     if (dump_output_immediately)
-        return;
+	return;
 
     /*
      *  Use _statusline() set to output on the bottom line. - FM
@@ -93,7 +79,7 @@ PUBLIC void options NOARGS
     /*
      *  If the user changes the display we need memory to put it in.
      */
-    char display_option[256]; 
+    char display_option[256];
 #ifndef VMS
     static char putenv_command[142];
 #endif /* !VMS */
@@ -101,29 +87,29 @@ PUBLIC void options NOARGS
     int CurrentCharSet = current_char_set;
     BOOLEAN CurrentRawMode = LYRawMode;
     BOOLEAN AddValueAccepted = FALSE;
-    
+
 #ifdef DIRED_SUPPORT
 #ifdef ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS
     if (LYlines < 24) {
-        HTAlert(OPTION_SCREEN_NEEDS_24);
+	HTAlert(OPTION_SCREEN_NEEDS_24);
 	return;
     }
 #else
     if (LYlines < 23) {
-        HTAlert(OPTION_SCREEN_NEEDS_23);
+	HTAlert(OPTION_SCREEN_NEEDS_23);
 	return;
     }
 #endif /* ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS */
 #else
 #ifdef ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS
     if (LYlines < 23) {
-        HTAlert(
+	HTAlert(
 	"Screen height must be at least 23 lines for the Options menu!");
 	return;
     }
 #else
     if (LYlines < 22) {
-        HTAlert(OPTION_SCREEN_NEEDS_22);
+	HTAlert(OPTION_SCREEN_NEEDS_22);
 	return;
     }
 #endif /* ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS */
@@ -138,9 +124,9 @@ draw_options:
      *  might have non-ASCII or multibyte/CJK characters. - FM
      */
     response = 0;
-    clear(); 
+    clear();
     move(0, 5);
-    
+
     lynx_start_h1_color ();
     addstr("         Options Menu (");
     addstr(LYNX_NAME);
@@ -148,7 +134,7 @@ draw_options:
     addstr(LYNX_VERSION);
     addch(')');
     lynx_stop_h1_color ();
-    move(L_EDITOR, 5);  
+    move(L_EDITOR, 5);
     addstr("E)ditor                      : ");
     addstr((editor && *editor) ? editor : "NONE");
 
@@ -159,41 +145,45 @@ draw_options:
     move(L_HOME, 5);
     addstr("mu(L)ti-bookmarks: ");
     addstr((LYMultiBookmarks ?
-    	      (LYMBMAdvanced ? "ADVANCED"
-	      		     : "STANDARD")
+	      (LYMBMAdvanced ? "ADVANCED"
+			     : "STANDARD")
 			     : "OFF     "));
     move(L_HOME, B_BOOK);
     if (LYMultiBookmarks) {
-        addstr("review/edit B)ookmarks files");
+	addstr("review/edit B)ookmarks files");
     } else {
-        addstr("B)ookmark file: ");
+	addstr("B)ookmark file: ");
 	addstr((bookmark_page && *bookmark_page) ? bookmark_page : "NONE");
     }
 
     move(L_FTPSTYPE, 5);
     addstr("F)TP sort criteria           : ");
     addstr((HTfileSortMethod == FILE_BY_NAME ? "By Filename" :
-	   (HTfileSortMethod == FILE_BY_SIZE ? "By Size    " : 
+	   (HTfileSortMethod == FILE_BY_SIZE ? "By Size    " :
 	   (HTfileSortMethod == FILE_BY_TYPE ? "By Type    " :
-	   				       "By Date    "))));
+					       "By Date    "))));
 
     move(L_MAIL_ADDRESS, 5);
     addstr("P)ersonal mail address       : ");
     addstr((personal_mail_address && *personal_mail_address) ?
-    				       personal_mail_address : "NONE");
+				       personal_mail_address : "NONE");
 
-    move(L_SSEARCH, 5); 
+    move(L_SSEARCH, 5);
     addstr("S)earching type              : ");
     addstr(case_sensitive ? "CASE SENSITIVE  " : "CASE INSENSITIVE");
 
     move(L_CHARSET, 5);
-    addstr("display (C)haracter set      : "); 
+    addstr("display (C)haracter set      : ");
     addstr(LYchar_set_names[current_char_set]);
-    
+
     move(L_RAWMODE, 5);
     addstr("Raw 8-bit or CJK m(O)de      : ");
     addstr(LYRawMode ? "ON " : "OFF");
 
+    move(L_COLOR, B_COLOR);
+    addstr("show color (&)  : ");
+    addstr(LYShowColor ? "ON " : "OFF");
+
     move(L_LANGUAGE, 5);
     addstr("preferred document lan(G)uage: ");
     addstr((language && *language) ? language : "NONE");
@@ -205,11 +195,11 @@ draw_options:
     move(L_BOOL_A, B_VIKEYS);
     addstr("V)I keys: ");
     addstr(vi_keys ? "ON " : "OFF");
-    
+
     move(L_BOOL_A, B_EMACSKEYS);
     addstr("e(M)acs keys: ");
     addstr(emacs_keys ? "ON " : "OFF");
-    
+
     move(L_BOOL_A, B_SHOW_DOTFILES);
     addstr("sho(W) dot files: ");
     addstr((!no_dotfiles && show_dotfiles) ? "ON " : "OFF");
@@ -238,13 +228,13 @@ draw_options:
     move(L_DIRED, 5);
     addstr("l(I)st directory style       : ");
     addstr((dir_list_style == FILES_FIRST) ? "Files first      " :
-	  ((dir_list_style == MIXED_STYLE) ? "Mixed style      " : 
+	  ((dir_list_style == MIXED_STYLE) ? "Mixed style      " :
 					     "Directories first"));
 #endif /* DIRED_SUPPORT */
 
     move(L_USER_MODE, 5);
     addstr("U)ser mode                   : ");
-    addstr(  (user_mode == NOVICE_MODE) ? "Novice      " : 
+    addstr(  (user_mode == NOVICE_MODE) ? "Novice      " :
       ((user_mode == INTERMEDIATE_MODE) ? "Intermediate" :
 					  "Advanced    "));
 
@@ -257,7 +247,7 @@ draw_options:
     addstr("local e(X)ecution links      : ");
 #ifndef NEVER_ALLOW_REMOTE_EXEC
     addstr(		  local_exec ? "ALWAYS ON           " :
-          (local_exec_on_local_files ? "FOR LOCAL FILES ONLY" :
+	  (local_exec_on_local_files ? "FOR LOCAL FILES ONLY" :
 				       "ALWAYS OFF          "));
 #else
     addstr(local_exec_on_local_files ? "FOR LOCAL FILES ONLY" :
@@ -267,29 +257,29 @@ draw_options:
 
     move(LYlines-3, 2);
     addstr(SELECT_SEGMENT);
-    standout();
+    start_bold();
     addstr(CAP_LETT_SEGMENT);
-    standend();
+    stop_bold();
     addstr(OF_OPT_LINE_SEGMENT);
     if (!no_option_save) {
-        addstr(" '");
-	standout();
+	addstr(" '");
+	start_bold();
 	addstr(">");
-	standend();
+	stop_bold();
 	addstr("'");
 	addstr(TO_SAVE_SEGMENT);
     }
     addstr(OR_SEGMENT);
     addstr("'");
-    standout();
+    start_bold();
     addstr("r");
-    standend();
+    stop_bold();
     addstr("'");
     addstr(TO_RETURN_SEGMENT);
 
     while (TOUPPER(response) != 'R' &&
 	   !LYisNonAlnumKeyname(response, LYK_PREV_DOC) &&
-           response != '>' && !term_options &&
+	   response != '>' && !term_options &&
 	   response != 7 &&  response != 3) {
 	if (AddValueAccepted == TRUE) {
 	    option_statusline(VALUE_ACCEPTED);
@@ -305,13 +295,13 @@ draw_options:
 	if (term_options || response == 7 || response == 3)
 	    response = 'R';
 	if (LYisNonAlnumKeyname(response, LYK_REFRESH)) {
-	    clearok(curscr, TRUE);
+	    lynx_force_repaint();
 	    goto draw_options;
 	}
 	switch (response) {
 	    case 'e':	/* Change the editor. */
 	    case 'E':
-	        if (no_editor) {
+		if (no_editor) {
 		    option_statusline(EDIT_DISABLED);
 		} else if (system_editor ) {
 		    option_statusline(EDITOR_LOCKED);
@@ -324,20 +314,20 @@ draw_options:
 			*display_option = '\0';
 		    }
 		    option_statusline(ACCEPT_DATA);
-		    move(L_EDITOR, COL_OPTION_VALUES);  
-		    standout();
+		    move(L_EDITOR, COL_OPTION_VALUES);
+		    start_bold();
 		    ch = LYgetstr(display_option, VISIBLE,
 				  sizeof(display_option), NORECALL);
-		    standend();
+		    stop_bold();
 		    move(L_EDITOR, COL_OPTION_VALUES);
 		    if (term_options || ch == -1) {
-		        addstr((editor && *editor) ?
+			addstr((editor && *editor) ?
 					    editor : "NONE");
 		    } else if (*display_option == '\0') {
 			FREE(editor);
 			addstr("NONE");
 		    } else {
-		        StrAllocCopy(editor, display_option);
+			StrAllocCopy(editor, display_option);
 			addstr(display_option);
 		    }
 		    clrtoeol();
@@ -357,10 +347,10 @@ draw_options:
 		}
 		option_statusline(ACCEPT_DATA);
 		move(L_DISPLAY, COL_OPTION_VALUES);
-		standout();
+		start_bold();
 		ch = LYgetstr(display_option, VISIBLE,
 			      sizeof(display_option), NORECALL);
-		standend();
+		stop_bold();
 		move(L_DISPLAY, COL_OPTION_VALUES);
 		if ((term_options || ch == -1) ||
 		    (display != NULL &&
@@ -381,12 +371,12 @@ draw_options:
 		    break;
 		} else if (*display_option == '\0') {
 		    if ((display == NULL) ||
-		        (display != NULL && *display == '\0')) {
+			(display != NULL && *display == '\0')) {
 			/*
 			 *  NULL or zero-length display string
 			 *  wasn't changed. - FM
 			 */
-		        addstr("NONE");
+			addstr("NONE");
 			clrtoeol();
 			option_statusline(VALUE_ACCEPTED);
 			response = ' ';
@@ -400,60 +390,60 @@ draw_options:
 		{
 		    int i;
 		    for (i = 0; display_option[i]; i++)
-		        display_option[i] = TOUPPER(display_option[i]);
+			display_option[i] = TOUPPER(display_option[i]);
 		    Define_VMSLogical(DISPLAY, display_option);
 		}
 #else
 		sprintf(putenv_command, "DISPLAY=%s", display_option);
 		putenv(putenv_command);
 #endif /* VMS */
-			if ((display = getenv(DISPLAY)) != NULL &&
-			    *display == '\0') {
-			    display = NULL;
-			}
-			addstr(display ? display : "NONE");
-			clrtoeol();
-			if ((display == NULL && *display_option == '\0') ||
-			    (display != NULL &&
-			     0 == strcmp(display, display_option))) {
-			    if (display == NULL &&
-			        LYisConfiguredForX == TRUE) {
-				option_statusline(VALUE_ACCEPTED_WARNING_X);
-			    } else if (display != NULL &&
-			        LYisConfiguredForX == FALSE) {
-				option_statusline(VALUE_ACCEPTED_WARNING_NONX);
-			    } else {
-			        option_statusline(VALUE_ACCEPTED);
-			    }
-			} else {
-			    if (*display_option) {
-			        option_statusline(FAILED_TO_SET_DISPLAY);
-			    } else {
-			        option_statusline(FAILED_CLEAR_SET_DISPLAY);
-			    }
-			}
-			response = ' ';
-			break;
+		if ((display = getenv(DISPLAY)) != NULL &&
+		    *display == '\0') {
+		    display = NULL;
+		}
+		addstr(display ? display : "NONE");
+		clrtoeol();
+		if ((display == NULL && *display_option == '\0') ||
+		    (display != NULL &&
+		     !strcmp(display, display_option))) {
+		    if (display == NULL &&
+			LYisConfiguredForX == TRUE) {
+			option_statusline(VALUE_ACCEPTED_WARNING_X);
+		    } else if (display != NULL &&
+			LYisConfiguredForX == FALSE) {
+			option_statusline(VALUE_ACCEPTED_WARNING_NONX);
+		    } else {
+			option_statusline(VALUE_ACCEPTED);
+		    }
+		} else {
+		    if (*display_option) {
+			option_statusline(FAILED_TO_SET_DISPLAY);
+		    } else {
+			option_statusline(FAILED_CLEAR_SET_DISPLAY);
+		    }
+		}
+		response = ' ';
+		break;
 
-		case 'l':	/* Change multibookmarks option. */
-		case 'L':
-			if (LYMBMBlocked) {
-			    option_statusline(MULTIBOOKMARKS_DISALLOWED);
-			    response = ' ';
-			    break;
-			}
-			choices[0] = NULL;
-			StrAllocCopy(choices[0],"OFF     ");
-			choices[1] = NULL;
-			StrAllocCopy(choices[1],"STANDARD");
-			choices[2] = NULL;
-			StrAllocCopy(choices[2],"ADVANCED");
-			choices[3] = NULL;
+	    case 'l':	/* Change multibookmarks option. */
+	    case 'L':
+		if (LYMBMBlocked) {
+		    option_statusline(MULTIBOOKMARKS_DISALLOWED);
+		    response = ' ';
+		    break;
+		}
+		choices[0] = NULL;
+		StrAllocCopy(choices[0], "OFF     ");
+		choices[1] = NULL;
+		StrAllocCopy(choices[1], "STANDARD");
+		choices[2] = NULL;
+		StrAllocCopy(choices[2], "ADVANCED");
+		choices[3] = NULL;
 		if (!LYSelectPopups) {
 		    LYMultiBookmarks = boolean_choice((LYMultiBookmarks *
 						       (1 + LYMBMAdvanced)),
-                                                          L_HOME, C_MULTI,
-                                                          choices);
+						      L_HOME, C_MULTI,
+						      choices);
 		} else {
 		    LYMultiBookmarks = popup_choice((LYMultiBookmarks *
 						     (1 + LYMBMAdvanced)),
@@ -461,12 +451,12 @@ draw_options:
 						    choices,
 						    3, FALSE);
 		}
-                        if (LYMultiBookmarks == 2) {
-                            LYMultiBookmarks = TRUE;
-                            LYMBMAdvanced = TRUE;
-                        } else {
-                            LYMBMAdvanced = FALSE;
-                        }
+		if (LYMultiBookmarks == 2) {
+		    LYMultiBookmarks = TRUE;
+		    LYMBMAdvanced = TRUE;
+		} else {
+		    LYMBMAdvanced = FALSE;
+		}
 #if defined(VMS) || defined(USE_SLANG)
 		if (LYSelectPopups) {
 		    move(L_HOME, C_MULTI);
@@ -481,99 +471,99 @@ draw_options:
 		if (!LYSelectPopups)
 #endif /* !VMS && !USE_SLANG */
 		{
-			move(L_HOME, B_BOOK);
-			clrtoeol();
-    			if (LYMultiBookmarks) {
-    			    addstr("review/edit B)ookmarks files");
-    			} else {
-			    addstr("B)ookmark file: ");
-			    addstr((bookmark_page && *bookmark_page) ?
-			    			       bookmark_page : "NONE");
-    			}
+		    move(L_HOME, B_BOOK);
+		    clrtoeol();
+		    if (LYMultiBookmarks) {
+			addstr("review/edit B)ookmarks files");
+		    } else {
+			addstr("B)ookmark file: ");
+			addstr((bookmark_page && *bookmark_page) ?
+						   bookmark_page : "NONE");
+		    }
 		}
-			response = ' ';
+		response = ' ';
 		if (LYSelectPopups) {
 #if !defined(VMS) || defined(USE_SLANG)
 		    if (term_options) {
-		        term_options = FALSE;
-	            } else {
-		        AddValueAccepted = TRUE;
+			term_options = FALSE;
+		    } else {
+			AddValueAccepted = TRUE;
 		    }
 		    goto draw_options;
 #else
 		    term_options = FALSE;
 #endif /* !VMS || USE_SLANG */
 		}
-			break;
+		break;
 
-		case 'b':	/* Change the bookmark page location. */
-		case 'B':
-			/*
-			 *  Anonymous users should not be allowed to
-			 *  change the bookmark page.
-			 */
-			if (!no_bookmark) {
-			    if (LYMultiBookmarks) {
-				edit_bookmarks();
-				signal(SIGINT, terminate_options);
-				goto draw_options;
-			    }
+	    case 'b':	/* Change the bookmark page location. */
+	    case 'B':
+		/*
+		 *  Anonymous users should not be allowed to
+		 *  change the bookmark page.
+		 */
+		if (!no_bookmark) {
+		    if (LYMultiBookmarks) {
+			edit_bookmarks();
+			signal(SIGINT, terminate_options);
+			goto draw_options;
+		    }
 		    if (bookmark_page && *bookmark_page) {
-			        strcpy(display_option, bookmark_page);
+			strcpy(display_option, bookmark_page);
 		    } else {  /* clear the NONE */
-				move(L_HOME, C_DEFAULT);
-				clrtoeol();
-			        *display_option = '\0';
-			    }
-			    option_statusline(ACCEPT_DATA);
-			    move(L_HOME, C_DEFAULT);  
-			    standout();
-			    ch = LYgetstr(display_option, VISIBLE,
-			    		  sizeof(display_option), NORECALL);
-			    standend();
-			    move(L_HOME, C_DEFAULT);
-			    if (term_options ||
-			        ch == -1 || *display_option == '\0') {
-			        addstr((bookmark_page && *bookmark_page) ?
-						    bookmark_page : "NONE");
-			    } else if (!LYPathOffHomeOK(display_option,
-						    sizeof(display_option))) {
-			        addstr((bookmark_page && *bookmark_page) ?
-						    bookmark_page : "NONE");
-				clrtoeol();
-				option_statusline(USE_PATH_OFF_HOME);
-				response = ' ';
-				break;
-			    } else {
-			        StrAllocCopy(bookmark_page, display_option);
-				StrAllocCopy(MBM_A_subbookmark[0],
-					     bookmark_page);
-				addstr(bookmark_page);
-			    }
-			    clrtoeol();
-			    option_statusline(VALUE_ACCEPTED);
-			} else { /* anonymous */
-			    option_statusline(BOOKMARK_CHANGE_DISALLOWED);
-			}
+			move(L_HOME, C_DEFAULT);
+			clrtoeol();
+			*display_option = '\0';
+		    }
+		    option_statusline(ACCEPT_DATA);
+		    move(L_HOME, C_DEFAULT);
+		    start_bold();
+		    ch = LYgetstr(display_option, VISIBLE,
+				  sizeof(display_option), NORECALL);
+		    stop_bold();
+		    move(L_HOME, C_DEFAULT);
+		    if (term_options ||
+			ch == -1 || *display_option == '\0') {
+			addstr((bookmark_page && *bookmark_page) ?
+						   bookmark_page : "NONE");
+		    } else if (!LYPathOffHomeOK(display_option,
+						sizeof(display_option))) {
+			addstr((bookmark_page && *bookmark_page) ?
+						   bookmark_page : "NONE");
+			clrtoeol();
+			option_statusline(USE_PATH_OFF_HOME);
 			response = ' ';
 			break;
+		    } else {
+			StrAllocCopy(bookmark_page, display_option);
+			StrAllocCopy(MBM_A_subbookmark[0],
+				     bookmark_page);
+			addstr(bookmark_page);
+		    }
+		    clrtoeol();
+		    option_statusline(VALUE_ACCEPTED);
+		} else { /* anonymous */
+		    option_statusline(BOOKMARK_CHANGE_DISALLOWED);
+		}
+		response = ' ';
+		break;
 
-		case 'f':	/* Change ftp directory sorting. */
-		case 'F':	/*  (also local for non-DIRED)   */
-                        /*
-			 *  Copy strings into choice array.
-			 */
-                        choices[0] = NULL;
-                        StrAllocCopy(choices[0],"By Filename");
-                        choices[1] = NULL;
-                        StrAllocCopy(choices[1],"By Type    ");
-                        choices[2] = NULL;
-                        StrAllocCopy(choices[2],"By Size    ");
-                        choices[3] = NULL;
-                        StrAllocCopy(choices[3],"By Date    ");
-                        choices[4] = NULL;
+	    case 'f':	/* Change ftp directory sorting. */
+	    case 'F':	/*  (also local for non-DIRED)   */
+		/*
+		 *  Copy strings into choice array.
+		 */
+		choices[0] = NULL;
+		StrAllocCopy(choices[0], "By Filename");
+		choices[1] = NULL;
+		StrAllocCopy(choices[1], "By Type    ");
+		choices[2] = NULL;
+		StrAllocCopy(choices[2], "By Size    ");
+		choices[3] = NULL;
+		StrAllocCopy(choices[3], "By Date    ");
+		choices[4] = NULL;
 		if (!LYSelectPopups) {
-                        HTfileSortMethod = boolean_choice(HTfileSortMethod,
+		    HTfileSortMethod = boolean_choice(HTfileSortMethod,
 						      L_FTPSTYPE, -1,
 						      choices);
 		} else {
@@ -587,79 +577,79 @@ draw_options:
 		    addstr(choices[HTfileSortMethod]);
 #endif /* VMS || USE_SLANG */
 		}
-                        FREE(choices[0]);
-                        FREE(choices[1]);
-                        FREE(choices[2]);
-                        FREE(choices[3]);
-			response = ' ';
+		FREE(choices[0]);
+		FREE(choices[1]);
+		FREE(choices[2]);
+		FREE(choices[3]);
+		response = ' ';
 		if (LYSelectPopups) {
 #if !defined(VMS) || defined(USE_SLANG)
 		    if (term_options) {
-		        term_options = FALSE;
-	            } else {
-		        AddValueAccepted = TRUE;
+			term_options = FALSE;
+		    } else {
+			AddValueAccepted = TRUE;
 		    }
 		    goto draw_options;
 #else
 		    term_options = FALSE;
 #endif /* !VMS || USE_SLANG */
 		}
-                        break;
+		break;
 
-		case 'p': /* Change personal mail address for From headers. */
-		case 'P':
+	    case 'p': /* Change personal mail address for From headers. */
+	    case 'P':
 		if (personal_mail_address && *personal_mail_address) {
-			    strcpy(display_option, personal_mail_address);
+		    strcpy(display_option, personal_mail_address);
 		} else {  /* clear the NONE */
-			    move(L_MAIL_ADDRESS, COL_OPTION_VALUES);
-			    addstr("    ");
-			    *display_option = '\0';
-			}
-			option_statusline(ACCEPT_DATA);
-	                move(L_MAIL_ADDRESS, COL_OPTION_VALUES);
-			standout();
-			ch = LYgetstr(display_option, VISIBLE,
-				      sizeof(display_option), NORECALL);
-			standend();
-	                move(L_MAIL_ADDRESS, COL_OPTION_VALUES);
-			if (term_options || ch == -1) {
-			    addstr((personal_mail_address &&
-				    *personal_mail_address) ?
-				      personal_mail_address : "NONE");
-			} else if (*display_option == '\0') {
-			    FREE(personal_mail_address);
-			    addstr("NONE");
-			} else {
-			    StrAllocCopy(personal_mail_address, display_option);
-			    addstr(display_option);
-			}
-			clrtoeol();
-			option_statusline(VALUE_ACCEPTED);
-			response = ' ';
-			break;
+		    move(L_MAIL_ADDRESS, COL_OPTION_VALUES);
+		    addstr("    ");
+		    *display_option = '\0';
+		}
+		option_statusline(ACCEPT_DATA);
+		move(L_MAIL_ADDRESS, COL_OPTION_VALUES);
+		start_bold();
+		ch = LYgetstr(display_option, VISIBLE,
+			      sizeof(display_option), NORECALL);
+		stop_bold();
+		move(L_MAIL_ADDRESS, COL_OPTION_VALUES);
+		if (term_options || ch == -1) {
+		    addstr((personal_mail_address &&
+			    *personal_mail_address) ?
+			      personal_mail_address : "NONE");
+		} else if (*display_option == '\0') {
+		    FREE(personal_mail_address);
+		    addstr("NONE");
+		} else {
+		    StrAllocCopy(personal_mail_address, display_option);
+		    addstr(display_option);
+		}
+		clrtoeol();
+		option_statusline(VALUE_ACCEPTED);
+		response = ' ';
+		break;
 
-		case 's':	/* Change case sentitivity for searches. */
-		case 'S':
-			/*
-			 *  Copy strings into choice array.
-			 */
-			choices[0] = NULL;
-			StrAllocCopy(choices[0],"CASE INSENSITIVE");
-			choices[1] = NULL;
-			StrAllocCopy(choices[1],"CASE SENSITIVE  ");
-			choices[2] = NULL;
-			case_sensitive = boolean_choice(case_sensitive,
+	    case 's':	/* Change case sentitivity for searches. */
+	    case 'S':
+		/*
+		 *  Copy strings into choice array.
+		 */
+		choices[0] = NULL;
+		StrAllocCopy(choices[0], "CASE INSENSITIVE");
+		choices[1] = NULL;
+		StrAllocCopy(choices[1], "CASE SENSITIVE  ");
+		choices[2] = NULL;
+		case_sensitive = boolean_choice(case_sensitive,
 						L_SSEARCH, -1, choices);
-			FREE(choices[0]);
-			FREE(choices[1]);
-			response = ' ';
-			break;
+		FREE(choices[0]);
+		FREE(choices[1]);
+		response = ' ';
+		break;
 
-		case 'c':	/* Change charset setting. */
-		case 'C':
+	    case 'c':	/* Change charset setting. */
+	    case 'C':
 		if (!LYSelectPopups) {
-			current_char_set = boolean_choice(current_char_set,
-		    				      L_CHARSET, -1,
+		    current_char_set = boolean_choice(current_char_set,
+						      L_CHARSET, -1,
 						      LYchar_set_names);
 		} else {
 		    current_char_set = popup_choice(current_char_set,
@@ -672,250 +662,269 @@ draw_options:
 		    addstr(LYchar_set_names[current_char_set]);
 #endif /* VMS || USE_SLANG */
 		}
-			/*
-			 *  Set the raw 8-bit or CJK mode defaults and
-			 *  character set if changed. - FM
-			 */
-			if (CurrentCharSet != current_char_set) {
-			    HTMLSetRawModeDefault(current_char_set);
-			    LYUseDefaultRawMode = TRUE;
-			    HTMLUseCharacterSet(current_char_set);
-			    CurrentCharSet = current_char_set;
-			    CurrentRawMode = LYRawMode;
+		/*
+		 *  Set the raw 8-bit or CJK mode defaults and
+		 *  character set if changed. - FM
+		 */
+		if (CurrentCharSet != current_char_set) {
+		    HTMLSetRawModeDefault(current_char_set);
+		    LYUseDefaultRawMode = TRUE;
+		    HTMLUseCharacterSet(current_char_set);
+		    CurrentCharSet = current_char_set;
+		    CurrentRawMode = LYRawMode;
 #if !defined(VMS) && !defined(USE_SLANG)
 		    if (!LYSelectPopups)
 #endif /* !VMS && !USE_SLANG */
 		    {
-			    move(L_RAWMODE, COL_OPTION_VALUES);
-			    clrtoeol();
-			    addstr(LYRawMode ? "ON " : "OFF");
-			}
+			move(L_RAWMODE, COL_OPTION_VALUES);
+			clrtoeol();
+			addstr(LYRawMode ? "ON " : "OFF");
+		    }
 		}
-			response = ' ';
+		response = ' ';
 		if (LYSelectPopups) {
 #if !defined(VMS) || defined(USE_SLANG)
 		    if (term_options) {
-		        term_options = FALSE;
-	            } else {
-		        AddValueAccepted = TRUE;
+			term_options = FALSE;
+		    } else {
+			AddValueAccepted = TRUE;
 		    }
 		    goto draw_options;
 #else
 		    term_options = FALSE;
 #endif /* !VMS || USE_SLANG */
 		}
-			break;
+		break;
 
-		case 'o':	/* Change raw mode setting. */
-		case 'O':
-			/*
-			 *  Copy strings into choice array.
-			 */
-			choices[0] = NULL;
-			StrAllocCopy(choices[0], "OFF");
-			choices[1] = NULL;
-			StrAllocCopy(choices[1], "ON ");
-			choices[2] = NULL;
+	    case 'o':	/* Change raw mode setting. */
+	    case 'O':
+		/*
+		 *  Copy strings into choice array.
+		 */
+		choices[0] = NULL;
+		StrAllocCopy(choices[0], "OFF");
+		choices[1] = NULL;
+		StrAllocCopy(choices[1], "ON ");
+		choices[2] = NULL;
 		LYRawMode = boolean_choice(LYRawMode, L_RAWMODE, -1, choices);
-			/*
-			 *  Set the LYUseDefaultRawMode value and character
-			 *  handling if LYRawMode was changed. - FM
-			 */
-			if (CurrentRawMode != LYRawMode) {
+		/*
+		 *  Set the LYUseDefaultRawMode value and character
+		 *  handling if LYRawMode was changed. - FM
+		 */
+		if (CurrentRawMode != LYRawMode) {
 		    HTMLSetUseDefaultRawMode(current_char_set, LYRawMode);
-			    HTMLSetCharacterHandling(current_char_set);
-			    CurrentRawMode = LYRawMode;
-			}
-			FREE(choices[0]);
-			FREE(choices[1]);
-			response = ' ';
-			break;
+		    HTMLSetCharacterHandling(current_char_set);
+		    CurrentRawMode = LYRawMode;
+		}
+		FREE(choices[0]);
+		FREE(choices[1]);
+		response = ' ';
+		break;
 
-		case 'g':	/* Change language preference. */
-		case 'G':
+	    case 'g':	/* Change language preference. */
+	    case 'G':
 		if (language && *language) {
-			    strcpy(display_option, language);
+		    strcpy(display_option, language);
 		} else {  /* clear the NONE */
-			    move(L_LANGUAGE, COL_OPTION_VALUES);
-			    addstr("    ");
-			    *display_option = '\0';
-			}
-			option_statusline(ACCEPT_DATA);
-			move(L_LANGUAGE, COL_OPTION_VALUES);
-			standout();
-			ch = LYgetstr(display_option, VISIBLE,
-				      sizeof(display_option), NORECALL);
-			standend();
-			move(L_LANGUAGE, COL_OPTION_VALUES);
-			if (term_options || ch == -1) {
-			    addstr((language && *language) ?
-			    	   language : "NONE");
-			} else if (*display_option == '\0') {
-			    FREE(language);
-			    addstr("NONE");
-			} else {
-			    StrAllocCopy(language, display_option);
-			    addstr(display_option);
-			}
-			clrtoeol();
-			option_statusline(VALUE_ACCEPTED);
-			response = ' ';
-			break;
+		    move(L_LANGUAGE, COL_OPTION_VALUES);
+		    addstr("    ");
+		    *display_option = '\0';
+		}
+		option_statusline(ACCEPT_DATA);
+		move(L_LANGUAGE, COL_OPTION_VALUES);
+		start_bold();
+		ch = LYgetstr(display_option, VISIBLE,
+			      sizeof(display_option), NORECALL);
+		stop_bold();
+		move(L_LANGUAGE, COL_OPTION_VALUES);
+		if (term_options || ch == -1) {
+		    addstr((language && *language) ?
+					  language : "NONE");
+		} else if (*display_option == '\0') {
+		    FREE(language);
+		    addstr("NONE");
+		} else {
+		    StrAllocCopy(language, display_option);
+		    addstr(display_option);
+		}
+		clrtoeol();
+		option_statusline(VALUE_ACCEPTED);
+		response = ' ';
+		break;
 
-		case 'h':	/* Change charset preference. */
-		case 'H':
+	    case 'h':	/* Change charset preference. */
+	    case 'H':
 		if (pref_charset && *pref_charset) {
-			    strcpy(display_option, pref_charset);
+		    strcpy(display_option, pref_charset);
 		} else {  /* clear the NONE */
-			    move(L_PREF_CHARSET, COL_OPTION_VALUES);
-			    addstr("    ");
-			    *display_option = '\0';
-			}
-			option_statusline(ACCEPT_DATA);
-			move(L_PREF_CHARSET, COL_OPTION_VALUES);
-			standout();
-			ch = LYgetstr(display_option, VISIBLE,
-				      sizeof(display_option), NORECALL);
-			standend();
-			move(L_PREF_CHARSET, COL_OPTION_VALUES);
-			if (term_options || ch == -1) {
-			    addstr((pref_charset && *pref_charset) ?
-			    	   pref_charset : "NONE");
-			} else if (*display_option == '\0') {
-			    FREE(pref_charset);
-			    addstr("NONE");
-			} else {
-			    StrAllocCopy(pref_charset, display_option);
-			    addstr(display_option);
-			}
-			clrtoeol();
-			option_statusline(VALUE_ACCEPTED);
-			response = ' ';
-			break;
+		    move(L_PREF_CHARSET, COL_OPTION_VALUES);
+		    addstr("    ");
+		    *display_option = '\0';
+		}
+		option_statusline(ACCEPT_DATA);
+		move(L_PREF_CHARSET, COL_OPTION_VALUES);
+		start_bold();
+		ch = LYgetstr(display_option, VISIBLE,
+			      sizeof(display_option), NORECALL);
+		stop_bold();
+		move(L_PREF_CHARSET, COL_OPTION_VALUES);
+		if (term_options || ch == -1) {
+		    addstr((pref_charset && *pref_charset) ?
+			   pref_charset : "NONE");
+		} else if (*display_option == '\0') {
+		    FREE(pref_charset);
+		    addstr("NONE");
+		} else {
+		    StrAllocCopy(pref_charset, display_option);
+		    addstr(display_option);
+		}
+		clrtoeol();
+		option_statusline(VALUE_ACCEPTED);
+		response = ' ';
+		break;
 
-		case 'v':	/* Change VI keys setting. */
-		case 'V':
-			/*
-			 *  Copy strings into choice array.
-			 */
-			choices[0] = NULL;
-			StrAllocCopy(choices[0],"OFF");
-			choices[1] = NULL;
-			StrAllocCopy(choices[1],"ON ");
-			choices[2] = NULL;
-			vi_keys = boolean_choice(vi_keys,
-						 L_BOOL_A, C_VIKEYS,
-						 choices);
+	    case 'v':	/* Change VI keys setting. */
+	    case 'V':
+		/*
+		 *  Copy strings into choice array.
+		 */
+		choices[0] = NULL;
+		StrAllocCopy(choices[0], "OFF");
+		choices[1] = NULL;
+		StrAllocCopy(choices[1], "ON ");
+		choices[2] = NULL;
+		vi_keys = boolean_choice(vi_keys,
+					 L_BOOL_A, C_VIKEYS,
+					 choices);
 		if (vi_keys) {
-                            set_vi_keys();
+		    set_vi_keys();
 		} else {
-                            reset_vi_keys();
+		    reset_vi_keys();
 		}
-			FREE(choices[0]);
-			FREE(choices[1]);
-			response = ' ';
-			break;
+		FREE(choices[0]);
+		FREE(choices[1]);
+		response = ' ';
+		break;
 
-		case 'M':	/* Change emacs keys setting. */
-		case 'm':
-			/*
-			 *  Copy strings into choice array.
-			 */
-			choices[0] = NULL;
-			StrAllocCopy(choices[0],"OFF");
-			choices[1] = NULL;
-			StrAllocCopy(choices[1],"ON ");
-			choices[2] = NULL;
-			emacs_keys = boolean_choice(emacs_keys,
-						    L_BOOL_A, C_EMACSKEYS,
-						    choices);
+	    case 'M':	/* Change emacs keys setting. */
+	    case 'm':
+		/*
+		 *  Copy strings into choice array.
+		 */
+		choices[0] = NULL;
+		StrAllocCopy(choices[0], "OFF");
+		choices[1] = NULL;
+		StrAllocCopy(choices[1], "ON ");
+		choices[2] = NULL;
+		emacs_keys = boolean_choice(emacs_keys,
+					    L_BOOL_A, C_EMACSKEYS,
+					    choices);
 		if (emacs_keys) {
-                            set_emacs_keys();
+		    set_emacs_keys();
 		} else {
-                            reset_emacs_keys();
+		    reset_emacs_keys();
 		}
-			FREE(choices[0]);
-			FREE(choices[1]);
-			response = ' ';
-			break;
+		FREE(choices[0]);
+		FREE(choices[1]);
+		response = ' ';
+		break;
 
-		case 'W':	/* Change show dotfiles setting. */
-		case 'w':
-			   if (no_dotfiles) {
-			       option_statusline(DOTFILE_ACCESS_DISABLED);
-			   } else {
-			       /*
-			        *  Copy strings into choice array.
-				*/
-			       choices[0] = NULL;
-			       StrAllocCopy(choices[0],"OFF");
-			       choices[1] = NULL;
-			       StrAllocCopy(choices[1],"ON ");
-			       choices[2] = NULL;
-			       show_dotfiles = boolean_choice(show_dotfiles,
-							      L_BOOL_A,
-							      C_SHOW_DOTFILES, 
-							      choices);
-			       FREE(choices[0]);
-			       FREE(choices[1]);
-			   }
-			   response = ' ';
-			   break;
-
-		case 't':	/* Change select popups setting. */
-		case 'T':
-			/*
-			 *  Copy strings into choice array.
-			 */
-			choices[0] = NULL;
-			StrAllocCopy(choices[0], "OFF");
-			choices[1] = NULL;
-			StrAllocCopy(choices[1], "ON ");
-			choices[2] = NULL;
-			LYSelectPopups = boolean_choice(LYSelectPopups,
-							L_BOOL_B,
-							C_SELECT_POPUPS,
-							choices);
-			FREE(choices[0]);
-			FREE(choices[1]);
-			response = ' ';
-			break;
+	    case 'W':	/* Change show dotfiles setting. */
+	    case 'w':
+		if (no_dotfiles) {
+		    option_statusline(DOTFILE_ACCESS_DISABLED);
+		} else {
+		    /*
+		     *  Copy strings into choice array.
+		     */
+		    choices[0] = NULL;
+		    StrAllocCopy(choices[0], "OFF");
+		    choices[1] = NULL;
+		    StrAllocCopy(choices[1], "ON ");
+		    choices[2] = NULL;
+		    show_dotfiles = boolean_choice(show_dotfiles,
+						   L_BOOL_A,
+						   C_SHOW_DOTFILES,
+						   choices);
+		    FREE(choices[0]);
+		    FREE(choices[1]);
+		}
+		response = ' ';
+		break;
 
-		case '@':	/* Change show cursor setting. */
-			/*
-			 *  Copy strings into choice array.
-			 */
-			choices[0] = NULL;
-			StrAllocCopy(choices[0], "OFF");
-			choices[1] = NULL;
-			StrAllocCopy(choices[1], "ON ");
-			choices[2] = NULL;
-			LYShowCursor = boolean_choice(LYShowCursor,
-						      L_BOOL_B,
-						      C_SHOW_CURSOR,
-						      choices);
-			FREE(choices[0]);
-			FREE(choices[1]);
-			response = ' ';
-			break;
+	    case 't':	/* Change select popups setting. */
+	    case 'T':
+		/*
+		 *  Copy strings into choice array.
+		 */
+		choices[0] = NULL;
+		StrAllocCopy(choices[0], "OFF");
+		choices[1] = NULL;
+		StrAllocCopy(choices[1], "ON ");
+		choices[2] = NULL;
+		LYSelectPopups = boolean_choice(LYSelectPopups,
+						L_BOOL_B,
+						C_SELECT_POPUPS,
+						choices);
+		FREE(choices[0]);
+		FREE(choices[1]);
+		response = ' ';
+		break;
 
-		case 'k':	/* Change keypad mode. */
-		case 'K':
-			/*
-			 *  Copy strings into choice array.
-			 */
-			choices[0] = NULL;
-			StrAllocCopy(choices[0],
-				     "Numbers act as arrows             ");
-			choices[1] = NULL;
-			StrAllocCopy(choices[1],
-				     "Links are numbered                ");
-			choices[2] = NULL;
-			StrAllocCopy(choices[2],
-				     "Links and form fields are numbered");
-			choices[3] = NULL;
+	    case '@':	/* Change show cursor setting. */
+		/*
+		 *  Copy strings into choice array.
+		 */
+		choices[0] = NULL;
+		StrAllocCopy(choices[0], "OFF");
+		choices[1] = NULL;
+		StrAllocCopy(choices[1], "ON ");
+		choices[2] = NULL;
+		LYShowCursor = boolean_choice(LYShowCursor,
+					      L_BOOL_B,
+					      C_SHOW_CURSOR,
+					      choices);
+		FREE(choices[0]);
+		FREE(choices[1]);
+		response = ' ';
+		break;
+
+	    case '&':	/* Change show color setting. */
+		/*
+		 *  Copy strings into choice array.
+		 */
+		choices[0] = NULL;
+		StrAllocCopy(choices[0], "OFF");
+		choices[1] = NULL;
+		StrAllocCopy(choices[1], "ON ");
+		choices[2] = NULL;
+		LYShowColor = boolean_choice(LYShowColor,
+					      L_COLOR,
+					      C_COLOR,
+					      choices);
+		FREE(choices[0]);
+		FREE(choices[1]);
+		response = ' ';
+		lynx_force_repaint();
+		break;
+
+	    case 'k':	/* Change keypad mode. */
+	    case 'K':
+		/*
+		 *  Copy strings into choice array.
+		 */
+		choices[0] = NULL;
+		StrAllocCopy(choices[0],
+			     "Numbers act as arrows             ");
+		choices[1] = NULL;
+		StrAllocCopy(choices[1],
+			     "Links are numbered                ");
+		choices[2] = NULL;
+		StrAllocCopy(choices[2],
+			     "Links and form fields are numbered");
+		choices[3] = NULL;
 		if (!LYSelectPopups) {
-			keypad_mode = boolean_choice(keypad_mode,
+		    keypad_mode = boolean_choice(keypad_mode,
 						 L_KEYPAD, -1,
 						 choices);
 		} else {
@@ -930,32 +939,32 @@ draw_options:
 #endif /* VMS || USE_SLANG */
 		}
 		if (keypad_mode == NUMBERS_AS_ARROWS) {
-                            set_numbers_as_arrows();
+		    set_numbers_as_arrows();
 		} else {
-                            reset_numbers_as_arrows();
+		    reset_numbers_as_arrows();
 		}
-			FREE(choices[0]);
-			FREE(choices[1]);
-			FREE(choices[2]);
-			response = ' ';
+		FREE(choices[0]);
+		FREE(choices[1]);
+		FREE(choices[2]);
+		response = ' ';
 		if (LYSelectPopups) {
 #if !defined(VMS) || defined(USE_SLANG)
 		    if (term_options) {
-		        term_options = FALSE;
-	            } else {
-		        AddValueAccepted = TRUE;
+			term_options = FALSE;
+		    } else {
+			AddValueAccepted = TRUE;
 		    }
 		    goto draw_options;
 #else
 		    term_options = FALSE;
 #endif /* !VMS || USE_SLANG */
 		}
-			break;
+		break;
 
-		case 'n':	/* Change line editor key bindings. */
-		case 'N':
+	    case 'n':	/* Change line editor key bindings. */
+	    case 'N':
 		if (!LYSelectPopups) {
-			current_lineedit = boolean_choice(current_lineedit,
+		    current_lineedit = boolean_choice(current_lineedit,
 						      L_LINEED, -1,
 						      LYLineeditNames);
 		} else {
@@ -969,36 +978,36 @@ draw_options:
 		    addstr(LYLineeditNames[current_lineedit]);
 #endif /* VMS || USE_SLANG */
 		}
-			response = ' ';
+		response = ' ';
 		if (LYSelectPopups) {
 #if !defined(VMS) || defined(USE_SLANG)
 		    if (term_options) {
-		        term_options = FALSE;
-	            } else {
-		        AddValueAccepted = TRUE;
+			term_options = FALSE;
+		    } else {
+			AddValueAccepted = TRUE;
 		    }
 		    goto draw_options;
 #else
 		    term_options = FALSE;
 #endif /* !VMS || USE_SLANG */
 		}
-			break;
+		break;
 
 #ifdef DIRED_SUPPORT
-		case 'i':	/* Change local directory sorting. */
-		case 'I':
-			/*
-			 *  Copy strings into choice array.
-			 */
-			choices[0] = NULL;
-			StrAllocCopy(choices[0],"Directories first");
-			choices[1] = NULL;
-			StrAllocCopy(choices[1],"Files first      ");
-			choices[2] = NULL;
-			StrAllocCopy(choices[2],"Mixed style      ");
-			choices[3] = NULL;
+	    case 'i':	/* Change local directory sorting. */
+	    case 'I':
+		/*
+		 *  Copy strings into choice array.
+		 */
+		choices[0] = NULL;
+		StrAllocCopy(choices[0], "Directories first");
+		choices[1] = NULL;
+		StrAllocCopy(choices[1], "Files first      ");
+		choices[2] = NULL;
+		StrAllocCopy(choices[2], "Mixed style      ");
+		choices[3] = NULL;
 		if (!LYSelectPopups) {
-			dir_list_style = boolean_choice(dir_list_style,
+		    dir_list_style = boolean_choice(dir_list_style,
 						    L_DIRED, -1,
 						    choices);
 		} else {
@@ -1012,39 +1021,39 @@ draw_options:
 		    addstr(choices[dir_list_style]);
 #endif /* VMS || USE_SLANG */
 		}
-			FREE(choices[0]);
-			FREE(choices[1]);
-			FREE(choices[2]);
-			response = ' ';
+		FREE(choices[0]);
+		FREE(choices[1]);
+		FREE(choices[2]);
+		response = ' ';
 		if (LYSelectPopups) {
 #if !defined(VMS) || defined(USE_SLANG)
 		    if (term_options) {
-		        term_options = FALSE;
-	            } else {
-		        AddValueAccepted = TRUE;
+			term_options = FALSE;
+		    } else {
+			AddValueAccepted = TRUE;
 		    }
 		    goto draw_options;
 #else
 		    term_options = FALSE;
 #endif /* !VMS || USE_SLANG */
 		}
-			break;
+		break;
 #endif /* DIRED_SUPPORT */
 
-		case 'u':	/* Change user mode. */
-		case 'U':
-			/*
-			 *  Copy strings into choice array.
-			 */
-			choices[0] = NULL;
-			StrAllocCopy(choices[0],"Novice      ");
-			choices[1] = NULL;
-			StrAllocCopy(choices[1],"Intermediate");
-			choices[2] = NULL;
-			StrAllocCopy(choices[2],"Advanced    ");
-			choices[3] = NULL;
+	    case 'u':	/* Change user mode. */
+	    case 'U':
+		/*
+		 *  Copy strings into choice array.
+		 */
+		choices[0] = NULL;
+		StrAllocCopy(choices[0], "Novice      ");
+		choices[1] = NULL;
+		StrAllocCopy(choices[1], "Intermediate");
+		choices[2] = NULL;
+		StrAllocCopy(choices[2], "Advanced    ");
+		choices[3] = NULL;
 		if (!LYSelectPopups) {
-			user_mode = boolean_choice(user_mode,
+		    user_mode = boolean_choice(user_mode,
 					       L_USER_MODE, -1,
 					       choices);
 		} else {
@@ -1058,105 +1067,105 @@ draw_options:
 		    addstr(choices[user_mode]);
 #endif /* VMS || USE_SLANG */
 		}
-			FREE(choices[0]);
-			FREE(choices[1]);
-			FREE(choices[2]);
+		FREE(choices[0]);
+		FREE(choices[1]);
+		FREE(choices[2]);
 		if (user_mode == NOVICE_MODE) {
 		    display_lines = (LYlines - 4);
 		} else {
-			   display_lines = LYlines-2;
+		    display_lines = LYlines-2;
 		}
-			response = ' ';
+		response = ' ';
 		if (LYSelectPopups) {
 #if !defined(VMS) || defined(USE_SLANG)
 		    if (term_options) {
-		        term_options = FALSE;
-	            } else {
-		        AddValueAccepted = TRUE;
+			term_options = FALSE;
+		    } else {
+			AddValueAccepted = TRUE;
 		    }
 		    goto draw_options;
 #else
 		    term_options = FALSE;
 #endif /* !VMS || USE_SLANG */
 		}
-			break;
+		break;
 
-		case 'a':	/* Change user agent string. */
-		case 'A':
-			if (!no_useragent) {
+	    case 'a':	/* Change user agent string. */
+	    case 'A':
+		if (!no_useragent) {
 		    if (LYUserAgent && *LYUserAgent) {
-			        strcpy(display_option, LYUserAgent);
+			strcpy(display_option, LYUserAgent);
 		    } else {  /* clear the NONE */
-				move(L_HOME, COL_OPTION_VALUES);
-				addstr("    ");
-			        *display_option = '\0';
-			    }
-			    option_statusline(ACCEPT_DATA_OR_DEFAULT);
-			    move(L_USER_AGENT, COL_OPTION_VALUES);  
-			    standout();
-			    ch = LYgetstr(display_option, VISIBLE,
-			    		  sizeof(display_option), NORECALL);
-			    standend();
-			    move(L_USER_AGENT, COL_OPTION_VALUES);
-			    if (term_options || ch == -1) {
-			        addstr((LYUserAgent &&
-					*LYUserAgent) ?
-					  LYUserAgent : "NONE");
-			    } else if (*display_option == '\0') {
-			        StrAllocCopy(LYUserAgent, LYUserAgentDefault);
-				addstr((LYUserAgent &&
-					*LYUserAgent) ?
-					  LYUserAgent : "NONE");
-			    } else {
-			        StrAllocCopy(LYUserAgent, display_option);
-				addstr(display_option);
-			    }
-			    clrtoeol();
-			    if (LYUserAgent && *LYUserAgent &&
-			    	!strstr(LYUserAgent, "Lynx") &&
-				!strstr(LYUserAgent, "lynx")) {
-				option_statusline(UA_COPYRIGHT_WARNING);
-			    } else {
-			        option_statusline(VALUE_ACCEPTED);
-			    }
-			} else { /* disallowed */
-			    option_statusline(UA_COPYRIGHT_WARNING);
-			}
-			response = ' ';
-			break;
+			move(L_HOME, COL_OPTION_VALUES);
+			addstr("    ");
+			*display_option = '\0';
+		    }
+		    option_statusline(ACCEPT_DATA_OR_DEFAULT);
+		    move(L_USER_AGENT, COL_OPTION_VALUES);
+		    start_bold();
+		    ch = LYgetstr(display_option, VISIBLE,
+				  sizeof(display_option), NORECALL);
+		    stop_bold();
+		    move(L_USER_AGENT, COL_OPTION_VALUES);
+		    if (term_options || ch == -1) {
+			addstr((LYUserAgent &&
+				*LYUserAgent) ?
+				  LYUserAgent : "NONE");
+		    } else if (*display_option == '\0') {
+			StrAllocCopy(LYUserAgent, LYUserAgentDefault);
+			addstr((LYUserAgent &&
+				*LYUserAgent) ?
+				  LYUserAgent : "NONE");
+		    } else {
+			StrAllocCopy(LYUserAgent, display_option);
+			addstr(display_option);
+		    }
+		    clrtoeol();
+		    if (LYUserAgent && *LYUserAgent &&
+			!strstr(LYUserAgent, "Lynx") &&
+			!strstr(LYUserAgent, "lynx")) {
+			option_statusline(UA_COPYRIGHT_WARNING);
+		    } else {
+			option_statusline(VALUE_ACCEPTED);
+		    }
+		} else { /* disallowed */
+		    option_statusline(UA_COPYRIGHT_WARNING);
+		}
+		response = ' ';
+		break;
 
 #ifdef ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS
-		case 'x':	/* Change local exec restriction. */
-		case 'X':
+	    case 'x':	/* Change local exec restriction. */
+	    case 'X':
 		if (exec_frozen && !LYSelectPopups) {
 		    option_statusline(CHANGE_OF_SETTING_DISALLOWED);
 		    response = ' ';
 		    break;
 		}
 #ifndef NEVER_ALLOW_REMOTE_EXEC
-			    if (local_exec) {
-				itmp = 2;
+		if (local_exec) {
+		    itmp = 2;
 		} else
 #else
-			  {
+		{
 #endif /* NEVER_ALLOW_REMOTE_EXEC */
 		    if (local_exec_on_local_files) {
-				    itmp= 1;
+			itmp= 1;
 		    } else {
-				    itmp = 0;
-			   }
-		}
-			   /*
-			    *  Copy strings into choice array.
-			    */
-			   choices[0] = NULL;
-			   StrAllocCopy(choices[0],"ALWAYS OFF          ");
-			   choices[1] = NULL;
-			   StrAllocCopy(choices[1],"FOR LOCAL FILES ONLY");
-			   choices[2] = NULL;
+			itmp = 0;
+		    }
+		}
+		/*
+		 *  Copy strings into choice array.
+		 */
+		choices[0] = NULL;
+		StrAllocCopy(choices[0], "ALWAYS OFF          ");
+		choices[1] = NULL;
+		StrAllocCopy(choices[1], "FOR LOCAL FILES ONLY");
+		choices[2] = NULL;
 #ifndef NEVER_ALLOW_REMOTE_EXEC
-			   StrAllocCopy(choices[2],"ALWAYS ON           ");
-			   choices[3] = NULL;
+		StrAllocCopy(choices[2], "ALWAYS ON           ");
+		choices[3] = NULL;
 #endif /* NEVER_ALLOW_REMOTE_EXEC */
 		if (!LYSelectPopups) {
 		    itmp = boolean_choice(itmp,
@@ -1173,74 +1182,74 @@ draw_options:
 		    addstr(choices[itmp]);
 #endif /* VMS || USE_SLANG */
 		}
-			   FREE(choices[0]);
-			   FREE(choices[1]);
+		FREE(choices[0]);
+		FREE(choices[1]);
 #ifndef NEVER_ALLOW_REMOTE_EXEC
-			   FREE(choices[2]);
+		FREE(choices[2]);
 #endif /* NEVER_ALLOW_REMOTE_EXEC */
 		if (!exec_frozen) {
-			   switch(itmp) {
-			      case 0:
-				  local_exec = FALSE;
-				  local_exec_on_local_files = FALSE;
-				  break;
-			      case 1:
-				  local_exec = FALSE;
-				  local_exec_on_local_files = TRUE;
-				  break;
+		    switch (itmp) {
+			case 0:
+			    local_exec = FALSE;
+			    local_exec_on_local_files = FALSE;
+			    break;
+			case 1:
+			    local_exec = FALSE;
+			    local_exec_on_local_files = TRUE;
+			    break;
 #ifndef NEVER_ALLOW_REMOTE_EXEC
-			      case 2:
-				  local_exec = TRUE;
-				  local_exec_on_local_files = FALSE;
-				  break;
+			case 2:
+			    local_exec = TRUE;
+			    local_exec_on_local_files = FALSE;
+			    break;
 #endif /* NEVER_ALLOW_REMOTE_EXEC */
-			  } /* end switch */
-			}
-			response = ' ';
+		    } /* end switch */
+		}
+		response = ' ';
 		if (LYSelectPopups) {
 #if !defined(VMS) || defined(USE_SLANG)
 		    if (exec_frozen || term_options) {
-		        term_options = FALSE;
-	            } else {
-		        AddValueAccepted = TRUE;
+			term_options = FALSE;
+		    } else {
+			AddValueAccepted = TRUE;
 		    }
 		    goto draw_options;
 #else
 		    term_options = FALSE;
 #endif /* !VMS || USE_SLANG */
 		}
-			break;
+		break;
 #endif /* ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS */
 
-		case '>':	/* Save current options to RC file. */
-                        if (!no_option_save) {
-                            option_statusline(SAVING_OPTIONS);
+	    case '>':	/* Save current options to RC file. */
+		if (!no_option_save) {
+		    option_statusline(SAVING_OPTIONS);
 		    if (save_rc()) {
-				option_statusline(OPTIONS_SAVED);
+			option_statusline(OPTIONS_SAVED);
 		    } else {
-				HTAlert(OPTIONS_NOT_SAVED);
+			HTAlert(OPTIONS_NOT_SAVED);
 		    }
-                        } else {
-			    option_statusline(R_TO_RETURN_TO_LYNX);
-			    /*
-			     *  Change response so that we don't exit
-			     *  the options menu.
-			     */
-			    response = ' ';
-			} 
-			break;
+		} else {
+		    option_statusline(R_TO_RETURN_TO_LYNX);
+		    /*
+		     *  Change response so that we don't exit
+		     *  the options menu.
+		     */
+		    response = ' ';
+		}
+		break;
 
-		case 'r':	/* Return to document (quit options menu). */
-		case 'R':
-			break;
+	    case 'r':	/* Return to document (quit options menu). */
+	    case 'R':
+		break;
 
-		default:
-			if (!no_option_save) {
-			    option_statusline(SAVE_OR_R_TO_RETURN_TO_LYNX);
-			} else {
-			    option_statusline(R_TO_RETURN_TO_LYNX);
-			}
-	    }  /* end switch */
+	    default:
+		if (!no_option_save) {
+		    option_statusline(SAVE_OR_R_TO_RETURN_TO_LYNX);
+		} else {
+		    option_statusline(R_TO_RETURN_TO_LYNX);
+		}
+	}  /* end switch */
     }  /* end while */
 
     term_options = FALSE;
@@ -1265,7 +1274,7 @@ PRIVATE int boolean_choice ARGS4(
 #ifdef VMS
     extern BOOLEAN HadVMSInterrupt; /* Flag from cleanup_sig() AST */
 #endif /* VMS */
-	
+
     /*
      *  Get the number of choices and then make
      *  number zero-based.
@@ -1284,7 +1293,7 @@ PRIVATE int boolean_choice ARGS4(
      *  Highlight the current choice.
      */
     move(line, col);
-    standout();
+    start_reverse();
     addstr(choices[cur_choice]);
     if (LYShowCursor)
 	move(line, (col - 1));
@@ -1300,7 +1309,7 @@ PRIVATE int boolean_choice ARGS4(
     while (1) {
 	move(line, col);
 	if (term_options == FALSE) {
-	response = LYgetch();
+	    response = LYgetch();
 	}
 	if (term_options || response == 7 || response == 3) {
 	     /*
@@ -1320,7 +1329,7 @@ PRIVATE int boolean_choice ARGS4(
 #endif /* VMS */
 	if ((response != '\n' && response != '\r') &&
 	    (cmd = keymap[response+1]) != LYK_ACTIVATE) {
-	     switch (cmd) {
+	    switch (cmd) {
 		case LYK_HOME:
 		    cur_choice = 0;
 		    break;
@@ -1330,7 +1339,7 @@ PRIVATE int boolean_choice ARGS4(
 		    break;
 
 		case LYK_REFRESH:
-		    clearok(curscr, TRUE);
+		    lynx_force_repaint();
 		    refresh();
 		    break;
 
@@ -1341,37 +1350,37 @@ PRIVATE int boolean_choice ARGS4(
 		    term_options = TRUE;
 		    break;
 
-	     case LYK_PREV_PAGE:
+		case LYK_PREV_PAGE:
 		case LYK_UP_HALF:
-	     case LYK_UP_TWO:
-	     case LYK_PREV_LINK:
-	     case LYK_UP_LINK:
-	     case LYK_LEFT_LINK:
-		if(cur_choice == 0)
-		    cur_choice = number;  /* go back to end */
-		else
-		    cur_choice--;
-		break;
-		
-	     case LYK_1:
-	     case LYK_2:
-	     case LYK_3:
-	     case LYK_4:
-	     case LYK_5:
-	     case LYK_6:
-	     case LYK_7:
-	     case LYK_8:
-	     case LYK_9:
-	       if((cmd - LYK_1 + 1) <= number) {
-		 cur_choice = cmd -LYK_1 + 1;
-		 break;
-	       }  /* else fall through! */
-	     default:
-	    if (cur_choice == number)
-		cur_choice = 0;  /* go over the top and around */
-	    else
-		cur_choice++;
-	      }  /* end of switch */
+		case LYK_UP_TWO:
+		case LYK_PREV_LINK:
+		case LYK_UP_LINK:
+		case LYK_LEFT_LINK:
+		    if (cur_choice == 0)
+			cur_choice = number;  /* go back to end */
+		    else
+			cur_choice--;
+		    break;
+
+		case LYK_1:
+		case LYK_2:
+		case LYK_3:
+		case LYK_4:
+		case LYK_5:
+		case LYK_6:
+		case LYK_7:
+		case LYK_8:
+		case LYK_9:
+		    if((cmd - LYK_1 + 1) <= number) {
+			cur_choice = cmd -LYK_1 + 1;
+			break;
+		    }  /* else fall through! */
+		default:
+		    if (cur_choice == number)
+			cur_choice = 0;  /* go over the top and around */
+		    else
+			cur_choice++;
+	    }  /* end of switch */
 	    addstr(choices[cur_choice]);
 	    if (LYShowCursor)
 		move(line, (col - 1));
@@ -1381,16 +1390,16 @@ PRIVATE int boolean_choice ARGS4(
 	     *  Unhighlight choice.
 	     */
 	    move(line, col);
-	    standend();
+	    stop_reverse();
 	    addstr(choices[cur_choice]);
 
 	    if (term_options) {
-	        term_options = FALSE;
+		term_options = FALSE;
 		option_statusline(CANCELLED);
 		sleep(InfoSecs);
 		option_statusline("");
 	    } else {
-	    option_statusline(VALUE_ACCEPTED);
+		option_statusline(VALUE_ACCEPTED);
 	    }
 	    return(cur_choice);
 	}
@@ -1400,7 +1409,7 @@ PRIVATE int boolean_choice ARGS4(
 PRIVATE void terminate_options ARGS1(
 	int,		sig)
 {
-    term_options=TRUE;
+    term_options = TRUE;
     /*
      *  Reassert the AST.
      */
@@ -1410,7 +1419,7 @@ PRIVATE void terminate_options ARGS1(
      *  Refresh the screen to get rid of the "interrupt" message.
      */
     if (!dump_output_immediately) {
-	clearok(curscr, TRUE);
+	lynx_force_repaint();
 	refresh();
     }
 #endif /* VMS */
@@ -1427,7 +1436,7 @@ PUBLIC void edit_bookmarks NOARGS
     int a; /* misc counter */
     char MBM_tmp_line[256]; /* buffer for LYgetstr */
     char ehead_buffer[265];
-    
+
     /*
      *  We need (MBM_V_MAXFILES + MULTI_OFFSET) lines to display
      *  the whole list at once.  Otherwise break it up into two
@@ -1443,45 +1452,45 @@ draw_bookmark_list:
      *  to increase the chances that any non-ASCII or multibyte/CJK
      *  characters will be handled properly. - FM
      */
-    clear(); 
+    clear();
     move(0, 5);
 
     lynx_start_h1_color ();
 
     if (LYlines < (MBM_V_MAXFILES + MULTI_OFFSET)) {
-        sprintf(ehead_buffer, MULTIBOOKMARKS_EHEAD_MASK, MBM_current);
+	sprintf(ehead_buffer, MULTIBOOKMARKS_EHEAD_MASK, MBM_current);
 	addstr(ehead_buffer);
     } else {
-        addstr(MULTIBOOKMARKS_EHEAD);
+	addstr(MULTIBOOKMARKS_EHEAD);
     }
-    
-   lynx_stop_h1_color ();
+
+    lynx_stop_h1_color ();
 
     if (LYlines < (MBM_V_MAXFILES + MULTI_OFFSET)) {
 	for (a = ((MBM_V_MAXFILES/2 + 1) * (MBM_current - 1));
-                      a <= ((float)MBM_V_MAXFILES/2 * MBM_current); a++) {
+		      a <= ((float)MBM_V_MAXFILES/2 * MBM_current); a++) {
 	    move((3 + a) - ((MBM_V_MAXFILES/2 + 1)*(MBM_current - 1)), 5);
 	    addch((unsigned char)(a + 'A'));
 	    addstr(" : ");
 	    if (MBM_A_subdescript[a])
-	        addstr(MBM_A_subdescript[a]);
+		addstr(MBM_A_subdescript[a]);
 	    move((3 + a) - ((MBM_V_MAXFILES/2 + 1)*(MBM_current - 1)), 35);
 	    addstr("| ");
 	    if (MBM_A_subbookmark[a]) {
-	        addstr(MBM_A_subbookmark[a]);
+		addstr(MBM_A_subbookmark[a]);
 	    }
-        }
+	}
     } else {
 	for (a = 0; a <= MBM_V_MAXFILES; a++) {
 	    move(3 + a, 5);
 	    addch((unsigned char)(a + 'A'));
 	    addstr(" : ");
 	    if (MBM_A_subdescript[a])
-	        addstr(MBM_A_subdescript[a]);
+		addstr(MBM_A_subdescript[a]);
 	    move(3 + a, 35);
 	    addstr("| ");
 	    if (MBM_A_subbookmark[a]) {
-	        addstr(MBM_A_subbookmark[a]);
+		addstr(MBM_A_subbookmark[a]);
 	    }
 	}
     }
@@ -1490,51 +1499,51 @@ draw_bookmark_list:
      *  Only needed when we have 2 screens.
      */
     if (LYlines < MBM_V_MAXFILES + MULTI_OFFSET) {
-        move((LYlines - 4), 0);
+	move((LYlines - 4), 0);
 	addstr("'");
-	standout();
+	start_bold();
 	addstr("[");
-	standend();
+	stop_bold();
 	addstr("' ");
 	addstr(PREVIOUS);
 	addstr(", '");
-	standout();
+	start_bold();
 	addstr("]");
-	standend();
+	stop_bold();
 	addstr("' ");
 	addstr(NEXT_SCREEN);
     }
 
     move((LYlines - 3), 0);
     if (!no_option_save) {
-        addstr("'");
-	standout();
+	addstr("'");
+	start_bold();
 	addstr(">");
-	standend();
+	stop_bold();
 	addstr("'");
 	addstr(TO_SAVE_SEGMENT);
     }
     addstr(OR_SEGMENT);
     addstr("'");
-    standout();
+    start_bold();
     addstr("^G");
-    standend();
+    stop_bold();
     addstr("'");
     addstr(TO_RETURN_SEGMENT);
 
     while (!term_options &&
-           !LYisNonAlnumKeyname(response, LYK_PREV_DOC) &&
+	   !LYisNonAlnumKeyname(response, LYK_PREV_DOC) &&
 	   response != 7 && response != 3 &&
 	   response != '>') {
 
 	move((LYlines - 2), 0);
-        
+
 	lynx_start_prompt_color ();
 	addstr(MULTIBOOKMARKS_LETTER);
 	lynx_stop_prompt_color ();
 
 	refresh();
-        response = (def_response ? def_response : LYgetch());
+	response = (def_response ? def_response : LYgetch());
 	def_response = 0;
 
 	/*
@@ -1553,7 +1562,7 @@ draw_bookmark_list:
 		option_statusline(SAVING_OPTIONS);
 		if (save_rc())
 		    option_statusline(OPTIONS_SAVED);
-		else 
+		else
 		    HTAlert(OPTIONS_NOT_SAVED);
 	    } else {
 		option_statusline(R_TO_RETURN_TO_LYNX);
@@ -1570,7 +1579,7 @@ draw_bookmark_list:
 	 *  Check for a refresh.
 	 */
 	if (LYisNonAlnumKeyname(response, LYK_REFRESH)) {
-	    clearok(curscr, TRUE);
+	    lynx_force_repaint();
 	    continue;
 	}
 
@@ -1596,78 +1605,78 @@ draw_bookmark_list:
 
 	/*
 	 *  Instead of using 26 case statements, we set up
-         *  a scan through the letters and edit the lines
-         *  that way.
-         */
+	 *  a scan through the letters and edit the lines
+	 *  that way.
+	 */
 	for (a = 0; a <= MBM_V_MAXFILES; a++) {
 	    if ((TOUPPER(response) - 'A') == a) {
 		if (LYlines < (MBM_V_MAXFILES + MULTI_OFFSET)) {
 		    if (MBM_current == 1 && a > (MBM_V_MAXFILES/2)) {
-		        MBM_current = 2;
-		        def_response = response;
+			MBM_current = 2;
+			def_response = response;
 			goto draw_bookmark_list;
 		    }
 		    if (MBM_current == 2 && a < (MBM_V_MAXFILES/2)) {
-		        MBM_current = 1;
-		        def_response = response;
+			MBM_current = 1;
+			def_response = response;
 			goto draw_bookmark_list;
 		    }
 		}
 		option_statusline(ACCEPT_DATA);
 
 		if (a > 0) {
-		    standout();
+		    start_bold();
 		    if (LYlines < (MBM_V_MAXFILES + MULTI_OFFSET))
-    		        move(
+			move(
 			 (3 + a) - ((MBM_V_MAXFILES/2 + 1)*(MBM_current - 1)),
 			     9);
 		    else
-    		        move((3 + a), 9);
+			move((3 + a), 9);
 		    strcpy(MBM_tmp_line,
-    		           (!MBM_A_subdescript[a] ?
-			   		       "" : MBM_A_subdescript[a]));
+			   (!MBM_A_subdescript[a] ?
+					       "" : MBM_A_subdescript[a]));
 		    ch = LYgetstr(MBM_tmp_line, VISIBLE,
-	    		          sizeof(MBM_tmp_line), NORECALL);
-		    standend();
+				  sizeof(MBM_tmp_line), NORECALL);
+		    stop_bold();
 
 		    if (strlen(MBM_tmp_line) < 1) {
-		        FREE(MBM_A_subdescript[a]);
+			FREE(MBM_A_subdescript[a]);
 		    } else {
-		        StrAllocCopy(MBM_A_subdescript[a], MBM_tmp_line);
+			StrAllocCopy(MBM_A_subdescript[a], MBM_tmp_line);
 		    }
 		    if (LYlines < (MBM_V_MAXFILES + MULTI_OFFSET))
-    			move(
+			move(
 			 (3 + a) - ((MBM_V_MAXFILES/2 + 1)*(MBM_current - 1)),
 			     5);
 		    else
-    			move((3 + a), 5);
+			move((3 + a), 5);
 		    addch((unsigned char)(a + 'A'));
 		    addstr(" : ");
-    		    if (MBM_A_subdescript[a])
+		    if (MBM_A_subdescript[a])
 			addstr(MBM_A_subdescript[a]);
 		    clrtoeol();
-	   	    refresh();
+		    refresh();
 		}
 
 		if (LYlines < (MBM_V_MAXFILES + MULTI_OFFSET))
-    		    move((3 + a) - ((MBM_V_MAXFILES/2 + 1)*(MBM_current - 1)),
-		    	 35);
+		    move((3 + a) - ((MBM_V_MAXFILES/2 + 1)*(MBM_current - 1)),
+			 35);
 		else
-    		    move((3 + a), 35);
-    		addstr("| ");
+		    move((3 + a), 35);
+		addstr("| ");
 
-		standout();
+		start_bold();
 		strcpy(MBM_tmp_line,
-    		       (!MBM_A_subbookmark[a] ? "" : MBM_A_subbookmark[a]));
+		       (!MBM_A_subbookmark[a] ? "" : MBM_A_subbookmark[a]));
 		ch = LYgetstr(MBM_tmp_line, VISIBLE,
-	    		      sizeof(MBM_tmp_line), NORECALL);
-		standend();
+			      sizeof(MBM_tmp_line), NORECALL);
+		stop_bold();
 
 		if (*MBM_tmp_line == '\0') {
 		    if (a == 0)
-		        StrAllocCopy(MBM_A_subbookmark[a], bookmark_page);
+			StrAllocCopy(MBM_A_subbookmark[a], bookmark_page);
 		    else
-		        FREE(MBM_A_subbookmark[a]);
+			FREE(MBM_A_subbookmark[a]);
 		} else if (!LYPathOffHomeOK(MBM_tmp_line,
 					    sizeof(MBM_tmp_line))) {
 			LYMBM_statusline(USE_PATH_OFF_HOME);
@@ -1675,18 +1684,18 @@ draw_bookmark_list:
 		} else {
 		    StrAllocCopy(MBM_A_subbookmark[a], MBM_tmp_line);
 		    if (a == 0) {
-		        StrAllocCopy(bookmark_page, MBM_A_subbookmark[a]);
+			StrAllocCopy(bookmark_page, MBM_A_subbookmark[a]);
 		    }
 		}
 		if (LYlines < (MBM_V_MAXFILES + MULTI_OFFSET))
-    		    move((3 + a) - ((MBM_V_MAXFILES/2 + 1)*(MBM_current-1)),
-		    	 35);
+		    move((3 + a) - ((MBM_V_MAXFILES/2 + 1)*(MBM_current-1)),
+			 35);
 		else
-    		    move((3 + a), 35);
+		    move((3 + a), 35);
 		addstr("| ");
-    		if (MBM_A_subbookmark[a])
+		if (MBM_A_subbookmark[a])
 		    addstr(MBM_A_subbookmark[a]);
-	   	clrtoeol();
+		clrtoeol();
 		move(LYlines-1, 0);
 		clrtoeol();
 		break;
@@ -1719,7 +1728,7 @@ PRIVATE int get_popup_choice_number ARGS1(
      *  Get the number, possibly with a suffix, from the user.
      */
     if (LYgetstr(temp, VISIBLE, sizeof(temp), NORECALL) < 0 ||
-        *temp == 0 || term_options) {
+	*temp == 0 || term_options) {
 	option_statusline(CANCELLED);
 	sleep(InfoSecs);
 	*c = '\0';
@@ -1732,11 +1741,11 @@ PRIVATE int get_popup_choice_number ARGS1(
      *  Otherwise, zero c.  Then return the number.
      */
     if (strchr(temp, 'g') != NULL || strchr(temp, 'G') != NULL) {
-        *c = 'g';
+	*c = 'g';
     } else if (strchr(temp, 'p') != NULL || strchr(temp, 'P') != NULL) {
-        *c = 'p';
+	*c = 'p';
     } else {
-        *c = '\0';
+	*c = '\0';
     }
     return(atoi(temp));
 }
@@ -1771,7 +1780,7 @@ PRIVATE int popup_choice ARGS6(
 #ifdef VMS
     extern BOOLEAN HadVMSInterrupt; /* Flag from cleanup_sig() AST */
 #endif /* VMS */
-    static char prev_target[512]; 		/* Search string buffer */
+    static char prev_target[512];		/* Search string buffer */
     static char prev_target_buffer[512];	/* Next search buffer */
     static BOOL first = TRUE;
     char *cp;
@@ -1832,9 +1841,9 @@ PRIVATE int popup_choice ARGS6(
      *  the number of real choices.
      */
     if (i_length < 1) {
-        i_length = num_choices;
+	i_length = num_choices;
     } else {
-        /*
+	/*
 	 *  Otherwise, it is really one number too high.
 	 */
 	i_length--;
@@ -1851,15 +1860,15 @@ PRIVATE int popup_choice ARGS6(
      *  Hmm...  If the bottom goes beyond the number of lines available,
      */
     if (bottom > DisplayLines) {
-        /*
+	/*
 	 *  Position the window at the top if we have more
 	 *  choices than will fit in the window.
 	 */
 	if ((i_length + 3) > DisplayLines) {
 	    top = 0;
-            bottom = (top + (i_length + 3));
+	    bottom = (top + (i_length + 3));
 	    if (bottom > DisplayLines)
-	        bottom = (DisplayLines + 1);
+		bottom = (DisplayLines + 1);
 	} else {
 	    /*
 	     *  Try to position the window so that the selected choice will
@@ -1881,7 +1890,7 @@ PRIVATE int popup_choice ARGS6(
      *  Move the window down if it's too high.
      */
     if (bottom < ly + 2) {
-        bottom = ly + 2;
+	bottom = ly + 2;
 	if (bottom > DisplayLines + 1)
 	    bottom = DisplayLines + 1;
 	top = bottom - length - 2;
@@ -1896,11 +1905,20 @@ PRIVATE int popup_choice ARGS6(
 #else
     if (!(form_window = newwin(bottom - top, (Lnum + width + 4),
 			       top, (lx - 1))) &&
-        !(form_window = newwin(bottom - top, 0, top, 0))) {
+	!(form_window = newwin(bottom - top, 0, top, 0))) {
 	option_statusline(POPUP_FAILED);
-        return(orig_choice);
+	return(orig_choice);
     }
     scrollok(form_window, TRUE);
+#ifdef NCURSES
+#ifdef wgetbkgd
+#define getbkgd(w) wgetbkgd(w)	/* workaround pre-1.9.9g bug */
+#endif
+    LYsubwindow(form_window);
+#ifdef getbkgd			/* not defined in ncurses 1.8.7 */
+    wbkgd(form_window, getbkgd(stdscr));
+#endif
+#endif
 #endif /* USE_SLANG */
 
     /*
@@ -1921,7 +1939,7 @@ PRIVATE int popup_choice ARGS6(
      *   length ranges from 0...m
      */
     if (cur_choice >= length) {
-        window_offset = cur_choice - length + 1;
+	window_offset = cur_choice - length + 1;
     }
 
     /*
@@ -1940,7 +1958,7 @@ redraw:
      *  Display the boxed choices.
      */
     for (i = 0; i <= num_choices; i++) {
-        if (i >= window_offset && i - window_offset < length) {
+	if (i >= window_offset && i - window_offset < length) {
 	    sprintf(Cnum, "%s%d: ",
 			   ((num_choices > 8 && i < 9) ?
 						   " " : ""),
@@ -1973,7 +1991,7 @@ redraw:
      *  Loop on user input.
      */
     while (cmd != LYK_ACTIVATE) {
-        /*
+	/*
 	 *  Unreverse cur choice.
 	 */
 	if (Cptr != NULL) {
@@ -1988,7 +2006,7 @@ redraw:
 #else
 	    wmove(form_window, ((i + 1) - window_offset), 2);
 	    waddstr(form_window, Cnum);
-            waddstr(form_window, Cptr[i]);
+	    waddstr(form_window, Cptr[i]);
 #endif /* USE_SLANG */
 	}
 	Cptr = choices;
@@ -2059,7 +2077,7 @@ redraw:
 	}
 #endif /* VMS */
 
-        switch(cmd) {
+	switch(cmd) {
 	    case LYK_F_LINK_NUM:
 		c = '\0';
 	    case LYK_1:
@@ -2086,7 +2104,7 @@ redraw:
 		     *  Treat 1 or less as the first page. - FM
 		     */
 		    if (number <= 1) {
-		        if (window_offset == 0) {
+			if (window_offset == 0) {
 			    option_statusline(ALREADY_AT_CHOICE_BEGIN);
 			    sleep(MessageSecs);
 			    if (disabled) {
@@ -2111,7 +2129,7 @@ redraw:
 		     *  number of pages as the last page. - FM
 		     */
 		    if (number >= npages) {
-		        if (window_offset >= ((num_choices - length) + 1)) {
+			if (window_offset >= ((num_choices - length) + 1)) {
 			    option_statusline(ALREADY_AT_CHOICE_END);
 			    sleep(MessageSecs);
 			    if (disabled) {
@@ -2129,7 +2147,7 @@ redraw:
 			    cur_choice = window_offset;
 			if (disabled) {
 			    option_statusline(CHOICE_LIST_UNM_MSG);
-   			} else {
+			} else {
 			    option_statusline(CHOICE_LIST_MESSAGE);
 			}
 			goto redraw;
@@ -2152,7 +2170,7 @@ redraw:
 		    cur_choice = window_offset = ((number - 1) * length);
 		    if (disabled) {
 			option_statusline(CHOICE_LIST_UNM_MSG);
-   		    } else {
+		    } else {
 			option_statusline(CHOICE_LIST_MESSAGE);
 		    }
 		    goto redraw;
@@ -2190,12 +2208,12 @@ redraw:
 			     *  The choice already is current. - FM
 			     */
 			    sprintf(buffer,
-			    	    CHOICE_ALREADY_CURRENT, (number + 1));
+				    CHOICE_ALREADY_CURRENT, (number + 1));
 			    option_statusline(buffer);
 			    sleep(MessageSecs);
 			    if (disabled) {
 				option_statusline(CHOICE_LIST_UNM_MSG);
-   			    } else {
+			    } else {
 				option_statusline(CHOICE_LIST_MESSAGE);
 			    }
 			    break;
@@ -2210,7 +2228,7 @@ redraw:
 			    j = (number - cur_choice);
 			    cur_choice = number;
 			    if ((j > 0) &&
-			        (cur_choice - window_offset) >= length) {
+				(cur_choice - window_offset) >= length) {
 				window_offset += j;
 				if (window_offset > (num_choices - length + 1))
 				    window_offset = (num_choices - length + 1);
@@ -2221,7 +2239,7 @@ redraw:
 			    }
 			    if (disabled) {
 				option_statusline(CHOICE_LIST_UNM_MSG);
-   			    } else {
+			    } else {
 				option_statusline(CHOICE_LIST_MESSAGE);
 			    }
 			    goto redraw;
@@ -2240,12 +2258,12 @@ redraw:
 		 */
 		if (disabled) {
 		    option_statusline(CHOICE_LIST_UNM_MSG);
-   		} else {
+		} else {
 		    option_statusline(CHOICE_LIST_MESSAGE);
 		}
 		break;
 
-            case LYK_PREV_LINK:
+	    case LYK_PREV_LINK:
 	    case LYK_UP_LINK:
 
 		if (cur_choice > 0)
@@ -2258,12 +2276,12 @@ redraw:
 		    window_offset--;
 		    goto redraw;
 		}
-                break;
+		break;
 
-            case LYK_NEXT_LINK:
+	    case LYK_NEXT_LINK:
 	    case LYK_DOWN_LINK:
 		if (cur_choice < num_choices)
-                    cur_choice++;
+		    cur_choice++;
 
 		/*
 		 *  Scroll the window down if necessary
@@ -2272,7 +2290,7 @@ redraw:
 		    window_offset++;
 		    goto redraw;
 		}
-                break;
+		break;
 
 	    case LYK_NEXT_PAGE:
 		/*
@@ -2293,7 +2311,7 @@ redraw:
 		     */
 		    window_offset += length;
 		    if (window_offset > (num_choices - length)) {
-		        window_offset = (num_choices - length + 1);
+			window_offset = (num_choices - length + 1);
 		    }
 
 		    /*
@@ -2331,7 +2349,7 @@ redraw:
 		     */
 		    window_offset -= length;
 		    if (window_offset < 0) {
-		        window_offset = 0;
+			window_offset = 0;
 		    }
 
 		    /*
@@ -2349,7 +2367,7 @@ redraw:
 		break;
 
 	    case LYK_HOME:
-	        cur_choice = 0;
+		cur_choice = 0;
 		if (window_offset > 0) {
 		    window_offset = 0;
 		    goto redraw;
@@ -2357,17 +2375,17 @@ redraw:
 		break;
 
 	    case LYK_END:
-	        cur_choice = num_choices;
+		cur_choice = num_choices;
 		if (window_offset != (num_choices - length + 1)) {
 		    window_offset = (num_choices - length + 1);
 		    goto redraw;
 		}
 		break;
 
-            case LYK_DOWN_TWO:
-	        cur_choice += 2;
+	    case LYK_DOWN_TWO:
+		cur_choice += 2;
 		if (cur_choice > num_choices)
-                    cur_choice = num_choices;
+		    cur_choice = num_choices;
 
 		/*
 		 *  Scroll the window down if necessary.
@@ -2375,13 +2393,13 @@ redraw:
 		if ((cur_choice - window_offset) >= length) {
 		    window_offset += 2;
 		    if (window_offset > (num_choices - length + 1))
-		        window_offset = (num_choices - length + 1);
+			window_offset = (num_choices - length + 1);
 		    goto redraw;
 		}
-                break;
+		break;
 
 	    case LYK_UP_TWO:
-	        cur_choice -= 2;
+		cur_choice -= 2;
 		if (cur_choice < 0)
 		    cur_choice = 0;
 
@@ -2391,15 +2409,15 @@ redraw:
 		if ((cur_choice - window_offset) < 0) {
 		    window_offset -= 2;
 		    if (window_offset < 0)
-		        window_offset = 0;
+			window_offset = 0;
 		    goto redraw;
 		}
-                break;
+		break;
 
-            case LYK_DOWN_HALF:
-	        cur_choice += (length/2);
+	    case LYK_DOWN_HALF:
+		cur_choice += (length/2);
 		if (cur_choice > num_choices)
-                    cur_choice = num_choices;
+		    cur_choice = num_choices;
 
 		/*
 		 *  Scroll the window down if necessary.
@@ -2407,13 +2425,13 @@ redraw:
 		if ((cur_choice - window_offset) >= length) {
 		    window_offset += (length/2);
 		    if (window_offset > (num_choices - length + 1))
-		        window_offset = (num_choices - length + 1);
+			window_offset = (num_choices - length + 1);
 		    goto redraw;
 		}
-                break;
+		break;
 
 	    case LYK_UP_HALF:
-	        cur_choice -= (length/2);
+		cur_choice -= (length/2);
 		if (cur_choice < 0)
 		    cur_choice = 0;
 
@@ -2423,14 +2441,14 @@ redraw:
 		if ((cur_choice - window_offset) < 0) {
 		    window_offset -= (length/2);
 		    if (window_offset < 0)
-		        window_offset = 0;
+			window_offset = 0;
 		    goto redraw;
 		}
-                break;
+		break;
 
 	    case LYK_REFRESH:
-	        clearok(curscr, TRUE);
-	        refresh();
+		lynx_force_repaint();
+		refresh();
 		break;
 
 	    case LYK_NEXT:
@@ -2450,18 +2468,18 @@ redraw:
 		     *  of a popup window. - FM
 		     */
 		    if ((cp = (char *)HTList_objectAt(search_queries,
-	    					      0)) != NULL) {
+						      0)) != NULL) {
 			strcpy(prev_target_buffer, cp);
 			QueryNum = 0;
 			FirstRecall = FALSE;
 		    }
 		}
-	        strcpy(prev_target, prev_target_buffer);
+		strcpy(prev_target, prev_target_buffer);
 	    case LYK_WHEREIS:
-	        if (*prev_target == '\0' ) {
+		if (*prev_target == '\0' ) {
 		    option_statusline(ENTER_WHEREIS_QUERY);
 		    if ((ch = LYgetstr(prev_target, VISIBLE,
-	    		 	       sizeof(prev_target_buffer),
+				       sizeof(prev_target_buffer),
 				       recall)) < 0) {
 			/*
 			 *  User cancelled the search via ^G. - FM
@@ -2478,24 +2496,24 @@ check_recall:
 		    /*
 		     *  No entry.  Simply break.   - FM
 		     */
-	            option_statusline(CANCELLED);
+		    option_statusline(CANCELLED);
 		    sleep(InfoSecs);
 		    goto restore_popup_statusline;
 		}
 
 		if (recall && ch == UPARROW) {
 		    if (FirstRecall) {
-		        /*
+			/*
 			 *  Use the current string or
 			 *  last query in the list. - FM
 			 */
 			FirstRecall = FALSE;
 			if (*prev_target_buffer) {
 			    for (QueryNum = (QueryTotal - 1);
-			         QueryNum > 0; QueryNum--) {
+				 QueryNum > 0; QueryNum--) {
 				if ((cp = (char *)HTList_objectAt(
 							search_queries,
-	    						QueryNum)) != NULL &&
+							QueryNum)) != NULL &&
 				    !strcmp(prev_target_buffer, cp)) {
 				    break;
 				}
@@ -2515,7 +2533,7 @@ check_recall:
 			 */
 			QueryNum = 0;
 		    if ((cp = (char *)HTList_objectAt(search_queries,
-	    					      QueryNum)) != NULL) {
+						      QueryNum)) != NULL) {
 			strcpy(prev_target, cp);
 			if (*prev_target_buffer &&
 			    !strcmp(prev_target_buffer, prev_target)) {
@@ -2570,7 +2588,7 @@ check_recall:
 		     */
 		    QueryNum = (QueryTotal - 1);
 		    if ((cp = (char *)HTList_objectAt(search_queries,
-	    					      QueryNum)) != NULL) {
+						      QueryNum)) != NULL) {
 			strcpy(prev_target, cp);
 			if (*prev_target_buffer &&
 			    !strcmp(prev_target_buffer, prev_target)) {
@@ -2592,10 +2610,10 @@ check_recall:
 			    option_statusline(CANCELLED);
 			    sleep(InfoSecs);
 			    goto restore_popup_statusline;
-	    		}
+			}
 			goto check_recall;
 		    }
- 		}
+		}
 		/*
 		 *  Replace the search string buffer with the new target. - FM
 		 */
@@ -2628,7 +2646,7 @@ check_recall:
 		     *  Scroll the window down if necessary.
 		     */
 		    if ((cur_choice - window_offset) >= length) {
-		        window_offset += j;
+			window_offset += j;
 			if (window_offset > (num_choices - length + 1))
 			    window_offset = (num_choices - length + 1);
 			ReDraw = TRUE;
@@ -2672,7 +2690,7 @@ check_recall:
 		     *  Scroll the window up if necessary.
 		     */
 		    if ((cur_choice - window_offset) < 0) {
-		        window_offset -= j;
+			window_offset -= j;
 			if (window_offset < 0)
 			    window_offset = 0;
 			ReDraw = TRUE;
@@ -2693,7 +2711,7 @@ restore_popup_statusline:
 		 */
 		if (disabled)
 		    option_statusline(CHOICE_LIST_UNM_MSG);
-   		else
+		else
 		    option_statusline(CHOICE_LIST_MESSAGE);
 		*prev_target = '\0';
 		QueryTotal = (search_queries ? HTList_count(search_queries)
@@ -2715,15 +2733,18 @@ restore_popup_statusline:
 		sleep(MessageSecs);
 		cmd = LYK_ACTIVATE; /* to exit */
 		break;
-        }
+	}
     }
 #ifndef USE_SLANG
     delwin(form_window);
+#ifdef NCURSES
+    LYsubwindow(0);
+#endif
 #endif /* !USE_SLANG */
 
     if (disabled || term_options) {
 	option_statusline("");
-        return(orig_choice);
+	return(orig_choice);
     } else {
 	option_statusline(VALUE_ACCEPTED);
 	return(cur_choice);
diff --git a/src/LYOptions.h b/src/LYOptions.h
index 5b98fcb3..f25722e0 100644
--- a/src/LYOptions.h
+++ b/src/LYOptions.h
@@ -1,4 +1,3 @@
-
 #ifndef LYOPTIONS_H
 #define LYOPTIONS_H
 
@@ -25,10 +24,14 @@ extern void edit_bookmarks NOPARAMS;
 #define L_FTPSTYPE	 5
 #define L_MAIL_ADDRESS	 6
 #define L_SSEARCH	 7
-#define L_CHARSET	 8
-#define L_RAWMODE	 9
-#define L_LANGUAGE	10
-#define L_PREF_CHARSET	11
+#define L_LANGUAGE	 8
+#define L_PREF_CHARSET	 9
+#define L_CHARSET	10
+#define L_RAWMODE	11
+
+#define L_COLOR         L_RAWMODE
+#define B_COLOR         44
+#define C_COLOR         62
 
 #define L_BOOL_A	12
 #define B_VIKEYS	5
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 153e7490..547dfa82 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -10,6 +10,7 @@
 #include "LYSignal.h"
 #include "LYClean.h"
 #include "LYMail.h"
+#include "LYNews.h"
 #include "LYOptions.h"
 
 #include <ctype.h>
@@ -967,12 +968,6 @@ PUBLIC int LYgetstr ARGS4(
 	int,		bufsize,
 	int,		recall)
 {
-    extern BOOLEAN term_letter;     /* Flag from terminate_letter() AST  */
-    extern BOOLEAN term_options;    /* Flag from terminate_options() AST */
-    extern BOOLEAN term_message;    /* Flag from terminate_message() AST */
-#ifdef VMS
-    extern BOOLEAN HadVMSInterrupt; /* Flag from cleanup_sig() AST       */
-#endif
     int x, y, MaxStringSize;
     int ch;
     EditFieldData MyEdit;
diff --git a/src/LYStrings.h b/src/LYStrings.h
index 317406e8..e789d0aa 100644
--- a/src/LYStrings.h
+++ b/src/LYStrings.h
@@ -1,4 +1,3 @@
-
 #ifndef LYSTRINGS_H
 #define LYSTRINGS_H
 
@@ -15,8 +14,7 @@ extern int LYgetstr PARAMS((char *inputline, int hidden,
 extern char * LYstrstr PARAMS((char *chptr, char *tarptr));
 extern char * LYno_attr_char_strstr PARAMS((char *chptr, char *tarptr));
 extern char * LYno_attr_char_case_strstr PARAMS((char *chptr, char *tarptr));
-extern char * LYmbcsstrncpy PARAMS((char *dst, char *src, int n_bytes,
-				    int n_glyphs,	int enc));
+
 #ifdef EXP_CHARTRANS
 extern char * LYno_attr_mbcs_strstr PARAMS((
 	char *		chptr,
@@ -30,6 +28,18 @@ extern char * LYno_attr_mbcs_case_strstr PARAMS((
 	BOOL		utf_flag,
 	int *		nstartp,
 	int *		nendp));
+extern int LYmbcsstrlen PARAMS((
+	char *		str,
+	BOOL		utf_flag));
+extern char * LYmbcsstrncpy PARAMS((
+	char *		dst,
+	char *		src,
+	int		n_bytes,
+	int		n_glyphs,
+	int		enc));
+#else
+#define LYmbcsstrlen(str,utf_flag) strlen(str)
+#define LYmbcsstrncpy(dest,src,n,n_glyphs,enc) LYstrncpy(dest, src, n)
 #endif
 
 extern char * SNACopy PARAMS((char **dest, CONST char *src, int n));
diff --git a/src/LYUtils.c b/src/LYUtils.c
index 5d22ca60..5aef9fde 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -181,8 +181,6 @@ PUBLIC void highlight ARGS3(
 	    	      (links[cur].hightext ?
 		       links[cur].hightext : ""),
 		      LYcols-links[cur].lx-1);
-#define LYmbcsstrncpy(dest,src,n,n_glyphs,enc) LYstrncpy(dest, src, n)
-#define LYmbcsstrlen(str,utf_flag) strlen(str)
 #endif /* EXP_CHARTRANS */
 	    addstr(buffer);  
 	}
@@ -2310,15 +2308,6 @@ PUBLIC int is_url ARGS1(
         return(0);
 
     /*
-     *  Can't be a URL if it starts with a slash.
-     *  So return immediately for this common case,
-     *  also to avoid false positives if there is a
-     *  colon later in the string. - kw
-     */
-    if (*cp == '/')
-        return(0);
-
-    /*
      *  Can't be a URL if it lacks a colon.
      */
     if (NULL == strchr(cp, ':'))
@@ -2330,6 +2319,15 @@ PUBLIC int is_url ARGS1(
     while (isspace((unsigned char)*cp))
         cp++;
 
+    /*
+     *  Can't be a URL if it starts with a slash.
+     *  So return immediately for this common case,
+     *  also to avoid false positives if there was
+     *  a colon later in the string. - KW
+     */
+    if (*cp == '/')
+        return(0);
+
 #ifdef DOSPATH /* sorry! */
 	 if (strncmp(cp, "file:///", 8) && strlen(cp) == 19 &&
 		  cp[strlen(cp)-1] == ':')
diff --git a/src/LYexit.c b/src/LYexit.c
index 7b3035d5..027b1549 100644
--- a/src/LYexit.c
+++ b/src/LYexit.c
@@ -112,6 +112,7 @@ PUBLIC void LYexit ARGS1(
 	printf("\r\n%s\r\n\r\n", MEMORY_EXHAUSTED_ABORT);
 	fflush(stdout);
     }
+    *stderr = LYOrigStderr;
 #endif /* !VMS */
     exit(status);
 }