Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > c6d8198fd3a861c932152544cde921fd > files > 15

vile-9.5r-1mdv2008.0.src.rpm

# vile 9.5l - patch 2006/11/07 - Thomas Dickey <dickey@invisible-island.net>
# ------------------------------------------------------------------------------
# CHANGES            |   55 +
# MANIFEST           |    2 
# aclocal.m4         |   77 ++
# api.c              |    4 
# basic.c            |   89 +-
# bind.c             |   69 +-
# buffer.c           |  132 ++++
# buglist            |   16 
# chgdfunc.h         |    4 
# cmdtbl             |  277 ++++----
# configure          | 1612 ++++++++++++++++++++++++++++-----------------------
# configure.in       |   10 
# csrch.c            |   10 
# display.c          |   10 
# doc/macros.doc     |   16 
# edef.h             |  192 +++---
# estruct.h          |    3 
# eval.c             |   18 
# exec.c             |  614 ++++++++++++-------
# file.c             |    8 
# filters/filters.h  |    5 
# filters/lua-filt.l |    6 
# filters/tc-filt.l  |   26 
# filters/ti-filt.l  |   18 
# filters/txt-filt.l |   59 +
# globals.c          |    4 
# history.c          |    7 
# insert.c           |   80 +-
# line.c             |   11 
# macros/modes.rc    |    9 
# macros/which.rc    |    5 
# main.c             |  285 ++++-----
# makefile.in        |    9 
# map.c              |    9 
# menu.c             |   17 
# mktbls.c           |   10 
# modes.c            |   38 -
# modetbl            |   14 
# ntwinio.c          |    8 
# opers.c            |   32 -
# patchlev.h         |    2 
# proto.h            |   25 
# random.c           |   46 +
# revlist            |  110 +--
# search.c           |   40 -
# select.c           |    6 
# tags.c             |   18 
# undo.c             |   13 
# version.c          |  124 ++-
# vile-9.5.spec      |    9 
# vile.1             |  138 +++-
# vile.hlp           |   55 +
# window.c           |   11 
# word.c             |   16 
# wordmov.c          |    4 
# 55 files changed, 2719 insertions(+), 1768 deletions(-)
# ------------------------------------------------------------------------------
Index: CHANGES
--- vile-9.5k+/CHANGES	2006-09-25 00:11:30.000000000 +0000
+++ vile-9.5l/CHANGES	2006-11-08 00:22:05.000000000 +0000
@@ -1,6 +1,51 @@
 Changes for vile 9.6 (released ??? ??? ?? ????)
 
- 200608?? (k)
+ 20061107 (l)
+	> Tom Dickey:
+	+ modify ":describe-bindings" to show whether the command accepts a
+	  range, and whether it is undoable.
+	+ add ":goto-percent" function.
+	+ add (nvi/vim) ex-commands: a!, c!, i!
+	+ add ":c" as alias for ":change-til" (nvi/vim).
+	+ change unimplemented ":c" to ":co" (reference O'Reilly vi-book)
+	+ fix makefile dependency for tags
+	+ review/update use of "CNT" in describe-bindings
+	+ revised command-line option parsing to use scripting more effectively:
+	  + multiple startup files are allowed.
+	  + most command-line options are translated to their equivalent script
+	    and executed, rather than saving state for the most recent of each
+	    option.  This makes the -s, -S, -g, -G options obsolete (but still
+	    accepted).
+	  + add "-c" option (the POSIX form of "+").
+	+ modify configure script to use ncurses5-config, etc., if found when
+	  handling the --with-screen=ncurses or --with-screen=ncursesw options.
+	  It also is checked when handling the --with-ncurses option for the
+	  termcap/terminfo driver.
+	+ add suffix/name rules for "Jam" files.
+	+ fix preamble pattern for pymode so it does not match a ":" line
+	  which should be shmode.
+	+ implement patterns as line-specifiers in ex-mode.
+	  (this does not work with history-scrolling yet).
+	+ remove incorrect check for empty parameter from which-menu from 9.4m
+	  changes.
+	+ check xvile menu to ensure that "C" header is given, adding a
+	  dummy one if not (report by Chris Green).
+	+ add checks to ensure that neither modelines nor majormodes can alter
+	  these modes: all, crypt, readonly, viewonly.
+	+ implement vi-style modeline, limited to setting buffer- and window-
+	  modes, or majormodes.
+	+ add "#" as an alias for number-lines-til
+	+ improve highlighting of comment-lines (denoted by "--") in txtmode.
+	+ fixes for termcap syntax highlighter (tcmode):
+	  + allow description field to be empty
+	  + color the "|" between aliases.
+	  + improve string- and escape-parsing
+	+ fixes for terminfo syntax highlighter (timode):
+	  + allow description field to be empty
+	  + color the "|" between aliases.
+	  + allow aliases to contain blanks.
+
+ 20060924 (k)
 	> Paul van Tilburg
 	+ add syntax filter (mcrl) for mCRL/mCRL2 modeling language.
 	> Tom Dickey:
@@ -8,10 +53,10 @@
 	  reading (or re-reading) a shell/pipe command, e.g., using ":e!".
 	+ fix configure --disable-largefile option (from ncurses).
 	+ minor fixes for nroff filter to improve rendition of groff's macros. 
-	+ add configure check for ncurses 5.2(sic) on FreeBSD, which was broken by
-	  an incomplete set of changes to wchar.h (report by Chris Green).
-	+ add configure check for aspell, whose attempt at a compatibility script
-	  for ispell does not recognize ispell's options.
+	+ add configure check for ncurses 5.2(sic) on FreeBSD, which was broken
+	  by an incomplete set of changes to wchar.h (report by Chris Green).
+	+ add configure check for aspell, whose attempt at a compatibility
+	  script for ispell does not recognize ispell's options.
 	+ workaround for breakage in FreeBSD's header files: updates to wchar.h
 	  were not reflected in updates to curses.h (report by Chris Green).
 	+ remove reference to obsolete http://www.vile.cx from README (report
Index: MANIFEST
--- vile-9.5k+/MANIFEST	2006-09-25 00:14:02.000000000 +0000
+++ vile-9.5l/MANIFEST	2006-11-08 01:46:34.000000000 +0000
@@ -1,4 +1,4 @@
-MANIFEST for vile, version v9_5k
+MANIFEST for vile, version v9_5l
 --------------------------------------------------------------------------------
 MANIFEST                        this file
 CHANGES                         Change-log for VILE
Index: aclocal.m4
Prereq:  1.163 
--- vile-9.5k+/aclocal.m4	2006-09-24 23:30:12.000000000 +0000
+++ vile-9.5l/aclocal.m4	2006-10-28 19:16:46.000000000 +0000
@@ -1,6 +1,6 @@
 dnl vile's local definitions for autoconf.
 dnl
-dnl $Header: /usr/build/vile/vile/RCS/aclocal.m4,v 1.163 2006/09/24 23:30:12 tom Exp $
+dnl $Header: /usr/build/vile/vile/RCS/aclocal.m4,v 1.165 2006/10/28 19:16:46 tom Exp $
 dnl
 dnl ---------------------------------------------------------------------------
 dnl ---------------------------------------------------------------------------
@@ -505,6 +505,17 @@
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_CURSES_CONFIG version: 1 updated: 2006/10/28 13:50:41
+dnl ----------------
+dnl Tie together the configure-script macros for curses.
+dnl It might be ncurses - check for that as well.
+AC_DEFUN([CF_CURSES_CONFIG],
+[
+CF_CURSES_CPPFLAGS
+CF_NCURSES_VERSION
+CF_CURSES_LIBS
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_CURSES_CPPFLAGS version: 9 updated: 2006/02/04 19:44:43
 dnl ------------------
 dnl Look for the curses headers.
@@ -1320,7 +1331,7 @@
 test $cf_cv_select_with_time = yes && AC_DEFINE(SELECT_WITH_TIME)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_IMAKE_CFLAGS version: 27 updated: 2005/04/05 18:26:15
+dnl CF_IMAKE_CFLAGS version: 28 updated: 2006/10/28 14:00:40
 dnl ---------------
 dnl Use imake to obtain compiler flags.  We could, in principle, write tests to
 dnl get these, but if imake is properly configured there is no point in doing
@@ -1375,8 +1386,8 @@
 
 	cat >> ./Imakefile <<'CF_EOF'
 findstddefs:
-	@echo IMAKE $(ALLDEFINES)ifelse($1,,,[ $1])       | sed -f fix_cflags.sed
-	@echo IMAKE $(EXTRA_LOAD_FLAGS)ifelse($2,,,[ $2]) | sed -f fix_lflags.sed
+	@echo IMAKE ${ALLDEFINES}ifelse($1,,,[ $1])       | sed -f fix_cflags.sed
+	@echo IMAKE ${EXTRA_LOAD_FLAGS}ifelse($2,,,[ $2]) | sed -f fix_lflags.sed
 CF_EOF
 
 	if ( $IMAKE $cf_imake_opts 1>/dev/null 2>&AC_FD_CC && test -f Makefile)
@@ -1417,7 +1428,7 @@
 	cd ..
 	rm -rf conftestdir
 
-	# We use $(ALLDEFINES) rather than $(STD_DEFINES) because the former
+	# We use ${ALLDEFINES} rather than ${STD_DEFINES} because the former
 	# declares XTFUNCPROTO there.  However, some vendors (e.g., SGI) have
 	# modified it to support site.cf, adding a kludge for the /usr/include
 	# directory.  Try to filter that out, otherwise gcc won't find its
@@ -1698,24 +1709,24 @@
 test $cf_cv_locale = yes && { ifelse($1,,AC_DEFINE(LOCALE),[$1]) }
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_MAKEFLAGS version: 10 updated: 2006/08/05 09:56:13
+dnl CF_MAKEFLAGS version: 12 updated: 2006/10/21 08:27:03
 dnl ------------
-dnl Some 'make' programs support $(MAKEFLAGS), some $(MFLAGS), to pass 'make'
+dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make'
 dnl options to lower-levels.  It's very useful for "make -n" -- if we have it.
 dnl (GNU 'make' does both, something POSIX 'make', which happens to make the
-dnl $(MAKEFLAGS) variable incompatible because it adds the assignments :-)
+dnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-)
 AC_DEFUN([CF_MAKEFLAGS],
 [
 AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[
 	cf_cv_makeflags=''
-	for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)'
+	for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
 	do
 		cat >cf_makeflags.tmp <<CF_EOF
 SHELL = /bin/sh
 all :
 	@ echo '.$cf_option'
 CF_EOF
-		cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null`
+		cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[[ 	]]*$,,'`
 		case "$cf_result" in
 		.*k)
 			cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
@@ -1870,6 +1881,45 @@
 	,[$1=no])
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_NCURSES_CONFIG version: 4 updated: 2006/10/28 14:36:12
+dnl -----------------
+dnl Tie together the configure-script macros for ncurses.
+dnl Prefer the "-config" script from ncurses 5.6, to simplify analysis.
+dnl Allow that to be overridden using the $NCURSES_CONFIG environment variable.
+dnl
+dnl $1 is the root library name (default: "ncurses")
+AC_DEFUN([CF_NCURSES_CONFIG],
+[
+cf_ncuconfig_root=ifelse($1,,ncurses,$1)
+
+echo "Looking for ${cf_ncuconfig_root}-config"
+AC_PATH_PROGS(NCURSES_CONFIG,${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config,none)
+
+if test "$NCURSES_CONFIG" != none ; then
+
+cf_cv_ncurses_header=curses.h
+
+CPPFLAGS="`$NCURSES_CONFIG --cflags` $CPPFLAGS"
+LIBS="`$NCURSES_CONFIG --libs` $LIBS"
+
+dnl like CF_NCURSES_CPPFLAGS
+AC_DEFINE(NCURSES)
+
+dnl like CF_NCURSES_LIBS
+CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root)
+AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
+
+dnl like CF_NCURSES_VERSION
+cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+
+else
+
+CF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1))
+CF_NCURSES_LIBS(ifelse($1,,ncurses,$1))
+
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_NCURSES_CPPFLAGS version: 18 updated: 2005/12/31 13:26:39
 dnl -------------------
 dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting
@@ -2657,9 +2707,11 @@
     CF_CHECK_ERRNO(sys_errlist)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_TERMCAP_LIBS version: 10 updated: 2001/10/18 20:42:39
+dnl CF_TERMCAP_LIBS version: 11 updated: 2006/10/28 15:15:38
 dnl ---------------
 dnl Look for termcap libraries, or the equivalent in terminfo.
+dnl
+dnl The optional parameter may be "ncurses", "ncursesw".
 AC_DEFUN([CF_TERMCAP_LIBS],
 [
 AC_CACHE_VAL(cf_cv_termlib,[
@@ -2673,8 +2725,7 @@
 ifelse([$1],,,[
 case "$1" in # (vi
 ncurses*)
-	CF_NCURSES_CPPFLAGS($1)
-	CF_NCURSES_LIBS($1)
+	CF_NCURSES_CONFIG($1)
 	cf_cv_termlib=terminfo
 	;;
 esac
Index: api.c
--- vile-9.5k+/api.c	2005-07-13 22:46:32.000000000 +0000
+++ vile-9.5l/api.c	2006-10-31 21:41:18.000000000 +0000
@@ -311,7 +311,7 @@
     }
 
 #else
-    return gotoline(TRUE, lno);
+    return vl_gotoline(lno);
 #endif
 }
 
@@ -325,7 +325,7 @@
 	linsert_chars(line, len);
 	lnewline();
     } else {			/* append to the end */
-	gotoline(FALSE, 0);
+	gotoeob(FALSE, 0);
 	gotoeol(FALSE, 0);
 	lnewline();
 	linsert_chars(line, len);
Index: basic.c
Prereq:  1.124 
--- vile-9.5k+/basic.c	2005-12-27 02:07:06.000000000 +0000
+++ vile-9.5l/basic.c	2006-11-02 01:31:36.000000000 +0000
@@ -5,7 +5,7 @@
  * functions that adjust the top line in the window and invalidate the
  * framing, are hard.
  *
- * $Header: /usr/build/vile/vile/RCS/basic.c,v 1.124 2005/12/27 02:07:06 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/basic.c,v 1.126 2006/11/02 01:31:36 tom Exp $
  *
  */
 
@@ -84,8 +84,8 @@
 {
     LINE *lp;
 
-    if (f == FALSE)
-	n = 1;
+    n = need_a_count(f, n, 1);
+
     if (n < 0)
 	return (forwchar(f, -n));
     while (n--) {
@@ -109,9 +109,8 @@
 int
 backchar_to_bol(int f, int n)
 {
+    n = need_a_count(f, n, 1);
 
-    if (f == FALSE)
-	n = 1;
     if (n < 0)
 	return forwchar_to_eol(f, -n);
     while (n--) {
@@ -153,8 +152,8 @@
 int
 forwchar(int f, int n)
 {
-    if (f == FALSE)
-	n = 1;
+    n = need_a_count(f, n, 1);
+
     if (n < 0)
 	return (backchar(f, -n));
     while (n--) {
@@ -192,8 +191,8 @@
     int nwas = n;
     int lim;
 
-    if (f == FALSE)
-	n = 1;
+    n = need_a_count(f, n, 1);
+
     if (n < 0) {
 	rc = backchar_to_bol(f, -n);
     } else if (n != 0) {
@@ -218,22 +217,16 @@
 }
 
 /*
- * Implements the vi "G" command.
- *
  * Move to a particular line (the argument).  Count from bottom of file if
  * argument is negative.
  */
 int
-gotoline(int f, int n)
+vl_gotoline(int n)
 {
-    int status;			/* status return */
+    int status = TRUE;		/* status return */
 
     MARK odot;
 
-    if (f == FALSE) {
-	return (gotoeob(f, n));
-    }
-
     if (n == 0)			/* if a bogus argument...then leave */
 	return (FALSE);
 
@@ -242,10 +235,10 @@
     DOT.o = w_left_margin(curwp);
     if (n < 0) {
 	DOT.l = lback(buf_head(curbp));
-	status = backline(f, -n - 1);
+	status = backline(TRUE, -n - 1);
     } else {
 	DOT.l = lforw(buf_head(curbp));
-	status = forwline(f, n - 1);
+	status = forwline(TRUE, n - 1);
     }
     if (status != TRUE) {
 	DOT = odot;
@@ -257,6 +250,27 @@
 }
 
 /*
+ * Implements the vi "G" command.
+ *
+ * Move to a particular line (the argument).  Count from bottom of file if
+ * argument is negative.
+ */
+int
+gotoline(int f, int n)
+{
+    int status;			/* status return */
+
+    if (f == FALSE) {
+	status = gotoeob(f, n);
+    } else {
+	status = vl_gotoline(n);
+	if (status != TRUE)
+	    mlwarn("[Not that many lines in buffer: %d]", absol(n));
+    }
+    return status;
+}
+
+/*
  * Goto the beginning of the buffer. Massive adjustment of dot. This is
  * considered to be hard motion; it really isn't if the original value of dot
  * is the same as the new value of dot.
@@ -294,8 +308,7 @@
     LINE *last = DOT.l;
     int nn = curwp->w_ntrows;
 
-    if (!f || n <= 0)
-	n = 1;
+    n = need_at_least(f, n, 1);
 
     DOT.l = curwp->w_line.l;
     while (--n != 0) {
@@ -355,8 +368,7 @@
     LINE *last = DOT.l;
     int nn;
 
-    if (f == FALSE || n <= 0)
-	n = 1;
+    n = need_at_least(f, n, 1);
 
     /* first get to the end */
     DOT.l = curwp->w_line.l;
@@ -397,8 +409,8 @@
 {
     LINE *dlp;
 
-    if (f == FALSE)
-	n = 1;
+    n = need_a_count(f, n, 1);
+
     if (n < 0)
 	return (backline(f, -n));
     if (n == 0)
@@ -503,8 +515,8 @@
 {
     int s;
 
-    if (f == FALSE)
-	n = 1;
+    n = need_a_count(f, n, 1);
+
     if ((s = forwline(f, n)) != TRUE)
 	return (s);
     return firstnonwhite(FALSE, 1);
@@ -520,8 +532,8 @@
 {
     int s;
 
-    if (f == FALSE)
-	n = 1;
+    n = need_a_count(f, n, 1);
+
     if ((s = backline(f, n)) != TRUE)
 	return (s);
     return firstnonwhite(FALSE, 1);
@@ -537,8 +549,8 @@
 {
     LINE *dlp;
 
-    if (f == FALSE)
-	n = 1;
+    n = need_a_count(f, n, 1);
+
     if (n < 0)
 	return (forwline(f, -n));
 
@@ -572,8 +584,7 @@
     int was_on_empty;
     int fc;
 
-    if (!f)
-	n = 1;
+    n = need_a_count(f, n, 1);
 
     was_on_empty = is_empty_line(DOT);
     odot = DOT;
@@ -625,8 +636,7 @@
     int was_on_empty;
     int fc;
 
-    if (!f)
-	n = 1;
+    n = need_a_count(f, n, 1);
 
     fc = firstchar(DOT.l);
     was_on_empty = is_empty_line(DOT);
@@ -1000,8 +1010,8 @@
     int code = TRUE;
     int col, next;
 
-    if (f == FALSE)
-	n = 1;
+    n = need_a_count(f, n, 1);
+
     if (n < 0) {
 	code = back_row(f, -n);
     } else if (n > 0) {
@@ -1038,8 +1048,8 @@
     int code = TRUE;
     int col, next;
 
-    if (f == FALSE)
-	n = 1;
+    n = need_a_count(f, n, 1);
+
     if (n < 0) {
 	code = forw_row(f, -n);
     } else if (n > 0) {
@@ -1427,6 +1437,7 @@
 godotplus(int f, int n)
 {
     int s;
+
     if (!f || n == 1) {
 	return firstnonwhite(FALSE, 1);
     }
Index: bind.c
Prereq:  1.296 
--- vile-9.5k+/bind.c	2006-05-21 22:34:06.000000000 +0000
+++ vile-9.5l/bind.c	2006-11-08 00:32:20.000000000 +0000
@@ -3,7 +3,7 @@
  *
  *	written 11-feb-86 by Daniel Lawrence
  *
- * $Header: /usr/build/vile/vile/RCS/bind.c,v 1.296 2006/05/21 22:34:06 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/bind.c,v 1.300 2006/11/08 00:32:20 tom Exp $
  *
  */
 
@@ -227,7 +227,7 @@
 	returnCode(FALSE);
 
     if (help_at >= 0) {
-	if (!gotoline(TRUE, help_at))
+	if (!vl_gotoline(help_at))
 	    returnCode(FALSE);
 	mlwrite("[Type '1G' to return to start of help information]");
 	help_at = -1;		/* until zotbuf is called, we let normal
@@ -1058,6 +1058,7 @@
 {
     char outseq[NLINE];		/* output buffer for text */
     const char *text = cmd->c_help;
+    CMDFLAGS flags = cmd->c_flags;
 
     if (text && *text) {
 	if (*text == SQUOTE)
@@ -1071,8 +1072,34 @@
     }
     if (!addline(curbp, outseq, -1))
 	return FALSE;
-    if (cmd->c_flags & GLOBOK) {
-	if (!addline(curbp, "  (may follow global command)", -1))
+#if OPT_PROCEDURES
+    if ((cmd->c_flags & CMD_TYPE) == CMD_PROC)
+	flags &= !(UNDO | REDO);
+#endif
+#if OPT_PERL
+    if ((cmd->c_flags & CMD_TYPE) == CMD_PERL)
+	flags &= !(UNDO | REDO);
+#endif
+    if (flags & (RANGE | UNDO | REDO | GLOBOK)) {
+	char *gaps = "";
+	char *next = outseq;
+
+	next = lsprintf(outseq, "  ( ");
+	if (cmd->c_flags & (UNDO | REDO)) {
+	    {
+		next = lsprintf(next, "undoable");
+		gaps = ", ";
+	    }
+	}
+	if (cmd->c_flags & RANGE) {
+	    next = lsprintf(next, "%saccepts range", gaps);
+	    gaps = ", ";
+	}
+	if (cmd->c_flags & GLOBOK) {
+	    next = lsprintf(next, "%smay follow global command", gaps);
+	}
+	(void) lsprintf(next, " )");
+	if (!addline(curbp, outseq, -1))
 	    return FALSE;
     }
 #if OPT_MACRO_ARGS
@@ -2811,29 +2838,31 @@
 int
 eol_command(EOL_ARGS)
 {
-    /*
-     * Handle special case of repeated-character implying repeat-count
-     */
-    if (is_shift_cmd(buffer, cpos) && (c == *buffer))
-	return TRUE;
+    int result = FALSE;
 
-    /*
-     * Shell-commands aren't complete until the line is complete.
-     */
-    if ((cpos != 0) && isShellOrPipe(buffer))
-	return isreturn(c);
-
-    return (c == eolchar)
-	|| (
-	       cpos != 0 && cpos < 3
+    if (is_shift_cmd(buffer, cpos) && (c == *buffer)) {
+	/*
+	 * Handle special case of repeated-character implying repeat-count
+	 */
+	result = TRUE;
+    } else if ((cpos != 0) && isShellOrPipe(buffer)) {
+	/*
+	 * Shell-commands aren't complete until the line is complete.
+	 */
+	result = isreturn(c);
+    } else if (c == eolchar) {
+	result = TRUE;
+    } else if (cpos != 0 && cpos < 3
 	       && ((!ismostpunct(c)
 		    && ismostpunct(buffer[cpos - 1]))
 		   || ((c != '!' && ismostpunct(c))
 		       && (buffer[cpos - 1] == '!'
 			   || !ismostpunct(buffer[cpos - 1]))
 		   )
-	       )
-	);
+	       )) {
+	result = TRUE;
+    }
+    return result;
 }
 
 /*
Index: buffer.c
Prereq:  1.300 
--- vile-9.5k+/buffer.c	2006-05-23 00:58:39.000000000 +0000
+++ vile-9.5l/buffer.c	2006-11-02 21:01:24.000000000 +0000
@@ -5,7 +5,7 @@
  * keys. Like everyone else, they set hints
  * for the display system.
  *
- * $Header: /usr/build/vile/vile/RCS/buffer.c,v 1.300 2006/05/23 00:58:39 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/buffer.c,v 1.307 2006/11/02 21:01:24 tom Exp $
  *
  */
 
@@ -1048,6 +1048,127 @@
     returnCode(swbuffer_lfl(bp, TRUE, FALSE));
 }
 
+#if OPT_MODELINE
+#define VI_NAMES "\\(vi\\|vile\\|"PROGRAM_NAME"\\)"
+static struct {
+    int mark;
+    const char *expr;
+    regexp *prog;
+} mls_patterns[] = {
+
+    {
+	3, "^.*\\s" VI_NAMES ":\\s*se\\(t\\)\\?\\s\\+\\(.*\\):.*$", 0
+    },
+    {
+	2, "^.*\\s" VI_NAMES ":\\s*\\(.*\\)\\s*$", 0
+    },
+};
+
+static regexp *
+mls_regcomp(int n)
+{
+    regexp *prog = 0;
+    if (n >= 0 && n < (int) TABLESIZE(mls_patterns)) {
+	prog = mls_patterns[n].prog;
+	if (prog == 0) {
+	    prog = regcomp(mls_patterns[n].expr,
+			   strlen(mls_patterns[n].expr), TRUE);
+	    mls_patterns[n].prog = prog;
+	}
+    }
+    return prog;
+}
+
+static void
+mls_regfree(int n)
+{
+    if (n >= 0) {
+	if (n < (int) TABLESIZE(mls_patterns)) {
+	    if (mls_patterns[n].prog != 0) {
+		free(mls_patterns[n].prog);
+		mls_patterns[n].prog = 0;
+	    }
+	}
+    } else {
+	for (n = 0; n < (int) TABLESIZE(mls_patterns); ++n)
+	    mls_regfree(n);
+    }
+}
+
+static int
+found_modeline(LINE *lp, int *first, int *last)
+{
+    unsigned n;
+
+    for (n = 0; n < TABLESIZE(mls_patterns); ++n) {
+	regexp *prog = mls_regcomp(n);
+	if (lregexec(prog, lp, 0, llength(lp))) {
+	    int j = mls_patterns[n].mark;
+	    *first = prog->startp[j] - prog->startp[0];
+	    *last = prog->endp[j] - prog->startp[0];
+	    return 1;
+	}
+    }
+    return 0;
+}
+
+static void
+do_one_modeline(LINE *lp, int first, int last)
+{
+    TBUFF *data = 0;
+    if (lisreal(lp) && first >= 0 && last > first && last <= llength(lp)) {
+	tb_sappend(&data, "setl ");
+	tb_bappend(&data, lp->l_text + first, last - first);
+	tb_append(&data, EOS);
+
+	in_modeline = TRUE;
+	docmd(tb_values(data), TRUE, FALSE, 1);
+	in_modeline = FALSE;
+
+	tb_free(&data);
+    }
+}
+
+void
+do_modelines(BUFFER *bp)
+{
+    if (b_val(bp, MDMODELINE) &&
+	b_val(bp, VAL_MODELINES) > 0) {
+	LINE *lp;
+	int once = b_val(bp, VAL_MODELINES);
+	int limit = 2 * once;
+	int count;
+	int first, last;
+
+	bsizes(bp);
+
+	TRACE((T_CALLED "do_modelines(%s) limit %d, size %d\n",
+	       bp->b_bname, limit, bp->b_linecount));
+
+	count = 0;
+	for (lp = lforw(buf_head(bp)); count < once; lp = lforw(lp)) {
+	    --limit;
+	    ++count;
+	    if (found_modeline(lp, &first, &last)) {
+		do_one_modeline(lp, first, last);
+	    }
+	}
+
+	count = 0;
+	if (bp->b_linecount < limit) {
+	    once = bp->b_linecount - once;
+	}
+	for (lp = lback(buf_head(bp)); count < once; lp = lback(lp)) {
+	    ++count;
+	    if (found_modeline(lp, &first, &last)) {
+		do_one_modeline(lp, first, last);
+	    }
+	}
+	returnVoid();
+    }
+}
+#endif
+
 static int
 suckitin(BUFFER *bp, int copy, int lockfl)
 {
@@ -1502,8 +1623,8 @@
     MARK save_TOP;
 
     int animated = (f
-		    && valid_window(curwp)
 		    && (n > 1)
+		    && valid_window(curwp)
 		    && valid_buffer(curbp)
 		    && (curbp == find_BufferList()));
     int special = animated && (DOT.o == 2);
@@ -1519,8 +1640,8 @@
     }
 #endif
 
-    if (!f)
-	n = 1;
+    n = need_a_count(f, n, 1);
+
     for_ever {
 	bufn[0] = EOS;
 	if ((s = ask_for_bname("Kill buffer: ", bufn, sizeof(bufn))) != TRUE)
@@ -2803,5 +2924,8 @@
 	bclear(bheadp);
 	FreeBuffer(bheadp);
     }
+#if OPT_MODELINE
+    mls_regfree(-1);
+#endif
 }
 #endif
Index: buglist
Prereq:  1.403 
--- vile-9.5k+/buglist	2005-11-30 01:18:33.000000000 +0000
+++ vile-9.5l/buglist	2006-10-28 13:40:54.000000000 +0000
@@ -1,7 +1,9 @@
 ------------------------
+-- vile:txtmode
+------------------------
 vile bug/enhancement/wish list (mostly wishes ;-)
 ------------------------
-$Header: /usr/build/vile/vile/RCS/buglist,v 1.403 2005/11/30 01:18:33 tom Exp $
+$Header: /usr/build/vile/vile/RCS/buglist,v 1.405 2006/10/28 13:40:54 tom Exp $
 ----------------------
 	(E means enhancement, L,M,H are low, medium, high priority)
 
@@ -48,8 +50,6 @@
         sort of mark as well.  Implementation of the "tag stack"
 	would be aided by this as well.
 
-E	can't search for a NUL in a buffer.
-
 E	":e" and ":e!" should share the same prompt data, which should be
 	editable / history.  They both should default (like vi!) to the
 	current buffer.
@@ -58,9 +58,6 @@
 	doing this would allow modification to eliminate a fixed number of
 	macro-buffers.
 
-E	should ifdef the 'autobuffer' code for users who do not need vi-style
-	buffering.
-
 --------------
 
     The ed 'transfer' and 'move' commands don't work.
@@ -107,7 +104,6 @@
 reading the "differences between vi and xvi" document.  Some of these would
 be nice in vile.
 
-
      As well as the normal named (conjugate) buffers, and the  default
      one  named @, several extra buffers named :, /, ?  and ! contain
      the last command lines entered for each of the command types.  So
@@ -115,7 +111,6 @@
      can insert it into your buffer, edit it and  then re-execute  it
      (e.g. with dd@@).
 
-
      +    In insert and replace modes, ^A has the same meaning  as  ^@
           in  vi,  except  that it works at any time, not just for the
           first character.  Also, typing ^Bx, where x is the name of a
@@ -124,7 +119,6 @@
           contains the last thing inserted, so that ^B< is the same as
           ^A.
 
-
 ------------------------
 I wish ^X-!  could execute shell commands async'ly, i.e.  I should not have
 to wait/do nothing while waiting for the ouput of compiling.  I should be
@@ -720,10 +714,10 @@
 
 
 ----------------------
-Another point of irritation is the autoindent behaviour when inserting
+Another point of irritation is the autoindent behavior when inserting
 blank lines; where vi will continue with a reduced indent after typing a
 CTRL-D, vile insists on keeping the indent on par with the last non-empty
-line.  (^^D is inteneded to be temporary, 0^D should be permanent, even if
+line.  (^^D is intended to be temporary, 0^D should be permanent, even if
 what you've entered is a blank line.  don't know about simple ^D.)
 
 ----------------------
Index: chgdfunc.h
Prereq:  1.18 
--- vile-9.5k+/chgdfunc.h	2005-11-21 00:53:26.000000000 +0000
+++ vile-9.5l/chgdfunc.h	2006-10-16 21:37:35.000000000 +0000
@@ -2,7 +2,7 @@
  * Prototypes for functions in the mode-tables (must be declared before the
  * point at which proto.h is included).
  *
- * $Header: /usr/build/vile/vile/RCS/chgdfunc.h,v 1.18 2005/11/21 00:53:26 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/chgdfunc.h,v 1.19 2006/10/16 21:37:35 tom Exp $
  */
 extern int chgd_autobuf  (CHGD_ARGS);
 extern int chgd_buffer   (CHGD_ARGS);
@@ -11,12 +11,12 @@
 extern int chgd_fences   (CHGD_ARGS);
 extern int chgd_hilite   (CHGD_ARGS);
 extern int chgd_major    (CHGD_ARGS);
-extern int chgd_major_w  (CHGD_ARGS);
 extern int chgd_mouse    (CHGD_ARGS);
 extern int chgd_rs       (CHGD_ARGS);
 extern int chgd_status   (CHGD_ARGS);
 extern int chgd_undoable (CHGD_ARGS);
 extern int chgd_uniqbuf  (CHGD_ARGS);
+extern int chgd_win_mode (CHGD_ARGS);
 extern int chgd_window   (CHGD_ARGS);
 extern int chgd_working  (CHGD_ARGS);
 extern int chgd_xterm    (CHGD_ARGS);
Index: cmdtbl
Prereq:  1.238 
--- vile-9.5k+/cmdtbl	2005-07-17 17:58:39.000000000 +0000
+++ vile-9.5l/cmdtbl	2006-11-07 22:44:52.000000000 +0000
@@ -78,7 +78,7 @@
 #
 #	This file was designed and constructed by Paul Fox for vile, (c)1990
 #
-#	The flags given in parentheses are "ex" flags, related to what
+#	Some of the flags given are "ex" flags, related to what
 #		kind of line-range arguments the command can take.  Not all are
 #		currently used or implemented, but they were defined in the
 #		command table for the Steve Kirkendall's elvis editor, so I
@@ -97,11 +97,11 @@
 #		in '!' listed, then the flag does nothing, and should be
 #		viewed simply as documentation.
 #
-# $Header: /usr/build/vile/vile/RCS/cmdtbl,v 1.238 2005/07/17 17:58:39 tom Exp $
+# $Header: /usr/build/vile/vile/RCS/cmdtbl,v 1.244 2006/11/07 22:44:52 tom Exp $
 #
 #
 
-abbrev		NONE|(EXRCOK|EXTRA)
+abbrev		EXRCOK|EXTRA
 	"abbreviate"
 	"show-abbreviations"
 	<establish shorthand for another string, or show all abbreviations>
@@ -114,13 +114,13 @@
 	"append-chars"			!FEWNAMES
 	'a'
 	<insert (CNT copies of) text after the cursor>
-append_i	REDO|UNDO		0
+append_i	REDO|UNDO
 	"append-indented-chars"		!FEWNAMES
 	"a!"
 	<insert (CNT copies of) text after the cursor, toggles autoindent>
 appstring	REDO|UNDO		!SMALLER
 	"append-string"
-	<append the given string after the cursor>
+	<append (CNT copies of) the given string after the cursor>
 appendeol	REDO|UNDO
 	"append-chars-at-eol"		!FEWNAMES
 	'A'
@@ -142,7 +142,7 @@
 	<delete CNT characters to the left>
 backhunt	ABSM|MOTION		!SMALLER
 	"hunt-backward"
-	<search backward for previously entered pattern>
+	<search backward for CNT'th occurrence of previously entered pattern>
 backhpage	MOTION
 	"previous-half-page"		!FEWNAMES
 	"back-half-page"		!FEWNAMES
@@ -192,11 +192,11 @@
 bcsrch		MOTION|MINIBUF
 	"backward-char-scan"		!FEWNAMES
 	'F'
-	<scan left on the line for the given character>
+	<scan left on the line for CNT'th occurrence of the given character>
 bcsrch_to	MOTION|MINIBUF
 	"backward-char-scan-to"		!FEWNAMES
 	'T'
-	<scan left on the line up to but not including the given character>
+	<scan left on the line up to but not including CNT'th occurrence of the given character>
 bindkey		NONE			OPT_REBIND
 	"bind-key"
 	"rebind-key"
@@ -213,7 +213,7 @@
 	"bind-selmode-key"
 	"rebind-selmode-key"
 	<bind a keystroke to a function effective in select mode>
-bktoshell	NONE|(BANG)		OPT_SHELL
+bktoshell	BANG			OPT_SHELL
 	"suspend"
 	"suspend!"
 	"stop"
@@ -237,12 +237,12 @@
 	"change-line"			!FEWNAMES
 	"delete-line-and-insert-chars"	!FEWNAMES
 	'S'
-	<insert text to replace the current line>
+	<insert text to replace the CNT lines, starting with current line>
 chgtoeol	REDO|UNDO
 	"change-to-eol"			!FEWNAMES
 	"delete-to-eol-and-insert-chars" !FEWNAMES
 	'C'
-	<insert text to replace the rest of the line>
+	<insert text to replace the rest of the line (plus CNT-1 following)>
 clear_match_attrs	NONE		OPT_HILITEMATCH
 	"clear-visual-matches"
 	'='
@@ -259,10 +259,10 @@
 consearch	ABSM|MOTION
 	"continue-search"		!FEWNAMES
 	'n'
-	<search for previous pattern in same direction as before>
-opercopy	OPER|(RANGE|EXTRA)
+	<search for previous pattern in same direction as before, CNT'th occurrence>
+opercopy	OPER|RANGE|EXTRA
 	"copy-til"
-	"c"
+	"co"
 	<copy text in the region>
 kbd_mac_startstop	NONE
 	"end-keyboard-macro"		!FEWNAMES
@@ -273,7 +273,7 @@
 kbd_mac_exec	REDO|UNDO|VIEWOK
 	"execute-keyboard-macro"	!FEWNAMES
 	'^X-&'
-	<execute a previously recorded macro of keystrokes>
+	<execute a previously recorded macro of keystrokes CNT times>
 kbd_mac_save	NONE
 	"save-keyboard-macro"
 	'^X-^'
@@ -282,161 +282,161 @@
 	"execute-macro-1"		!FEWNAMES
 	'FN-1'				KEY_F1
 	'FN-P'				KEY_KP_F1
-	<execute [Macro 1]>
+	<execute [Macro 1] CNT times>
 cbuf2		REDO			OPT_EXEC_MACROS>1
 	"execute-macro-2"		!FEWNAMES
 	'FN-2'				KEY_F2
 	'FN-Q'				KEY_KP_F2
-	<execute [Macro 2]>
+	<execute [Macro 2] CNT times>
 cbuf3		REDO			OPT_EXEC_MACROS>2
 	"execute-macro-3"		!FEWNAMES
 	'FN-3'				KEY_F3
 	'FN-R'				KEY_KP_F3
-	<execute [Macro 3]>
+	<execute [Macro 3] CNT times>
 cbuf4		REDO			OPT_EXEC_MACROS>3
 	"execute-macro-4"		!FEWNAMES
 	'FN-4'				KEY_F4
 	'FN-S'				KEY_KP_F4
-	<execute [Macro 4]>
+	<execute [Macro 4] CNT times>
 cbuf5		REDO			OPT_EXEC_MACROS>4
 	"execute-macro-5"		!FEWNAMES
 	'FN-5'				KEY_F5
-	<execute [Macro 5]>
+	<execute [Macro 5] CNT times>
 cbuf6		REDO			OPT_EXEC_MACROS>5
 	"execute-macro-6"		!FEWNAMES
 	'FN-6'				KEY_F6
-	<execute [Macro 6]>
+	<execute [Macro 6] CNT times>
 cbuf7		REDO			OPT_EXEC_MACROS>6
 	"execute-macro-7"		!FEWNAMES
 	'FN-7'				KEY_F7
-	<execute [Macro 7]>
+	<execute [Macro 7] CNT times>
 cbuf8		REDO			OPT_EXEC_MACROS>7
 	"execute-macro-8"		!FEWNAMES
 	'FN-8'				KEY_F8
-	<execute [Macro 8]>
+	<execute [Macro 8] CNT times>
 cbuf9		REDO			OPT_EXEC_MACROS>8
 	"execute-macro-9"		!FEWNAMES
 	'FN-9'				KEY_F9
-	<execute [Macro 9]>
+	<execute [Macro 9] CNT times>
 cbuf10		REDO			OPT_EXEC_MACROS>9
 	'FN-0'				KEY_F10
 	"execute-macro-10"		!FEWNAMES
-	<execute [Macro 10]>
+	<execute [Macro 10] CNT times>
 cbuf11		REDO			OPT_EXEC_MACROS>10
 	"execute-macro-11"		!FEWNAMES
 	'FN-!'				KEY_F11
-	<execute [Macro 11]>
+	<execute [Macro 11] CNT times>
 cbuf12		REDO			OPT_EXEC_MACROS>11
 	'FN-@'				KEY_F12
 	"execute-macro-12"		!FEWNAMES
-	<execute [Macro 12]>
+	<execute [Macro 12] CNT times>
 cbuf13		REDO			OPT_EXEC_MACROS>12
 	'FN-#'				KEY_F13
 	"execute-macro-13"		!FEWNAMES
-	<execute [Macro 13]>
+	<execute [Macro 13] CNT times>
 cbuf14		REDO			OPT_EXEC_MACROS>13
 	'FN-$'				KEY_F14
 	"execute-macro-14"		!FEWNAMES
-	<execute [Macro 14]>
+	<execute [Macro 14] CNT times>
 cbuf15		REDO			OPT_EXEC_MACROS>14
 	'FN-%'				KEY_F15
 	"execute-macro-15"		!FEWNAMES
-	<execute [Macro 15]>
+	<execute [Macro 15] CNT times>
 cbuf16		REDO			OPT_EXEC_MACROS>15
 	'FN-^'				KEY_F16
 	"execute-macro-16"		!FEWNAMES
-	<execute [Macro 16]>
+	<execute [Macro 16] CNT times>
 cbuf17		REDO			OPT_EXEC_MACROS>16
 	'FN-&'				KEY_F17
 	"execute-macro-17"		!FEWNAMES
-	<execute [Macro 17]>
+	<execute [Macro 17] CNT times>
 cbuf18		REDO			OPT_EXEC_MACROS>17
 	'FN-*'				KEY_F18
 	"execute-macro-18"		!FEWNAMES
-	<execute [Macro 18]>
+	<execute [Macro 18] CNT times>
 cbuf19		REDO			OPT_EXEC_MACROS>18
 	'FN-('				KEY_F19
 	"execute-macro-19"		!FEWNAMES
-	<execute [Macro 19]>
+	<execute [Macro 19] CNT times>
 cbuf20		REDO			OPT_EXEC_MACROS>19
 	'FN-)'				KEY_F20
 	"execute-macro-20"		!FEWNAMES
-	<execute [Macro 20]>
+	<execute [Macro 20] CNT times>
 cbuf21		REDO			OPT_EXEC_MACROS>20
 	'FN-\241'			KEY_F21
 	"execute-macro-21"		!FEWNAMES
-	<execute [Macro 21]>
+	<execute [Macro 21] CNT times>
 cbuf22		REDO			OPT_EXEC_MACROS>21
 	'FN-\242'			KEY_F22
 	"execute-macro-22"		!FEWNAMES
-	<execute [Macro 22]>
+	<execute [Macro 22] CNT times>
 cbuf23		REDO			OPT_EXEC_MACROS>22
 	'FN-\243'			KEY_F23
 	"execute-macro-23"		!FEWNAMES
-	<execute [Macro 23]>
+	<execute [Macro 23] CNT times>
 cbuf24		REDO			OPT_EXEC_MACROS>23
 	'FN-\244'			KEY_F24
 	"execute-macro-24"		!FEWNAMES
-	<execute [Macro 24]>
+	<execute [Macro 24] CNT times>
 cbuf25		REDO			OPT_EXEC_MACROS>24
 	'FN-\245'			KEY_F25
 	"execute-macro-25"		!FEWNAMES
-	<execute [Macro 25]>
+	<execute [Macro 25] CNT times>
 cbuf26		REDO			OPT_EXEC_MACROS>25
 	'FN-\246'			KEY_F26
 	"execute-macro-26"		!FEWNAMES
-	<execute [Macro 26]>
+	<execute [Macro 26] CNT times>
 cbuf27		REDO			OPT_EXEC_MACROS>26
 	'FN-\247'			KEY_F27
 	"execute-macro-27"		!FEWNAMES
-	<execute [Macro 27]>
+	<execute [Macro 27] CNT times>
 cbuf28		REDO			OPT_EXEC_MACROS>27
 	'FN-\250'			KEY_F28
 	"execute-macro-28"		!FEWNAMES
-	<execute [Macro 28]>
+	<execute [Macro 28] CNT times>
 cbuf29		REDO			OPT_EXEC_MACROS>28
 	'FN-\251'			KEY_F29
 	"execute-macro-29"		!FEWNAMES
-	<execute [Macro 29]>
+	<execute [Macro 29] CNT times>
 cbuf30		REDO			OPT_EXEC_MACROS>29
 	'FN-\252'			KEY_F30
 	"execute-macro-30"		!FEWNAMES
-	<execute [Macro 30]>
+	<execute [Macro 30] CNT times>
 cbuf31		REDO			OPT_EXEC_MACROS>30
 	'FN-\253'			KEY_F31
 	"execute-macro-31"		!FEWNAMES
-	<execute [Macro 31]>
+	<execute [Macro 31] CNT times>
 cbuf32		REDO			OPT_EXEC_MACROS>31
 	'FN-\254'			KEY_F32
 	"execute-macro-32"		!FEWNAMES
-	<execute [Macro 32]>
+	<execute [Macro 32] CNT times>
 cbuf33		REDO			OPT_EXEC_MACROS>32
 	'FN-\255'			KEY_F33
 	"execute-macro-33"		!FEWNAMES
-	<execute [Macro 33]>
+	<execute [Macro 33] CNT times>
 cbuf34		REDO			OPT_EXEC_MACROS>33
 	'FN-\256'			KEY_F34
 	"execute-macro-34"		!FEWNAMES
-	<execute [Macro 34]>
+	<execute [Macro 34] CNT times>
 cbuf35		REDO			OPT_EXEC_MACROS>34
 	'FN-\257'			KEY_F35
 	"execute-macro-35"		!FEWNAMES
-	<execute [Macro 35]>
+	<execute [Macro 35] CNT times>
 cbuf36		REDO			OPT_EXEC_MACROS>35
 	"execute-macro-36"		!FEWNAMES
-	<execute [Macro 36]>
+	<execute [Macro 36] CNT times>
 cbuf37		REDO			OPT_EXEC_MACROS>36
 	"execute-macro-37"		!FEWNAMES
-	<execute [Macro 37]>
+	<execute [Macro 37] CNT times>
 cbuf38		REDO			OPT_EXEC_MACROS>37
 	"execute-macro-38"		!FEWNAMES
-	<execute [Macro 38]>
+	<execute [Macro 38] CNT times>
 cbuf39		REDO			OPT_EXEC_MACROS>38
 	"execute-macro-39"		!FEWNAMES
-	<execute [Macro 39]>
+	<execute [Macro 39] CNT times>
 cbuf40		REDO			OPT_EXEC_MACROS>39
 	"execute-macro-40"		!FEWNAMES
-	<execute [Macro 40]>
+	<execute [Macro 40] CNT times>
 define_mode	NONE			OPT_MAJORMODE
 	"define-majormode"
 	"define-mode"
@@ -464,7 +464,7 @@
 	"setno"
 	"unset"
 	<turn off the global value of a mode setting>
-dellocmode	NONE|(EXRCOK|EXTRA)
+dellocmode	EXRCOK|EXTRA
 	"delete-mode"			!FEWNAMES
 	"setlno"
 	"unsetl"
@@ -537,21 +537,21 @@
 dotcmdplay	UNDO
 	"repeat-last-cmd"		!FEWNAMES
 	'.'
-	<repeat the last text-changing command>
+	<repeat the last text-changing command, CNT times>
 evaluate	NONE			OPT_EVAL
 	"eval"
 	"execute-string"		!FEWNAMES
-	<evaluate expression, reinterpret as a command>
-ex	NONE|(BANG|FILE1)
+	<evaluate expression, reinterpret as a command (CNT as per command)>
+ex		BANG|FILE1
 	"ex"
 	<entry point to the \"exile\" editor.  unimplemented>
 execbuf		NONE			!SMALLER
 	"execute-buffer"		!FEWNAMES
-	<run the given buffer as a script>
+	<run the given buffer as a script, CNT times>
 execfile	NONE			!SMALLER
 	"execute-file"			!FEWNAMES
 	"source"
-	<run the given file as a script>
+	<run the given file as a script, CNT times>
 exechypercmd	NONE			OPT_HYPERTEXT
 	"execute-hypertext-command"	!FEWNAMES
 	<run the hypertext command attached to the region under the cursor>
@@ -565,7 +565,7 @@
 execproc	REDO			OPT_PROCEDURES
 	"execute-procedure"		!FEWNAMES
 	"run"
-	<run the given named stored-procedure as a script>
+	<run the given named stored-procedure as a script, CNT times>
 enlargewind	GOAL
 	"grow-window"			!FEWNAMES
 	'V'
@@ -580,12 +580,12 @@
 fcsrch		MOTION|MINIBUF
 	"forward-char-scan"		!FEWNAMES
 	'f'
-	<scan right on the line for the given character>
+	<scan right on the line for (CNT'th occurrence of) the given character>
 fcsrch_to	MOTION|MINIBUF
 	"forward-char-scan-up-to"	!FEWNAMES
 	't'
-	<scan right on the line up to but not including the given character>
-filefind	NONE|(BANG|FILE1|PLUS)
+	<scan right on the line up to but not including (CNT'th occurrence of) the given character>
+filefind	BANG|FILE1|PLUS
 	"e"
 	"E"
 	"edit-file"			!FEWNAMES
@@ -596,17 +596,17 @@
 	"e!"
 	"replace-with-file"		!FEWNAMES
 	<replace the contents of the current buffer with the given file>
-vl_filename	NONE|(NAMEDF)
+vl_filename	NAMEDF
 	"change-file-name"		!FEWNAMES
 	"f"
 	"file"
 	"filename"
 	<change the filename associated with the current buffer>
-filesave	NONE|BANG		!SMALLER
+filesave	BANG			!SMALLER
 	"save-file"
 	"save-file!"
 	<save the contents of the current buffer to its associated filename>
-filewrite	NONE|BANG
+filewrite	BANG
 	"write-file"			!FEWNAMES
 	"write-file!"			!FEWNAMES
 	<syntax: \"write-file [name]\" - write contents of current buffer to its filename or to optional \"name\">
@@ -633,11 +633,11 @@
 fisearch	NONE			OPT_ISRCH
 	"incremental-search"		!FEWNAMES
 	'^X-S'
-	<search forwards for a pattern entered character by character>
+	<search forward for a pattern entered character by character>
 flipchar	REDO|UNDO|MINIBUF
 	"flip-character"		!FEWNAMES
 	'~'
-	<exchange upper and lowercase for the current character>
+	<exchange upper and lowercase for CNT characters, begin with current>
 forwdelchar	REDO|UNDO|MINIBUF
 	"delete-next-character"		!FEWNAMES
 	'x'
@@ -712,12 +712,12 @@
 	<move right to the end of CNT \"small\" words>
 forwhunt	ABSM|MOTION		!SMALLER
 	"hunt-forward"			!FEWNAMES
-	<search forward for previously entered pattern>
+	<search forward for CNT'th occurrence of previously entered pattern>
 forwsearch	ABSM|MOTION
 	"search-forward"		!FEWNAMES
 	'/'
 	'FN-f'				KEY_Find
-	<search forwards for fresh pattern>
+	<search forward for CNT'th occurrence of fresh pattern>
 matchfence	ABSM|MOTION		OPT_CFENCE
 	"goto-matching-fence"		!FEWNAMES
 	'%'
@@ -737,20 +737,20 @@
 	<move CNT whole lines.  same as \"stuttering\" most operators>
 
 # this function is for internal use only, for ex commands
-gomark		MOTION|FL|(RANGE|ZERO)
+gomark		MOTION|FL|RANGE|ZERO
 
 gotobop		ABSM|MOTION
 	"previous-paragraph"		!FEWNAMES
 	"back-paragraph"		!FEWNAMES
 	"up-paragraph"			!FEWNAMES
 	'{'
-	<move to the start of a paragraph>
+	<move to the start of CNT'th paragraph>
 gotoeop		ABSM|MOTION
 	"forward-paragraph"		!FEWNAMES
 	"next-paragraph"		!FEWNAMES
 	"down-paragraph"		!FEWNAMES
 	'}'
-	<move to the end of a paragraph>
+	<move to the end of CNT'th paragraph>
 gotobob		ABSM|MOTION		!SMALLER
 	"beginning-of-file"		!FEWNAMES
 	"goto-beginning-of-file"	!FEWNAMES
@@ -772,7 +772,7 @@
 	"end-of-line"			!FEWNAMES
 	"eol"				!FEWNAMES
 	'$'
-	<move to the very end of the line>
+	<move to the very end of the CNT'th line>
 gotobos		ABSM|MOTION|FL
 	"goto-beginning-of-screen"	!FEWNAMES
 	"beginning-of-screen"		!FEWNAMES
@@ -793,35 +793,38 @@
 	"back-section"			!FEWNAMES
 	"up-section"			!FEWNAMES
 	'['
-	<move to the previous start of a \"section\">
+	<move to the CNT'th previous start of a \"section\">
 gotoeosec	ABSM|MOTION
 	"forward-section"		!FEWNAMES
 	"next-section"			!FEWNAMES
 	"down-section"			!FEWNAMES
 	']'
-	<move to the next start of a \"section\">
+	<move forward to the CNT'th start of a \"section\">
 gotobosent	ABSM|MOTION
 	"previous-sentence"		!FEWNAMES
 	"back-sentence"			!FEWNAMES
 	"up-sentence"			!FEWNAMES
 	'('
-	<move to the previous start of a \"sentence\">
+	<move to the CNT'th previous start of a \"sentence\">
 gotoeosent	ABSM|MOTION
 	"forward-sentence"		!FEWNAMES
 	"next-sentence"			!FEWNAMES
 	"down-sentence"			!FEWNAMES
 	')'
-	<move to the next start of a \"sentence\">
+	<move to the CNT'th start of a \"sentence\">
 gototag		NONE			OPT_TAGS
 	"ta"
 	"tag"
 	"find-tag"			!FEWNAMES
 	'^]'
 	<look up the given (or under-cursor) name as a \"tag\">
-gotochr		ABSM|MOTION|RANGE	!SMALLER
+gotochr		ABSM|MOTION		!SMALLER
 	"goto-char"
 	'^X-G'
 	<go to the CNT'th character.  unspecified CNT means end of buffer>
+gotopct		ABSM|MOTION		!SMALLER
+	"goto-percent"
+	<go to the CNT'th percent of the file.  unspecified CNT means end of buffer>
 gotocol		MOTION|MINIBUF
 	"goto-column"			!FEWNAMES
 	'|'
@@ -878,7 +881,7 @@
 	"insert-chars-at-bol"	!FEWNAMES
 	'I'
 	<insert (CNT copies of) text before the first non-white char on line>
-insfile		REDO|UNDO|GLOBOK|(FROM|ZERO|NAMEDF)
+insfile		REDO|UNDO|GLOBOK|FROM|ZERO|NAMEDF
 	"r"
 	"insert-file"			!FEWNAMES
 	"read-file"			!FEWNAMES
@@ -886,10 +889,10 @@
 	<read the given file into the current buffer at the current line>
 insspace	REDO|UNDO|MINIBUF	!SMALLER
 	"insert-space"			!FEWNAMES
-	<insert a space character at the cursor>
+	<insert CNT space character(s) at the cursor>
 insstring	REDO|UNDO		!SMALLER
 	"insert-string"
-	<insert the given string at the cursor>
+	<insert (CNT copies of) the given string at the cursor>
 joinlines	REDO|UNDO
 	"join-lines"			!FEWNAMES
 	'J'
@@ -898,13 +901,13 @@
 	"for-buffers"			!FEWNAMES
 	"fb"
 	'^X-x'
-	<for each buffer matched by the pattern, perform the command>
+	<for each buffer matched by the pattern, perform the command (CNT as per command)>
 killbuffer	GOAL
 	"delete-buffer"			!FEWNAMES
 	"kill-buffer"			!FEWNAMES
 	"ki"
 	'^X-k'
-	<eliminate the given or under-cursor buffer>
+	<eliminate the given or (CNT times) under-cursor buffer>
 showlength	DFLALL|FROM|TO|NOMOVE
 	"buffer-length"			!FEWNAMES
 	"="
@@ -928,26 +931,26 @@
 showhistory	NONE			OPT_HISTORY
 	"show-history"
 	<show the command history>
-lineputafter	REDO|UNDO|GLOBOK|(FROM|ZERO|OPTREG)
+lineputafter	REDO|UNDO|GLOBOK|FROM|ZERO|OPTREG
 	"put-as-lines-after"		!FEWNAMES
 	"put"
 	'^X-p'
-	<insert from (un)named register, as whole lines, after current line>
-lineputbefore	REDO|UNDO|GLOBOK|(FROM|OPTREG)
+	<insert CNT times from (un)named register, as whole lines, after current line>
+lineputbefore	REDO|UNDO|GLOBOK|FROM|OPTREG
 	"put-as-lines-before"		!FEWNAMES
 	"Put"
 	'^X-P'
-	<insert from (un)named register, as whole lines, before current line>
-rectputafter	REDO|UNDO|GLOBOK|(FROM|ZERO|OPTREG)
+	<insert CNT times from (un)named register, as whole lines, before current line>
+rectputafter	REDO|UNDO|GLOBOK|FROM|ZERO|OPTREG
 	"put-as-rectangle-after"	!FEWNAMES
 	"rput"
 	'^A-p'
-	<insert from (un)named register, as a rectangle, after cursor>
-rectputbefore	REDO|UNDO|GLOBOK|(FROM|OPTREG)
+	<insert CNT times from (un)named register, as a rectangle, after cursor>
+rectputbefore	REDO|UNDO|GLOBOK|FROM|OPTREG
 	"put-as-rectangle-before"	!FEWNAMES
 	"rPut"
 	'^A-P'
-	<insert from (un)named register, as a rectangle, in front of cursor>
+	<insert CNT times from (un)named register, as a rectangle, in front of cursor>
 lineundo	NONE
 	"undo-line-changes"		!FEWNAMES
 	'U'
@@ -963,14 +966,14 @@
 	"showregisters"			!FEWNAMES
 	"list-registers"		!FEWNAMES
 	<show the contents of all of the named and unnamed registers>
-sysmap		NONE|(EXRCOK|EXTRA)	OPT_SHOW_MAPS
+sysmap		EXRCOK|EXTRA		OPT_SHOW_MAPS
 	"show-system-mapped-chars"
 	<list the system function-key maps>
-map		NONE|(EXRCOK|EXTRA)
+map		EXRCOK|EXTRA
 	"map"
 	"show-mapped-chars"
 	<create a new map, or show list of the current command-mode maps>
-map_bang	NONE|(EXRCOK|EXTRA)
+map_bang	EXRCOK|EXTRA
 	"map!"
 	"show-mapped!-chars"
 	<create a new map, or show list of the current insert-mode maps>
@@ -993,10 +996,10 @@
 newprocessgroup	NONE
 	"new-process-group"
 	<put editor into its own process group (X11 version only)>
-noremap		NONE|(EXRCOK|EXTRA)
+noremap		EXRCOK|EXTRA
 	"noremap"
 	<create a new unremappable command-mode map>
-noremap_bang	NONE|(EXRCOK|EXTRA)
+noremap_bang	EXRCOK|EXTRA
 	"noremap!"
 	<create a new unremappable insert-mode map>
 cntl_a_func	NONE
@@ -1027,7 +1030,7 @@
 	"move-window-left"		!FEWNAMES
 	'^X-^L'
 	<scroll window to left by CNT columns, half screen if CNT unspecified>
-nextbuffer	NONE|(BANG|NAMEDFS)
+nextbuffer	BANG|NAMEDFS
 	"n"
 	"n!"
 	"next-buffer"			!FEWNAMES
@@ -1037,7 +1040,7 @@
 	<give the current buffer a new name>
 newline		REDO|UNDO		!SMALLER
 	"newline"
-	<insert a newline at the cursor>
+	<insert a newline at the cursor, CNT times>
 newlength	NONE
 	"screen-rows"
 	<tell the editor the screen has CNT rows>
@@ -1057,26 +1060,26 @@
 	"execute-named-command"		!FEWNAMES
 	":"
 	':'
-	<execute the given function, by name>
+	<execute the given function, by name, applying CNT as its repeat-count>
 openup		REDO|UNDO|(FROM)
 	"open-line-above-and-insert-chars"	!FEWNAMES
 	"i"
 	'O'
 	<insert text in CNT fresh blank line(s), before current line>
-openup_i	REDO|UNDO|(FROM)	0
+openup_i	REDO|UNDO|(FROM)	!SMALLER
 	"insert-indented-chars"		!FEWNAMES
 	"i!"
 	<insert text in CNT fresh blank line(s), before current line, toggle autoindent>
-openup_no_aindent	REDO|UNDO|(FROM|ZERO)
+openup_no_aindent	REDO|UNDO|FROM|ZERO
 	"open-line-above-no-autoindent"	!FEWNAMES
 	'^A-O'
 	<insert text in CNT fresh blank line(s), before current, no autoindent>
-opendown	REDO|UNDO|(FROM|ZERO)
+opendown	REDO|UNDO|FROM|ZERO
 	"open-line-below-and-append-chars"	!FEWNAMES
 	"a"
 	'o'
 	<insert text in CNT fresh blank line(s), after current line>
-opendown_no_aindent	REDO|UNDO|(FROM|ZERO)
+opendown_no_aindent	REDO|UNDO|FROM|ZERO
 	"open-line-below-no-autoindent"	!FEWNAMES
 	'^A-o'
 	<insert text in CNT fresh blank line(s), after current, no autoindent>
@@ -1128,10 +1131,11 @@
 	<display text underlined in the region>
 operchg		OPER|REDO|UNDO
 	"change-til"			!FEWNAMES
+	"c"
 	"delete-and-insert-chars-til"	!FEWNAMES
 	'c'
 	<insert text, replacing that in the region>
-operchg_i	OPER|REDO|UNDO		0
+operchg_i	OPER|REDO|UNDO		!SMALLER
 	"change-indented-chars"		!FEWNAMES
 	"c!"
 	<insert text, replacing that in the region, toggles autoindent>
@@ -1151,7 +1155,7 @@
 	"leading-entab-lines-til"	!FEWNAMES
 	'^X-^I'
 	<convert leading spaces to tabs where possible in the region>
-opermove	OPER|(RANGE|EXTRA)
+opermove	OPER|RANGE|EXTRA
 	"move-til"
 	"m"
 	<move text in the region to the given line>
@@ -1173,12 +1177,12 @@
 	"j!"
 	"join-exact-lines-til"		!FEWNAMES
 	<join together lines in the region without whitespace adjustment>
-operlinedel	OPER|REDO|UNDO|GLOBOK|(RANGE|OPTREG)
+operlinedel	OPER|REDO|UNDO|GLOBOK|RANGE|OPTREG
 	"delete-lines-til"		!FEWNAMES
 	"d"
 	'^X-d'
 	<delete lines covered by the region>
-operfilter	OPER|REDO|UNDO|(EXRCOK|RANGE|NAMEDFS|DFLNONE|VI_NL) OPT_SHELL
+operfilter	OPER|REDO|UNDO|EXRCOK|RANGE|NAMEDFS|DFLNONE|VI_NL OPT_SHELL
 	"filter-til"			!FEWNAMES
 	"!"
 	'!'
@@ -1194,13 +1198,13 @@
 	'^A-~'
 	<exchange upper and lowercase on characters in the region>
 # FIXME: RANGE is not done perhaps should be...
-operglobals	(BANG|EXTRA|DFLALL)
+operglobals	BANG|EXTRA|DFLALL
 	"global"
 	"g"
 	"v!"
 	<perform command on all lines containing the given pattern>
 # FIXME: RANGE is not done perhaps should be...
-opervglobals	(BANG|EXTRA|DFLALL)
+opervglobals	BANG|EXTRA|DFLALL
 	"inverse-global"
 	"vglobal"
 	"g!"
@@ -1218,6 +1222,7 @@
 opernumber	OPER|GLOBOK|(RANGE)
 	"number-lines-til"		!FEWNAMES
 	"nu"
+	"#"
 	<show lines with their line numbers>
 operprint	OPER|GLOBOK|(RANGE)
 	"print-lines-til"		!FEWNAMES
@@ -1246,11 +1251,11 @@
 	">"
 	'>'
 	<shift lines in the region right by one \"shiftwidth\">
-opersubst	OPER|REDO|UNDO|GLOBOK|(RANGE|EXTRA)
+opersubst	OPER|REDO|UNDO|GLOBOK|RANGE|EXTRA
 	"substitute-til"		!FEWNAMES
 	"s"
 	<perform a text substitution over the region>
-opersubstall	OPER|REDO|UNDO|GLOBOK|(RANGE|EXTRA)
+opersubstall	OPER|REDO|UNDO|GLOBOK|RANGE|EXTRA
 	"substitute-all-til"	!FEWNAMES
 	'^X-s'
 	<perform an all-occurrence text substitution over the region>
@@ -1268,28 +1273,28 @@
 	"yank-til"			!FEWNAMES
 	'y'
 	<get the region into the given named or unnamed register>
-operlineyank	OPER|(RANGE|OPTREG|NOMOVE)
+operlineyank	OPER|RANGE|OPTREG|NOMOVE
 	"yank-lines-til"		!FEWNAMES
 	"y"
 	'^X-y'
 	<get lines covered by region into given named or unnamed register>
-opersubstagain	OPER|REDO|UNDO|GLOBOK|(RANGE|EXTRA)
+opersubstagain	OPER|REDO|UNDO|GLOBOK|RANGE|EXTRA
 	"substitute-again-til"		!FEWNAMES
 	"&"
 	'^A-&'
 	<redo the previous text substitution over the region>
-opertransf	OPER|(RANGE|EXTRA)
+opertransf	OPER|RANGE|EXTRA
 	"transfer-til"
 	"t"
 	<copy text in the region>
-operwrite	OPER|(RANGE|BANG|FILE1|DFLALL|NOMOVE)
+operwrite	OPER|RANGE|BANG|FILE1|DFLALL|NOMOVE
 	"w"
 	"w!"
 	"W"
 	"write-til"			!FEWNAMES
 	'^W'
 	<write from region to the given file.  whole buffer by default>
-oper_wrenc	OPER|(RANGE|BANG|FILE1|DFLALL|NOMOVE)		OPT_SELECTIONS
+oper_wrenc	OPER|RANGE|BANG|FILE1|DFLALL|NOMOVE		OPT_SELECTIONS
 	"write-encoded-til"
 	<write attributed text from region to file.  whole buffer by default>
 overwritechars	REDO|UNDO
@@ -1318,7 +1323,7 @@
 	"position-window"		!FEWNAMES
 	'z'
 	<reframe with cursor at center (.,M,m), top (CR,H,t), or bottom (-,L,b)>
-prevbuffer	NONE|(BANG|NAMEDFS)	!SMALLER
+prevbuffer	BANG|NAMEDFS		!SMALLER
 	"P"
 	"previous-buffer"		!FEWNAMES
 	<switch to previous buffer (or the most-recently-visited, if \"autobuffer\" on>
@@ -1346,7 +1351,7 @@
 	"pwd"
 	"print-directory"
 	<show current directory name>
-quit		NONE|(BANG)
+quit		BANG
 	"q"
 	"Q"
 	"exit"
@@ -1359,7 +1364,7 @@
 	"q!"
 	"Q!"
 	<leave the editor, regardless of modified buffers>
-quickexit	NONE|(BANG|VI_NL)
+quickexit	BANG|VI_NL
 	"x"
 	"x!"
 	"xit"
@@ -1434,7 +1439,7 @@
 scrforwsearch	ABSM|MOTION
 	"screen-search-forward"		!FEWNAMES
 	'^X-/'
-	<search forwards for pattern (word) under cursor>
+	<search forward for pattern (word) under cursor>
 scrbacksearch	ABSM|MOTION
 	"screen-search-reverse"		!FEWNAMES
 	'^X-?'
@@ -1520,7 +1525,7 @@
 	"X"
 	'^X-X'
 	<set the encryption key on the current buffer>
-setlocmode	NONE|(EXRCOK|EXTRA)
+setlocmode	EXRCOK|EXTRA
 	"setl"
 	"set-mode"			!FEWNAMES
 	<change the current buffer's local value of a mode setting>
@@ -1530,7 +1535,7 @@
 	"setg"
 	"set-global-mode"
 	<change the global value of a mode setting>
-setnmmark	NONE|(FROM|EXTRA|NOMOVE)
+setnmmark	FROM|EXTRA|NOMOVE
 	"set-named-mark"		!FEWNAMES
 	"k"
 	'm'
@@ -1568,7 +1573,7 @@
 	"show-variables"
 	"showvars"			!FEWNAMES
 	<report values of all variables, built-in and user>
-showversion	NONE|(EXRCOK)
+showversion	EXRCOK
 	"version"
 	<report version information for the editor>
 showmarks	NONE			OPT_SHOW_MARKS
@@ -1587,7 +1592,7 @@
 	"shrink-window"			!FEWNAMES
 	'v'
 	<decrease the size of the current window by CNT lines>
-vl_source	NONE|(EXRCOK|NAMEDF)
+vl_source	EXRCOK|NAMEDF
 	"exsource"
 	<source a file of ex commands>
 vl_spawn	NONE			OPT_SHELL
@@ -1652,7 +1657,7 @@
 	"redo-changes-forward"		!FEWNAMES
 	'^X-r'
 	<redo changes made to a buffer, after they have been undone>
-unabbr		NONE|(EXRCOK|BANG|EXTRA)
+unabbr		EXRCOK|BANG|EXTRA
 	"unabbreviate"
 	<delete an abbreviation>
 reptc_func	NONE
@@ -1665,13 +1670,13 @@
 unmark		NONE
 	"unmark-buffer"
 	<clear the \"modified\" status of a buffer>
-unmap		NONE|(EXRCOK|BANG|EXTRA)
+unmap		EXRCOK|BANG|EXTRA
 	"unmap"
 	<delete a command-mode mapping>
-unmap_bang	NONE|(EXRCOK|EXTRA)
+unmap_bang	EXRCOK|EXTRA
 	"unmap!"
 	<delete an insert-mode mapping>
-unmap_system	NONE|(EXRCOK|EXTRA)
+unmap_system	EXRCOK|EXTRA
 	"unmap-system-chars"
 	<delete a system function-key mapping>
 untagpop	NONE			OPT_TAGS
@@ -1770,17 +1775,17 @@
 wordcount	RANGE			OPT_WORDCOUNT
 	"count-words"
 	<count words, lines, and chars in the region>
-writeallbuffers	NONE|(BANG|VI_NL)
+writeallbuffers	BANG|VI_NL
 	"wall"
 	"wall!"
 	"write-all-buffers"		!FEWNAMES
 	<attempt to write all buffers whether or not marked \"modified\">
-writeallchanged	NONE|(BANG|VI_NL)
+writeallchanged	BANG|VI_NL
 	"ww"
 	"ww!"
 	"write-changed-buffers"		!FEWNAMES
 	<attempt to write any buffers which are marked \"modified\">
-writequit	NONE|(VI_NL)
+writequit	VI_NL
 	"wq"
 	"wq!"
 	"Wq"
@@ -1815,7 +1820,7 @@
 xterm_mouse_T	NONE			(OPT_XTERM>=3)
 	'FN-T'				KEY_textInvalid
 	<dummy command to support xterm mouse operation>
-zzquit		NONE|(BANG|VI_NL)
+zzquit		BANG|VI_NL
 	'Z'
 	"stuttered-write-all-and-quit"	!FEWNAMES
 	<if repeated, leave the editor, writing modified buffers as needed>
@@ -1878,7 +1883,7 @@
 	"paste-from-clipboard"
 	'SHIFT+INSERT'			W32KY
 	<paste the windows clipboard contents>
-opercbrdcpy	OPER|(RANGE|NOMOVE)	SYS_WINNT
+opercbrdcpy	OPER|RANGE|NOMOVE	SYS_WINNT
 	"copy-to-clipboard-til"
 	'CTRL+INSERT'			W32KY
 	<copies the specified region to the windows clipboard>
Index: configure
--- vile-9.5k+/configure	2006-09-24 23:30:22.000000000 +0000
+++ vile-9.5l/configure	2006-10-28 19:14:59.000000000 +0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.224 .
+# From configure.in Revision: 1.225 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by Autoconf 2.52.20030208.
 #
@@ -3392,14 +3392,14 @@
 else
 
 	cf_cv_makeflags=''
-	for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)'
+	for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
 	do
 		cat >cf_makeflags.tmp <<CF_EOF
 SHELL = /bin/sh
 all :
 	@ echo '.$cf_option'
 CF_EOF
-		cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null`
+		cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[ 	]*$,,'`
 		case "$cf_result" in
 		.*k)
 			cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
@@ -8711,8 +8711,8 @@
 
 	cat >> ./Imakefile <<'CF_EOF'
 findstddefs:
-	@echo IMAKE $(ALLDEFINES)       | sed -f fix_cflags.sed
-	@echo IMAKE $(EXTRA_LOAD_FLAGS) | sed -f fix_lflags.sed
+	@echo IMAKE ${ALLDEFINES}       | sed -f fix_cflags.sed
+	@echo IMAKE ${EXTRA_LOAD_FLAGS} | sed -f fix_lflags.sed
 CF_EOF
 
 	if ( $IMAKE $cf_imake_opts 1>/dev/null 2>&5 && test -f Makefile)
@@ -8757,7 +8757,7 @@
 	cd ..
 	rm -rf conftestdir
 
-	# We use $(ALLDEFINES) rather than $(STD_DEFINES) because the former
+	# We use ${ALLDEFINES} rather than ${STD_DEFINES} because the former
 	# declares XTFUNCPROTO there.  However, some vendors (e.g., SGI) have
 	# modified it to support site.cf, adding a kludge for the /usr/include
 	# directory.  Try to filter that out, otherwise gcc won't find its
@@ -10953,13 +10953,80 @@
   cf_cv_curses_dir=no
 fi;
 
+cf_ncuconfig_root=ncurses
+
+echo "Looking for ${cf_ncuconfig_root}-config"
+for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:10963: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $NCURSES_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
+   echo "$as_me:10980: found $ac_dir/$ac_word" >&5
+   break
+fi
+done
+
+  ;;
+esac
+fi
+NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
+
+if test -n "$NCURSES_CONFIG"; then
+  echo "$as_me:10991: result: $NCURSES_CONFIG" >&5
+echo "${ECHO_T}$NCURSES_CONFIG" >&6
+else
+  echo "$as_me:10994: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$NCURSES_CONFIG" && break
+done
+test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
+
+if test "$NCURSES_CONFIG" != none ; then
+
+cf_cv_ncurses_header=curses.h
+
+CPPFLAGS="`$NCURSES_CONFIG --cflags` $CPPFLAGS"
+LIBS="`$NCURSES_CONFIG --libs` $LIBS"
+
+cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >>confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
+EOF
+
+cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+
+else
+
 cf_ncuhdr_root=ncurses
 
 test -n "$cf_cv_curses_dir" && \
 test "$cf_cv_curses_dir" != "no" && \
 CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
 
-echo "$as_me:10962: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "$as_me:11029: checking for $cf_ncuhdr_root header in include-path" >&5
 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
 if test "${cf_cv_ncurses_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10971,7 +11038,7 @@
 	do
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 10974 "configure"
+#line 11041 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -10995,16 +11062,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10998: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:11065: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11001: \$? = $ac_status" >&5
+  echo "$as_me:11068: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11004: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11071: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11007: \$? = $ac_status" >&5
+  echo "$as_me:11074: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h=$cf_header
 
@@ -11019,14 +11086,14 @@
 	done
 
 fi
-echo "$as_me:11022: result: $cf_cv_ncurses_h" >&5
+echo "$as_me:11089: result: $cf_cv_ncurses_h" >&5
 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
 
 if test "$cf_cv_ncurses_h" != no ; then
 	cf_cv_ncurses_header=$cf_cv_ncurses_h
 else
 
-echo "$as_me:11029: checking for $cf_ncuhdr_root include-path" >&5
+echo "$as_me:11096: checking for $cf_ncuhdr_root include-path" >&5
 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
 if test "${cf_cv_ncurses_h2+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11121,7 +11188,7 @@
 				cf_save_CPPFLAGS="$CPPFLAGS"
 				CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 				cat >conftest.$ac_ext <<_ACEOF
-#line 11124 "configure"
+#line 11191 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -11133,16 +11200,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11136: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:11203: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11139: \$? = $ac_status" >&5
+  echo "$as_me:11206: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11142: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11209: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11145: \$? = $ac_status" >&5
+  echo "$as_me:11212: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -11169,7 +11236,7 @@
 		do
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11172 "configure"
+#line 11239 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -11193,16 +11260,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11196: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:11263: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11199: \$? = $ac_status" >&5
+  echo "$as_me:11266: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11202: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11269: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11205: \$? = $ac_status" >&5
+  echo "$as_me:11272: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h2=$cf_header
 
@@ -11223,12 +11290,12 @@
 		CPPFLAGS="$cf_save2_CPPFLAGS"
 		test "$cf_cv_ncurses_h2" != no && break
 	done
-	test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11226: error: not found" >&5
+	test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11293: error: not found" >&5
 echo "$as_me: error: not found" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:11231: result: $cf_cv_ncurses_h2" >&5
+echo "$as_me:11298: result: $cf_cv_ncurses_h2" >&5
 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
 
 	cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
@@ -11250,7 +11317,7 @@
 				cf_save_CPPFLAGS="$CPPFLAGS"
 				CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 				cat >conftest.$ac_ext <<_ACEOF
-#line 11253 "configure"
+#line 11320 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -11262,16 +11329,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11265: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:11332: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11268: \$? = $ac_status" >&5
+  echo "$as_me:11335: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11271: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11338: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11274: \$? = $ac_status" >&5
+  echo "$as_me:11341: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -11320,7 +11387,7 @@
 	;;
 esac
 
-echo "$as_me:11323: checking for terminfo header" >&5
+echo "$as_me:11390: checking for terminfo header" >&5
 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
 if test "${cf_cv_term_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11338,7 +11405,7 @@
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 11341 "configure"
+#line 11408 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -11353,16 +11420,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11356: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:11423: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11359: \$? = $ac_status" >&5
+  echo "$as_me:11426: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11362: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11429: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11365: \$? = $ac_status" >&5
+  echo "$as_me:11432: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_term_header="$cf_test"
@@ -11378,7 +11445,7 @@
 done
 
 fi
-echo "$as_me:11381: result: $cf_cv_term_header" >&5
+echo "$as_me:11448: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -11412,7 +11479,7 @@
 #define NCURSES 1
 EOF
 
-echo "$as_me:11415: checking for ncurses version" >&5
+echo "$as_me:11482: checking for ncurses version" >&5
 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
 if test "${cf_cv_ncurses_version+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11438,10 +11505,10 @@
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo "$as_me:11441: \"$cf_try\"") >&5
+	{ (eval echo "$as_me:11508: \"$cf_try\"") >&5
   (eval $cf_try) 2>&5
   ac_status=$?
-  echo "$as_me:11444: \$? = $ac_status" >&5
+  echo "$as_me:11511: \$? = $ac_status" >&5
   (exit $ac_status); }
 	if test -f conftest.out ; then
 		cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
@@ -11451,7 +11518,7 @@
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11454 "configure"
+#line 11521 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -11476,15 +11543,15 @@
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:11479: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11546: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11482: \$? = $ac_status" >&5
+  echo "$as_me:11549: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:11484: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11551: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11487: \$? = $ac_status" >&5
+  echo "$as_me:11554: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -11498,7 +11565,7 @@
 	rm -f $cf_tempfile
 
 fi
-echo "$as_me:11501: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:11568: result: $cf_cv_ncurses_version" >&5
 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
 #define NCURSES 1
@@ -11510,7 +11577,7 @@
 	# to link gpm.
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
-echo "$as_me:11513: checking for Gpm_Open in -lgpm" >&5
+echo "$as_me:11580: checking for Gpm_Open in -lgpm" >&5
 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11518,7 +11585,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11521 "configure"
+#line 11588 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11537,16 +11604,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11540: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11607: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11543: \$? = $ac_status" >&5
+  echo "$as_me:11610: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11546: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11613: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11549: \$? = $ac_status" >&5
+  echo "$as_me:11616: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_Gpm_Open=yes
 else
@@ -11557,10 +11624,10 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11560: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:11627: result: $ac_cv_lib_gpm_Gpm_Open" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
-  echo "$as_me:11563: checking for initscr in -lgpm" >&5
+  echo "$as_me:11630: checking for initscr in -lgpm" >&5
 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11568,7 +11635,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11571 "configure"
+#line 11638 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11587,16 +11654,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11590: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11657: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11593: \$? = $ac_status" >&5
+  echo "$as_me:11660: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11596: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11663: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11599: \$? = $ac_status" >&5
+  echo "$as_me:11666: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_initscr=yes
 else
@@ -11607,7 +11674,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11610: result: $ac_cv_lib_gpm_initscr" >&5
+echo "$as_me:11677: result: $ac_cv_lib_gpm_initscr" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
 if test $ac_cv_lib_gpm_initscr = yes; then
   LIBS="$cf_ncurses_SAVE"
@@ -11622,7 +11689,7 @@
 	# This is only necessary if you are linking against an obsolete
 	# version of ncurses (but it should do no harm, since it's static).
 	if test "$cf_nculib_root" = ncurses ; then
-		echo "$as_me:11625: checking for tgoto in -lmytinfo" >&5
+		echo "$as_me:11692: checking for tgoto in -lmytinfo" >&5
 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11630,7 +11697,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11633 "configure"
+#line 11700 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11649,16 +11716,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11652: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11719: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11655: \$? = $ac_status" >&5
+  echo "$as_me:11722: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11658: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11725: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11661: \$? = $ac_status" >&5
+  echo "$as_me:11728: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_mytinfo_tgoto=yes
 else
@@ -11669,7 +11736,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11672: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:11739: result: $ac_cv_lib_mytinfo_tgoto" >&5
 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
 if test $ac_cv_lib_mytinfo_tgoto = yes; then
   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
@@ -11688,13 +11755,13 @@
 
 	eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
 	cf_libdir=""
-	echo "$as_me:11691: checking for initscr" >&5
+	echo "$as_me:11758: checking for initscr" >&5
 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
 if test "${ac_cv_func_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11697 "configure"
+#line 11764 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr (); below.  */
@@ -11725,16 +11792,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11728: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11795: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11731: \$? = $ac_status" >&5
+  echo "$as_me:11798: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11734: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11801: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11737: \$? = $ac_status" >&5
+  echo "$as_me:11804: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_initscr=yes
 else
@@ -11744,18 +11811,18 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:11747: result: $ac_cv_func_initscr" >&5
+echo "$as_me:11814: result: $ac_cv_func_initscr" >&5
 echo "${ECHO_T}$ac_cv_func_initscr" >&6
 if test $ac_cv_func_initscr = yes; then
   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 else
 
 		cf_save_LIBS="$LIBS"
-		echo "$as_me:11754: checking for initscr in -l$cf_nculib_root" >&5
+		echo "$as_me:11821: checking for initscr in -l$cf_nculib_root" >&5
 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
 		LIBS="-l$cf_nculib_root $LIBS"
 		cat >conftest.$ac_ext <<_ACEOF
-#line 11758 "configure"
+#line 11825 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int
@@ -11767,25 +11834,25 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11770: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11837: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11773: \$? = $ac_status" >&5
+  echo "$as_me:11840: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11776: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11843: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11779: \$? = $ac_status" >&5
+  echo "$as_me:11846: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:11781: result: yes" >&5
+  echo "$as_me:11848: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 			 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:11788: result: no" >&5
+echo "$as_me:11855: result: no" >&5
 echo "${ECHO_T}no" >&6
 			cf_search=""
 
@@ -11845,11 +11912,11 @@
 
 			for cf_libdir in $cf_search
 			do
-				echo "$as_me:11848: checking for -l$cf_nculib_root in $cf_libdir" >&5
+				echo "$as_me:11915: checking for -l$cf_nculib_root in $cf_libdir" >&5
 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
 				LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
 				cat >conftest.$ac_ext <<_ACEOF
-#line 11852 "configure"
+#line 11919 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int
@@ -11861,25 +11928,25 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11864: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11931: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11867: \$? = $ac_status" >&5
+  echo "$as_me:11934: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11870: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11937: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11873: \$? = $ac_status" >&5
+  echo "$as_me:11940: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:11875: result: yes" >&5
+  echo "$as_me:11942: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 			 		 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 					 break
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:11882: result: no" >&5
+echo "$as_me:11949: result: no" >&5
 echo "${ECHO_T}no" >&6
 					 LIBS="$cf_save_LIBS"
 fi
@@ -11894,7 +11961,7 @@
 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
 
 if test $cf_found_library = no ; then
-	{ { echo "$as_me:11897: error: Cannot link $cf_nculib_root library" >&5
+	{ { echo "$as_me:11964: error: Cannot link $cf_nculib_root library" >&5
 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -11902,7 +11969,7 @@
 fi
 
 if test -n "$cf_ncurses_LIBS" ; then
-	echo "$as_me:11905: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+	echo "$as_me:11972: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
 	cf_ncurses_SAVE="$LIBS"
 	for p in $cf_ncurses_LIBS ; do
@@ -11912,7 +11979,7 @@
 		fi
 	done
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11915 "configure"
+#line 11982 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int
@@ -11924,23 +11991,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11927: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11994: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11930: \$? = $ac_status" >&5
+  echo "$as_me:11997: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11933: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12000: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11936: \$? = $ac_status" >&5
+  echo "$as_me:12003: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:11938: result: yes" >&5
+  echo "$as_me:12005: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:11943: result: no" >&5
+echo "$as_me:12010: result: no" >&5
 echo "${ECHO_T}no" >&6
 		 LIBS="$cf_ncurses_SAVE"
 fi
@@ -11953,6 +12020,8 @@
 #define $cf_nculib_ROOT 1
 EOF
 
+fi
+
 	;;
 	ncursesw)
 		SCREEN=curses
@@ -11961,13 +12030,80 @@
 #define DISP_CURSES 1
 EOF
 
+cf_ncuconfig_root=ncursesw
+
+echo "Looking for ${cf_ncuconfig_root}-config"
+for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:12040: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $NCURSES_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
+   echo "$as_me:12057: found $ac_dir/$ac_word" >&5
+   break
+fi
+done
+
+  ;;
+esac
+fi
+NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
+
+if test -n "$NCURSES_CONFIG"; then
+  echo "$as_me:12068: result: $NCURSES_CONFIG" >&5
+echo "${ECHO_T}$NCURSES_CONFIG" >&6
+else
+  echo "$as_me:12071: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$NCURSES_CONFIG" && break
+done
+test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
+
+if test "$NCURSES_CONFIG" != none ; then
+
+cf_cv_ncurses_header=curses.h
+
+CPPFLAGS="`$NCURSES_CONFIG --cflags` $CPPFLAGS"
+LIBS="`$NCURSES_CONFIG --libs` $LIBS"
+
+cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >>confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
+EOF
+
+cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+
+else
+
 cf_ncuhdr_root=ncursesw
 
 test -n "$cf_cv_curses_dir" && \
 test "$cf_cv_curses_dir" != "no" && \
 CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
 
-echo "$as_me:11970: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "$as_me:12106: checking for $cf_ncuhdr_root header in include-path" >&5
 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
 if test "${cf_cv_ncurses_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11979,7 +12115,7 @@
 	do
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11982 "configure"
+#line 12118 "configure"
 #include "confdefs.h"
 
 #define _XOPEN_SOURCE_EXTENDED
@@ -12011,16 +12147,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12014: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12150: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12017: \$? = $ac_status" >&5
+  echo "$as_me:12153: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12020: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12156: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12023: \$? = $ac_status" >&5
+  echo "$as_me:12159: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h=$cf_header
 
@@ -12035,14 +12171,14 @@
 	done
 
 fi
-echo "$as_me:12038: result: $cf_cv_ncurses_h" >&5
+echo "$as_me:12174: result: $cf_cv_ncurses_h" >&5
 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
 
 if test "$cf_cv_ncurses_h" != no ; then
 	cf_cv_ncurses_header=$cf_cv_ncurses_h
 else
 
-echo "$as_me:12045: checking for $cf_ncuhdr_root include-path" >&5
+echo "$as_me:12181: checking for $cf_ncuhdr_root include-path" >&5
 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
 if test "${cf_cv_ncurses_h2+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12137,7 +12273,7 @@
 				cf_save_CPPFLAGS="$CPPFLAGS"
 				CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 				cat >conftest.$ac_ext <<_ACEOF
-#line 12140 "configure"
+#line 12276 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -12149,16 +12285,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12152: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12288: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12155: \$? = $ac_status" >&5
+  echo "$as_me:12291: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12158: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12294: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12161: \$? = $ac_status" >&5
+  echo "$as_me:12297: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -12185,7 +12321,7 @@
 		do
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 12188 "configure"
+#line 12324 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -12209,16 +12345,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12212: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12348: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12215: \$? = $ac_status" >&5
+  echo "$as_me:12351: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12218: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12354: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12221: \$? = $ac_status" >&5
+  echo "$as_me:12357: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h2=$cf_header
 
@@ -12239,12 +12375,12 @@
 		CPPFLAGS="$cf_save2_CPPFLAGS"
 		test "$cf_cv_ncurses_h2" != no && break
 	done
-	test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:12242: error: not found" >&5
+	test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:12378: error: not found" >&5
 echo "$as_me: error: not found" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:12247: result: $cf_cv_ncurses_h2" >&5
+echo "$as_me:12383: result: $cf_cv_ncurses_h2" >&5
 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
 
 	cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
@@ -12266,7 +12402,7 @@
 				cf_save_CPPFLAGS="$CPPFLAGS"
 				CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 				cat >conftest.$ac_ext <<_ACEOF
-#line 12269 "configure"
+#line 12405 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -12278,16 +12414,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12281: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12417: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12284: \$? = $ac_status" >&5
+  echo "$as_me:12420: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12287: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12423: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12290: \$? = $ac_status" >&5
+  echo "$as_me:12426: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -12336,7 +12472,7 @@
 	;;
 esac
 
-echo "$as_me:12339: checking for terminfo header" >&5
+echo "$as_me:12475: checking for terminfo header" >&5
 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
 if test "${cf_cv_term_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12354,7 +12490,7 @@
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 12357 "configure"
+#line 12493 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -12369,16 +12505,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12372: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12508: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12375: \$? = $ac_status" >&5
+  echo "$as_me:12511: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12378: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12514: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12381: \$? = $ac_status" >&5
+  echo "$as_me:12517: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_term_header="$cf_test"
@@ -12394,7 +12530,7 @@
 done
 
 fi
-echo "$as_me:12397: result: $cf_cv_term_header" >&5
+echo "$as_me:12533: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -12428,7 +12564,7 @@
 #define NCURSES 1
 EOF
 
-echo "$as_me:12431: checking for ncurses version" >&5
+echo "$as_me:12567: checking for ncurses version" >&5
 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
 if test "${cf_cv_ncurses_version+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12454,10 +12590,10 @@
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo "$as_me:12457: \"$cf_try\"") >&5
+	{ (eval echo "$as_me:12593: \"$cf_try\"") >&5
   (eval $cf_try) 2>&5
   ac_status=$?
-  echo "$as_me:12460: \$? = $ac_status" >&5
+  echo "$as_me:12596: \$? = $ac_status" >&5
   (exit $ac_status); }
 	if test -f conftest.out ; then
 		cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
@@ -12467,7 +12603,7 @@
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 12470 "configure"
+#line 12606 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -12492,15 +12628,15 @@
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:12495: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12631: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12498: \$? = $ac_status" >&5
+  echo "$as_me:12634: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:12500: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12636: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12503: \$? = $ac_status" >&5
+  echo "$as_me:12639: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -12514,7 +12650,7 @@
 	rm -f $cf_tempfile
 
 fi
-echo "$as_me:12517: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:12653: result: $cf_cv_ncurses_version" >&5
 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
 #define NCURSES 1
@@ -12526,7 +12662,7 @@
 	# to link gpm.
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
-echo "$as_me:12529: checking for Gpm_Open in -lgpm" >&5
+echo "$as_me:12665: checking for Gpm_Open in -lgpm" >&5
 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12534,7 +12670,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 12537 "configure"
+#line 12673 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -12553,16 +12689,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12556: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12692: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12559: \$? = $ac_status" >&5
+  echo "$as_me:12695: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12562: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12698: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12565: \$? = $ac_status" >&5
+  echo "$as_me:12701: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_Gpm_Open=yes
 else
@@ -12573,10 +12709,10 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:12576: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:12712: result: $ac_cv_lib_gpm_Gpm_Open" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
-  echo "$as_me:12579: checking for initscr in -lgpm" >&5
+  echo "$as_me:12715: checking for initscr in -lgpm" >&5
 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12584,7 +12720,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 12587 "configure"
+#line 12723 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -12603,16 +12739,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12606: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12742: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12609: \$? = $ac_status" >&5
+  echo "$as_me:12745: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12612: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12748: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12615: \$? = $ac_status" >&5
+  echo "$as_me:12751: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_initscr=yes
 else
@@ -12623,7 +12759,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:12626: result: $ac_cv_lib_gpm_initscr" >&5
+echo "$as_me:12762: result: $ac_cv_lib_gpm_initscr" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
 if test $ac_cv_lib_gpm_initscr = yes; then
   LIBS="$cf_ncurses_SAVE"
@@ -12638,7 +12774,7 @@
 	# This is only necessary if you are linking against an obsolete
 	# version of ncurses (but it should do no harm, since it's static).
 	if test "$cf_nculib_root" = ncurses ; then
-		echo "$as_me:12641: checking for tgoto in -lmytinfo" >&5
+		echo "$as_me:12777: checking for tgoto in -lmytinfo" >&5
 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12646,7 +12782,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 12649 "configure"
+#line 12785 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -12665,16 +12801,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12668: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12804: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12671: \$? = $ac_status" >&5
+  echo "$as_me:12807: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12674: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12810: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12677: \$? = $ac_status" >&5
+  echo "$as_me:12813: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_mytinfo_tgoto=yes
 else
@@ -12685,7 +12821,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:12688: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:12824: result: $ac_cv_lib_mytinfo_tgoto" >&5
 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
 if test $ac_cv_lib_mytinfo_tgoto = yes; then
   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
@@ -12704,13 +12840,13 @@
 
 	eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
 	cf_libdir=""
-	echo "$as_me:12707: checking for initscr" >&5
+	echo "$as_me:12843: checking for initscr" >&5
 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
 if test "${ac_cv_func_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 12713 "configure"
+#line 12849 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr (); below.  */
@@ -12741,16 +12877,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12744: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12880: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12747: \$? = $ac_status" >&5
+  echo "$as_me:12883: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12750: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12886: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12753: \$? = $ac_status" >&5
+  echo "$as_me:12889: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_initscr=yes
 else
@@ -12760,18 +12896,18 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:12763: result: $ac_cv_func_initscr" >&5
+echo "$as_me:12899: result: $ac_cv_func_initscr" >&5
 echo "${ECHO_T}$ac_cv_func_initscr" >&6
 if test $ac_cv_func_initscr = yes; then
   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 else
 
 		cf_save_LIBS="$LIBS"
-		echo "$as_me:12770: checking for initscr in -l$cf_nculib_root" >&5
+		echo "$as_me:12906: checking for initscr in -l$cf_nculib_root" >&5
 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
 		LIBS="-l$cf_nculib_root $LIBS"
 		cat >conftest.$ac_ext <<_ACEOF
-#line 12774 "configure"
+#line 12910 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int
@@ -12783,25 +12919,25 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12786: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12922: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12789: \$? = $ac_status" >&5
+  echo "$as_me:12925: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12792: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12928: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12795: \$? = $ac_status" >&5
+  echo "$as_me:12931: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:12797: result: yes" >&5
+  echo "$as_me:12933: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 			 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:12804: result: no" >&5
+echo "$as_me:12940: result: no" >&5
 echo "${ECHO_T}no" >&6
 			cf_search=""
 
@@ -12861,11 +12997,11 @@
 
 			for cf_libdir in $cf_search
 			do
-				echo "$as_me:12864: checking for -l$cf_nculib_root in $cf_libdir" >&5
+				echo "$as_me:13000: checking for -l$cf_nculib_root in $cf_libdir" >&5
 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
 				LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
 				cat >conftest.$ac_ext <<_ACEOF
-#line 12868 "configure"
+#line 13004 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int
@@ -12877,25 +13013,25 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12880: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13016: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12883: \$? = $ac_status" >&5
+  echo "$as_me:13019: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12886: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13022: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12889: \$? = $ac_status" >&5
+  echo "$as_me:13025: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:12891: result: yes" >&5
+  echo "$as_me:13027: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 			 		 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 					 break
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:12898: result: no" >&5
+echo "$as_me:13034: result: no" >&5
 echo "${ECHO_T}no" >&6
 					 LIBS="$cf_save_LIBS"
 fi
@@ -12910,7 +13046,7 @@
 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
 
 if test $cf_found_library = no ; then
-	{ { echo "$as_me:12913: error: Cannot link $cf_nculib_root library" >&5
+	{ { echo "$as_me:13049: error: Cannot link $cf_nculib_root library" >&5
 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -12918,7 +13054,7 @@
 fi
 
 if test -n "$cf_ncurses_LIBS" ; then
-	echo "$as_me:12921: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+	echo "$as_me:13057: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
 	cf_ncurses_SAVE="$LIBS"
 	for p in $cf_ncurses_LIBS ; do
@@ -12928,7 +13064,7 @@
 		fi
 	done
 	cat >conftest.$ac_ext <<_ACEOF
-#line 12931 "configure"
+#line 13067 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int
@@ -12940,23 +13076,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12943: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13079: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12946: \$? = $ac_status" >&5
+  echo "$as_me:13082: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12949: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13085: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12952: \$? = $ac_status" >&5
+  echo "$as_me:13088: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:12954: result: yes" >&5
+  echo "$as_me:13090: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:12959: result: no" >&5
+echo "$as_me:13095: result: no" >&5
 echo "${ECHO_T}no" >&6
 		 LIBS="$cf_ncurses_SAVE"
 fi
@@ -12969,6 +13105,8 @@
 #define $cf_nculib_ROOT 1
 EOF
 
+fi
+
 	;;
 	* )
 		SCREEN=tcap
@@ -12977,7 +13115,7 @@
 #define DISP_TERMCAP 1
 EOF
 
-		echo "$as_me:12980: checking if you want to use ncurses" >&5
+		echo "$as_me:13118: checking if you want to use ncurses" >&5
 echo $ECHO_N "checking if you want to use ncurses... $ECHO_C" >&6
 
 # Check whether --with-ncurses or --without-ncurses was given.
@@ -12987,7 +13125,7 @@
 else
   withval=no
 fi;
-		echo "$as_me:12990: result: $withval" >&5
+		echo "$as_me:13128: result: $withval" >&5
 echo "${ECHO_T}$withval" >&6
 
 if test "${cf_cv_termlib+set}" = set; then
@@ -12996,7 +13134,7 @@
 
 cf_cv_termlib=none
 cat >conftest.$ac_ext <<_ACEOF
-#line 12999 "configure"
+#line 13137 "configure"
 #include "confdefs.h"
 
 int
@@ -13008,19 +13146,19 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13011: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13149: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13014: \$? = $ac_status" >&5
+  echo "$as_me:13152: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13017: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13155: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13020: \$? = $ac_status" >&5
+  echo "$as_me:13158: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cat >conftest.$ac_ext <<_ACEOF
-#line 13023 "configure"
+#line 13161 "configure"
 #include "confdefs.h"
 
 int
@@ -13032,16 +13170,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13035: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13173: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13038: \$? = $ac_status" >&5
+  echo "$as_me:13176: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13041: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13179: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13044: \$? = $ac_status" >&5
+  echo "$as_me:13182: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_termlib=terminfo
 else
@@ -13059,13 +13197,80 @@
 case "$screen" in # (vi
 ncurses*)
 
+cf_ncuconfig_root=$screen
+
+echo "Looking for ${cf_ncuconfig_root}-config"
+for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:13207: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $NCURSES_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
+   echo "$as_me:13224: found $ac_dir/$ac_word" >&5
+   break
+fi
+done
+
+  ;;
+esac
+fi
+NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
+
+if test -n "$NCURSES_CONFIG"; then
+  echo "$as_me:13235: result: $NCURSES_CONFIG" >&5
+echo "${ECHO_T}$NCURSES_CONFIG" >&6
+else
+  echo "$as_me:13238: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$NCURSES_CONFIG" && break
+done
+test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
+
+if test "$NCURSES_CONFIG" != none ; then
+
+cf_cv_ncurses_header=curses.h
+
+CPPFLAGS="`$NCURSES_CONFIG --cflags` $CPPFLAGS"
+LIBS="`$NCURSES_CONFIG --libs` $LIBS"
+
+cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >>confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
+EOF
+
+cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+
+else
+
 cf_ncuhdr_root=$screen
 
 test -n "$cf_cv_curses_dir" && \
 test "$cf_cv_curses_dir" != "no" && \
 CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
 
-echo "$as_me:13068: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "$as_me:13273: checking for $cf_ncuhdr_root header in include-path" >&5
 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
 if test "${cf_cv_ncurses_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13077,7 +13282,7 @@
 	do
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 13080 "configure"
+#line 13285 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -13101,16 +13306,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13104: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13309: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13107: \$? = $ac_status" >&5
+  echo "$as_me:13312: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13110: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13315: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13113: \$? = $ac_status" >&5
+  echo "$as_me:13318: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h=$cf_header
 
@@ -13125,14 +13330,14 @@
 	done
 
 fi
-echo "$as_me:13128: result: $cf_cv_ncurses_h" >&5
+echo "$as_me:13333: result: $cf_cv_ncurses_h" >&5
 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
 
 if test "$cf_cv_ncurses_h" != no ; then
 	cf_cv_ncurses_header=$cf_cv_ncurses_h
 else
 
-echo "$as_me:13135: checking for $cf_ncuhdr_root include-path" >&5
+echo "$as_me:13340: checking for $cf_ncuhdr_root include-path" >&5
 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
 if test "${cf_cv_ncurses_h2+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13227,7 +13432,7 @@
 				cf_save_CPPFLAGS="$CPPFLAGS"
 				CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 				cat >conftest.$ac_ext <<_ACEOF
-#line 13230 "configure"
+#line 13435 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -13239,16 +13444,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13242: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13447: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13245: \$? = $ac_status" >&5
+  echo "$as_me:13450: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13248: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13453: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13251: \$? = $ac_status" >&5
+  echo "$as_me:13456: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -13275,7 +13480,7 @@
 		do
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 13278 "configure"
+#line 13483 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -13299,16 +13504,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13302: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13507: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13305: \$? = $ac_status" >&5
+  echo "$as_me:13510: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13308: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13513: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13311: \$? = $ac_status" >&5
+  echo "$as_me:13516: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h2=$cf_header
 
@@ -13329,12 +13534,12 @@
 		CPPFLAGS="$cf_save2_CPPFLAGS"
 		test "$cf_cv_ncurses_h2" != no && break
 	done
-	test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:13332: error: not found" >&5
+	test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:13537: error: not found" >&5
 echo "$as_me: error: not found" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:13337: result: $cf_cv_ncurses_h2" >&5
+echo "$as_me:13542: result: $cf_cv_ncurses_h2" >&5
 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
 
 	cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
@@ -13356,7 +13561,7 @@
 				cf_save_CPPFLAGS="$CPPFLAGS"
 				CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 				cat >conftest.$ac_ext <<_ACEOF
-#line 13359 "configure"
+#line 13564 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -13368,16 +13573,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13371: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13576: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13374: \$? = $ac_status" >&5
+  echo "$as_me:13579: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13377: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13582: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13380: \$? = $ac_status" >&5
+  echo "$as_me:13585: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -13426,7 +13631,7 @@
 	;;
 esac
 
-echo "$as_me:13429: checking for terminfo header" >&5
+echo "$as_me:13634: checking for terminfo header" >&5
 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
 if test "${cf_cv_term_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13444,7 +13649,7 @@
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 13447 "configure"
+#line 13652 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -13459,16 +13664,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13462: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13667: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13465: \$? = $ac_status" >&5
+  echo "$as_me:13670: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13468: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13673: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13471: \$? = $ac_status" >&5
+  echo "$as_me:13676: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_term_header="$cf_test"
@@ -13484,7 +13689,7 @@
 done
 
 fi
-echo "$as_me:13487: result: $cf_cv_term_header" >&5
+echo "$as_me:13692: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -13518,7 +13723,7 @@
 #define NCURSES 1
 EOF
 
-echo "$as_me:13521: checking for ncurses version" >&5
+echo "$as_me:13726: checking for ncurses version" >&5
 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
 if test "${cf_cv_ncurses_version+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13544,10 +13749,10 @@
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo "$as_me:13547: \"$cf_try\"") >&5
+	{ (eval echo "$as_me:13752: \"$cf_try\"") >&5
   (eval $cf_try) 2>&5
   ac_status=$?
-  echo "$as_me:13550: \$? = $ac_status" >&5
+  echo "$as_me:13755: \$? = $ac_status" >&5
   (exit $ac_status); }
 	if test -f conftest.out ; then
 		cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
@@ -13557,7 +13762,7 @@
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13560 "configure"
+#line 13765 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -13582,15 +13787,15 @@
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:13585: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13790: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13588: \$? = $ac_status" >&5
+  echo "$as_me:13793: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:13590: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13795: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13593: \$? = $ac_status" >&5
+  echo "$as_me:13798: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -13604,7 +13809,7 @@
 	rm -f $cf_tempfile
 
 fi
-echo "$as_me:13607: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:13812: result: $cf_cv_ncurses_version" >&5
 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
 #define NCURSES 1
@@ -13616,7 +13821,7 @@
 	# to link gpm.
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
-echo "$as_me:13619: checking for Gpm_Open in -lgpm" >&5
+echo "$as_me:13824: checking for Gpm_Open in -lgpm" >&5
 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13624,7 +13829,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 13627 "configure"
+#line 13832 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -13643,16 +13848,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13646: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13851: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13649: \$? = $ac_status" >&5
+  echo "$as_me:13854: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13652: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13857: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13655: \$? = $ac_status" >&5
+  echo "$as_me:13860: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_Gpm_Open=yes
 else
@@ -13663,10 +13868,10 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:13666: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:13871: result: $ac_cv_lib_gpm_Gpm_Open" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
-  echo "$as_me:13669: checking for initscr in -lgpm" >&5
+  echo "$as_me:13874: checking for initscr in -lgpm" >&5
 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13674,7 +13879,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 13677 "configure"
+#line 13882 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -13693,16 +13898,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13696: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13901: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13699: \$? = $ac_status" >&5
+  echo "$as_me:13904: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13702: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13907: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13705: \$? = $ac_status" >&5
+  echo "$as_me:13910: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_initscr=yes
 else
@@ -13713,7 +13918,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:13716: result: $ac_cv_lib_gpm_initscr" >&5
+echo "$as_me:13921: result: $ac_cv_lib_gpm_initscr" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
 if test $ac_cv_lib_gpm_initscr = yes; then
   LIBS="$cf_ncurses_SAVE"
@@ -13728,7 +13933,7 @@
 	# This is only necessary if you are linking against an obsolete
 	# version of ncurses (but it should do no harm, since it's static).
 	if test "$cf_nculib_root" = ncurses ; then
-		echo "$as_me:13731: checking for tgoto in -lmytinfo" >&5
+		echo "$as_me:13936: checking for tgoto in -lmytinfo" >&5
 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13736,7 +13941,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 13739 "configure"
+#line 13944 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -13755,16 +13960,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13758: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13963: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13761: \$? = $ac_status" >&5
+  echo "$as_me:13966: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13764: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13969: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13767: \$? = $ac_status" >&5
+  echo "$as_me:13972: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_mytinfo_tgoto=yes
 else
@@ -13775,7 +13980,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:13778: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:13983: result: $ac_cv_lib_mytinfo_tgoto" >&5
 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
 if test $ac_cv_lib_mytinfo_tgoto = yes; then
   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
@@ -13794,13 +13999,13 @@
 
 	eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
 	cf_libdir=""
-	echo "$as_me:13797: checking for initscr" >&5
+	echo "$as_me:14002: checking for initscr" >&5
 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
 if test "${ac_cv_func_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13803 "configure"
+#line 14008 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr (); below.  */
@@ -13831,16 +14036,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13834: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14039: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13837: \$? = $ac_status" >&5
+  echo "$as_me:14042: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13840: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14045: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13843: \$? = $ac_status" >&5
+  echo "$as_me:14048: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_initscr=yes
 else
@@ -13850,18 +14055,18 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:13853: result: $ac_cv_func_initscr" >&5
+echo "$as_me:14058: result: $ac_cv_func_initscr" >&5
 echo "${ECHO_T}$ac_cv_func_initscr" >&6
 if test $ac_cv_func_initscr = yes; then
   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 else
 
 		cf_save_LIBS="$LIBS"
-		echo "$as_me:13860: checking for initscr in -l$cf_nculib_root" >&5
+		echo "$as_me:14065: checking for initscr in -l$cf_nculib_root" >&5
 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
 		LIBS="-l$cf_nculib_root $LIBS"
 		cat >conftest.$ac_ext <<_ACEOF
-#line 13864 "configure"
+#line 14069 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int
@@ -13873,25 +14078,25 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13876: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14081: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13879: \$? = $ac_status" >&5
+  echo "$as_me:14084: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13882: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14087: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13885: \$? = $ac_status" >&5
+  echo "$as_me:14090: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:13887: result: yes" >&5
+  echo "$as_me:14092: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 			 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:13894: result: no" >&5
+echo "$as_me:14099: result: no" >&5
 echo "${ECHO_T}no" >&6
 			cf_search=""
 
@@ -13951,11 +14156,11 @@
 
 			for cf_libdir in $cf_search
 			do
-				echo "$as_me:13954: checking for -l$cf_nculib_root in $cf_libdir" >&5
+				echo "$as_me:14159: checking for -l$cf_nculib_root in $cf_libdir" >&5
 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
 				LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
 				cat >conftest.$ac_ext <<_ACEOF
-#line 13958 "configure"
+#line 14163 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int
@@ -13967,25 +14172,25 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13970: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14175: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13973: \$? = $ac_status" >&5
+  echo "$as_me:14178: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13976: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14181: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13979: \$? = $ac_status" >&5
+  echo "$as_me:14184: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:13981: result: yes" >&5
+  echo "$as_me:14186: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 			 		 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 					 break
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:13988: result: no" >&5
+echo "$as_me:14193: result: no" >&5
 echo "${ECHO_T}no" >&6
 					 LIBS="$cf_save_LIBS"
 fi
@@ -14000,7 +14205,7 @@
 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
 
 if test $cf_found_library = no ; then
-	{ { echo "$as_me:14003: error: Cannot link $cf_nculib_root library" >&5
+	{ { echo "$as_me:14208: error: Cannot link $cf_nculib_root library" >&5
 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -14008,7 +14213,7 @@
 fi
 
 if test -n "$cf_ncurses_LIBS" ; then
-	echo "$as_me:14011: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+	echo "$as_me:14216: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
 	cf_ncurses_SAVE="$LIBS"
 	for p in $cf_ncurses_LIBS ; do
@@ -14018,7 +14223,7 @@
 		fi
 	done
 	cat >conftest.$ac_ext <<_ACEOF
-#line 14021 "configure"
+#line 14226 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header-curses.h}>
 int
@@ -14030,23 +14235,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14033: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14238: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14036: \$? = $ac_status" >&5
+  echo "$as_me:14241: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14039: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14244: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14042: \$? = $ac_status" >&5
+  echo "$as_me:14247: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:14044: result: yes" >&5
+  echo "$as_me:14249: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:14049: result: no" >&5
+echo "$as_me:14254: result: no" >&5
 echo "${ECHO_T}no" >&6
 		 LIBS="$cf_ncurses_SAVE"
 fi
@@ -14059,6 +14264,8 @@
 #define $cf_nculib_ROOT 1
 EOF
 
+fi
+
 	cf_cv_termlib=terminfo
 	;;
 esac
@@ -14072,10 +14279,10 @@
 	LIBS="-l$cf_lib $cf_save_LIBS"
 	for cf_func in tigetstr tgetstr
 	do
-		echo "$as_me:14075: checking for $cf_func in -l$cf_lib" >&5
+		echo "$as_me:14282: checking for $cf_func in -l$cf_lib" >&5
 echo $ECHO_N "checking for $cf_func in -l$cf_lib... $ECHO_C" >&6
 		cat >conftest.$ac_ext <<_ACEOF
-#line 14078 "configure"
+#line 14285 "configure"
 #include "confdefs.h"
 
 int
@@ -14087,16 +14294,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14090: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14297: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14093: \$? = $ac_status" >&5
+  echo "$as_me:14300: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14096: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14303: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14099: \$? = $ac_status" >&5
+  echo "$as_me:14306: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -14105,7 +14312,7 @@
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-		echo "$as_me:14108: result: $cf_result" >&5
+		echo "$as_me:14315: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 		if test "$cf_result" = yes ; then
 			if test "$cf_func" = tigetstr ; then
@@ -14122,7 +14329,7 @@
 fi
 if test "$cf_cv_termlib" = none; then
 	# allow curses library for broken AIX system.
-	echo "$as_me:14125: checking for initscr in -lcurses" >&5
+	echo "$as_me:14332: checking for initscr in -lcurses" >&5
 echo $ECHO_N "checking for initscr in -lcurses... $ECHO_C" >&6
 if test "${ac_cv_lib_curses_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14130,7 +14337,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcurses  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 14133 "configure"
+#line 14340 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -14149,16 +14356,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14152: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14359: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14155: \$? = $ac_status" >&5
+  echo "$as_me:14362: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14158: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14365: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14161: \$? = $ac_status" >&5
+  echo "$as_me:14368: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_curses_initscr=yes
 else
@@ -14169,13 +14376,13 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:14172: result: $ac_cv_lib_curses_initscr" >&5
+echo "$as_me:14379: result: $ac_cv_lib_curses_initscr" >&5
 echo "${ECHO_T}$ac_cv_lib_curses_initscr" >&6
 if test $ac_cv_lib_curses_initscr = yes; then
   LIBS="$LIBS -lcurses" cf_cv_termlib=termcap
 fi
 
-	echo "$as_me:14178: checking for tgoto in -ltermcap" >&5
+	echo "$as_me:14385: checking for tgoto in -ltermcap" >&5
 echo $ECHO_N "checking for tgoto in -ltermcap... $ECHO_C" >&6
 if test "${ac_cv_lib_termcap_tgoto+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14183,7 +14390,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ltermcap  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 14186 "configure"
+#line 14393 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -14202,16 +14409,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14205: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14412: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14208: \$? = $ac_status" >&5
+  echo "$as_me:14415: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14211: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14418: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14214: \$? = $ac_status" >&5
+  echo "$as_me:14421: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_termcap_tgoto=yes
 else
@@ -14222,7 +14429,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:14225: result: $ac_cv_lib_termcap_tgoto" >&5
+echo "$as_me:14432: result: $ac_cv_lib_termcap_tgoto" >&5
 echo "${ECHO_T}$ac_cv_lib_termcap_tgoto" >&6
 if test $ac_cv_lib_termcap_tgoto = yes; then
   LIBS="$LIBS -ltermcap" cf_cv_termlib=termcap
@@ -14233,7 +14440,7 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 if test "$cf_cv_termlib" = none; then
-	{ echo "$as_me:14236: WARNING: Cannot find -ltermlib, -lcurses, or -ltermcap" >&5
+	{ echo "$as_me:14443: WARNING: Cannot find -ltermlib, -lcurses, or -ltermcap" >&5
 echo "$as_me: WARNING: Cannot find -ltermlib, -lcurses, or -ltermcap" >&2;}
 fi
 
@@ -14263,7 +14470,7 @@
 
 cf_cv_termlib=none
 cat >conftest.$ac_ext <<_ACEOF
-#line 14266 "configure"
+#line 14473 "configure"
 #include "confdefs.h"
 
 int
@@ -14275,19 +14482,19 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14278: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14485: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14281: \$? = $ac_status" >&5
+  echo "$as_me:14488: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14284: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14491: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14287: \$? = $ac_status" >&5
+  echo "$as_me:14494: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cat >conftest.$ac_ext <<_ACEOF
-#line 14290 "configure"
+#line 14497 "configure"
 #include "confdefs.h"
 
 int
@@ -14299,16 +14506,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14302: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14509: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14305: \$? = $ac_status" >&5
+  echo "$as_me:14512: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14308: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14515: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14311: \$? = $ac_status" >&5
+  echo "$as_me:14518: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_termlib=terminfo
 else
@@ -14332,10 +14539,10 @@
 	LIBS="-l$cf_lib $cf_save_LIBS"
 	for cf_func in tigetstr tgetstr
 	do
-		echo "$as_me:14335: checking for $cf_func in -l$cf_lib" >&5
+		echo "$as_me:14542: checking for $cf_func in -l$cf_lib" >&5
 echo $ECHO_N "checking for $cf_func in -l$cf_lib... $ECHO_C" >&6
 		cat >conftest.$ac_ext <<_ACEOF
-#line 14338 "configure"
+#line 14545 "configure"
 #include "confdefs.h"
 
 int
@@ -14347,16 +14554,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14350: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14557: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14353: \$? = $ac_status" >&5
+  echo "$as_me:14560: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14356: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14563: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14359: \$? = $ac_status" >&5
+  echo "$as_me:14566: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -14365,7 +14572,7 @@
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-		echo "$as_me:14368: result: $cf_result" >&5
+		echo "$as_me:14575: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 		if test "$cf_result" = yes ; then
 			if test "$cf_func" = tigetstr ; then
@@ -14382,7 +14589,7 @@
 fi
 if test "$cf_cv_termlib" = none; then
 	# allow curses library for broken AIX system.
-	echo "$as_me:14385: checking for initscr in -lcurses" >&5
+	echo "$as_me:14592: checking for initscr in -lcurses" >&5
 echo $ECHO_N "checking for initscr in -lcurses... $ECHO_C" >&6
 if test "${ac_cv_lib_curses_initscr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14390,7 +14597,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcurses  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 14393 "configure"
+#line 14600 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -14409,16 +14616,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14412: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14619: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14415: \$? = $ac_status" >&5
+  echo "$as_me:14622: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14418: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14625: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14421: \$? = $ac_status" >&5
+  echo "$as_me:14628: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_curses_initscr=yes
 else
@@ -14429,13 +14636,13 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:14432: result: $ac_cv_lib_curses_initscr" >&5
+echo "$as_me:14639: result: $ac_cv_lib_curses_initscr" >&5
 echo "${ECHO_T}$ac_cv_lib_curses_initscr" >&6
 if test $ac_cv_lib_curses_initscr = yes; then
   LIBS="$LIBS -lcurses" cf_cv_termlib=termcap
 fi
 
-	echo "$as_me:14438: checking for tgoto in -ltermcap" >&5
+	echo "$as_me:14645: checking for tgoto in -ltermcap" >&5
 echo $ECHO_N "checking for tgoto in -ltermcap... $ECHO_C" >&6
 if test "${ac_cv_lib_termcap_tgoto+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14443,7 +14650,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ltermcap  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 14446 "configure"
+#line 14653 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -14462,16 +14669,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14465: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14672: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14468: \$? = $ac_status" >&5
+  echo "$as_me:14675: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14471: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14678: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14474: \$? = $ac_status" >&5
+  echo "$as_me:14681: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_termcap_tgoto=yes
 else
@@ -14482,7 +14689,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:14485: result: $ac_cv_lib_termcap_tgoto" >&5
+echo "$as_me:14692: result: $ac_cv_lib_termcap_tgoto" >&5
 echo "${ECHO_T}$ac_cv_lib_termcap_tgoto" >&6
 if test $ac_cv_lib_termcap_tgoto = yes; then
   LIBS="$LIBS -ltermcap" cf_cv_termlib=termcap
@@ -14493,7 +14700,7 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 if test "$cf_cv_termlib" = none; then
-	{ echo "$as_me:14496: WARNING: Cannot find -ltermlib, -lcurses, or -ltermcap" >&5
+	{ echo "$as_me:14703: WARNING: Cannot find -ltermlib, -lcurses, or -ltermcap" >&5
 echo "$as_me: WARNING: Cannot find -ltermlib, -lcurses, or -ltermcap" >&2;}
 fi
 
@@ -14515,7 +14722,7 @@
 elif test ".$cf_cv_termlib" = .termcap ; then
 	# BSD 'tputs()' may need 'PC' to be set.
 	cat >conftest.$ac_ext <<_ACEOF
-#line 14518 "configure"
+#line 14725 "configure"
 #include "confdefs.h"
 
 int
@@ -14527,16 +14734,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14530: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14737: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14533: \$? = $ac_status" >&5
+  echo "$as_me:14740: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14536: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14743: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14539: \$? = $ac_status" >&5
+  echo "$as_me:14746: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cat >>confdefs.h <<\EOF
 #define HAVE_EXTERN_TCAP_PC 1
@@ -14555,14 +14762,14 @@
 
 LIBS="$LIBS $X_EXTRA_LIBS"
 
-echo "$as_me:14558: checking for /dev/tty" >&5
+echo "$as_me:14765: checking for /dev/tty" >&5
 echo $ECHO_N "checking for /dev/tty... $ECHO_C" >&6
 if test -c /dev/tty ; then
 	cf_result=yes
 else
 	cf_result=no
 fi
-echo "$as_me:14565: result: $cf_result" >&5
+echo "$as_me:14772: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 if test "$cf_result" = yes ; then
 	cf_result=`echo /dev/tty | sed -e s%/%_%g`
@@ -14575,7 +14782,7 @@
 
 fi
 
-echo "$as_me:14578: checking for crypt function" >&5
+echo "$as_me:14785: checking for crypt function" >&5
 echo $ECHO_N "checking for crypt function... $ECHO_C" >&6
 if test "${cf_cv_crypt_func+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14583,7 +14790,7 @@
 
 cf_cv_crypt_func=
 cat >conftest.$ac_ext <<_ACEOF
-#line 14586 "configure"
+#line 14793 "configure"
 #include "confdefs.h"
 
 int
@@ -14595,16 +14802,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14598: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14805: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14601: \$? = $ac_status" >&5
+  echo "$as_me:14808: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14604: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14811: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14607: \$? = $ac_status" >&5
+  echo "$as_me:14814: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_crypt_func=yes
@@ -14615,7 +14822,7 @@
 	cf_save_LIBS="$LIBS"
 	LIBS="-lcrypt $LIBS"
 	cat >conftest.$ac_ext <<_ACEOF
-#line 14618 "configure"
+#line 14825 "configure"
 #include "confdefs.h"
 
 int
@@ -14627,16 +14834,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14630: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14837: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14633: \$? = $ac_status" >&5
+  echo "$as_me:14840: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14636: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14843: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14639: \$? = $ac_status" >&5
+  echo "$as_me:14846: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 		cf_cv_crypt_func="-lcrypt"
@@ -14653,12 +14860,12 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:14656: result: $cf_cv_crypt_func" >&5
+echo "$as_me:14863: result: $cf_cv_crypt_func" >&5
 echo "${ECHO_T}$cf_cv_crypt_func" >&6
 if test "$cf_cv_crypt_func" != no ; then
 	cf_save_LIBS="$LIBS"
 	test "$cf_cv_crypt_func" != yes && LIBS="$cf_cv_crypt_func $LIBS"
-echo "$as_me:14661: checking if crypt works" >&5
+echo "$as_me:14868: checking if crypt works" >&5
 echo $ECHO_N "checking if crypt works... $ECHO_C" >&6
 if test "${cf_cv_crypt_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14669,7 +14876,7 @@
 	cf_cv_crypt_works=unknown
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 14672 "configure"
+#line 14879 "configure"
 #include "confdefs.h"
 
 #include <string.h>
@@ -14681,15 +14888,15 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:14684: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14891: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14687: \$? = $ac_status" >&5
+  echo "$as_me:14894: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:14689: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14896: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14692: \$? = $ac_status" >&5
+  echo "$as_me:14899: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_crypt_works=yes
@@ -14704,7 +14911,7 @@
 fi
 	LIBS="$cf_save_LIBS"
 fi
-echo "$as_me:14707: result: $cf_cv_crypt_works" >&5
+echo "$as_me:14914: result: $cf_cv_crypt_works" >&5
 echo "${ECHO_T}$cf_cv_crypt_works" >&6
 	if test "$cf_cv_crypt_works" != no ; then
 		cat >>confdefs.h <<\EOF
@@ -14717,14 +14924,14 @@
 	fi
 fi
 
-echo "$as_me:14720: checking for declaration of fd_set" >&5
+echo "$as_me:14927: checking for declaration of fd_set" >&5
 echo $ECHO_N "checking for declaration of fd_set... $ECHO_C" >&6
 if test "${cf_cv_type_fd_set+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   echo "trying sys/types alone" 1>&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 14727 "configure"
+#line 14934 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -14737,16 +14944,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14740: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14947: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14743: \$? = $ac_status" >&5
+  echo "$as_me:14950: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14746: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14953: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14749: \$? = $ac_status" >&5
+  echo "$as_me:14956: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_type_fd_set=sys/types.h
 else
@@ -14754,7 +14961,7 @@
 cat conftest.$ac_ext >&5
 echo "trying X11/Xpoll.h" 1>&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 14757 "configure"
+#line 14964 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_X11_XPOLL_H
@@ -14769,16 +14976,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14772: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14979: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14775: \$? = $ac_status" >&5
+  echo "$as_me:14982: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14778: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14985: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14781: \$? = $ac_status" >&5
+  echo "$as_me:14988: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_type_fd_set=X11/Xpoll.h
 else
@@ -14786,7 +14993,7 @@
 cat conftest.$ac_ext >&5
 echo "trying sys/select.h" 1>&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 14789 "configure"
+#line 14996 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -14800,16 +15007,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14803: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15010: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14806: \$? = $ac_status" >&5
+  echo "$as_me:15013: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14809: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15016: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14812: \$? = $ac_status" >&5
+  echo "$as_me:15019: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_type_fd_set=sys/select.h
 else
@@ -14823,7 +15030,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:14826: result: $cf_cv_type_fd_set" >&5
+echo "$as_me:15033: result: $cf_cv_type_fd_set" >&5
 echo "${ECHO_T}$cf_cv_type_fd_set" >&6
 if test $cf_cv_type_fd_set = sys/select.h ; then
 	cat >>confdefs.h <<\EOF
@@ -14832,14 +15039,14 @@
 
 fi
 
-echo "$as_me:14835: checking for fd_set macros" >&5
+echo "$as_me:15042: checking for fd_set macros" >&5
 echo $ECHO_N "checking for fd_set macros... $ECHO_C" >&6
 if test "${cf_cv_macros_fd_set+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 14842 "configure"
+#line 15049 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -14868,16 +15075,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14871: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15078: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14874: \$? = $ac_status" >&5
+  echo "$as_me:15081: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14877: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15084: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14880: \$? = $ac_status" >&5
+  echo "$as_me:15087: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_macros_fd_set=yes
 else
@@ -14887,7 +15094,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:14890: result: $cf_cv_macros_fd_set" >&5
+echo "$as_me:15097: result: $cf_cv_macros_fd_set" >&5
 echo "${ECHO_T}$cf_cv_macros_fd_set" >&6
 test $cf_cv_macros_fd_set = yes && cat >>confdefs.h <<\EOF
 #define HAVE_TYPE_FD_SET 1
@@ -14934,13 +15141,13 @@
 
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:14937: checking for $ac_func" >&5
+echo "$as_me:15144: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 14943 "configure"
+#line 15150 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -14971,16 +15178,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14974: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15181: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14977: \$? = $ac_status" >&5
+  echo "$as_me:15184: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14980: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15187: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14983: \$? = $ac_status" >&5
+  echo "$as_me:15190: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -14990,7 +15197,7 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:14993: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:15200: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -15000,14 +15207,14 @@
 fi
 done
 
-echo "$as_me:15003: checking for standard qsort" >&5
+echo "$as_me:15210: checking for standard qsort" >&5
 echo $ECHO_N "checking for standard qsort... $ECHO_C" >&6
 if test "${cf_cv_ansi_qsort+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 15010 "configure"
+#line 15217 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_STDLIB_H
@@ -15025,16 +15232,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15028: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15235: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15031: \$? = $ac_status" >&5
+  echo "$as_me:15238: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15034: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15241: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15037: \$? = $ac_status" >&5
+  echo "$as_me:15244: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ansi_qsort=yes
 else
@@ -15045,7 +15252,7 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:15048: result: $cf_cv_ansi_qsort" >&5
+echo "$as_me:15255: result: $cf_cv_ansi_qsort" >&5
 echo "${ECHO_T}$cf_cv_ansi_qsort" >&6
 
 if test $cf_cv_ansi_qsort = yes; then
@@ -15060,7 +15267,7 @@
 
 fi
 
-echo "$as_me:15063: checking for working mkstemp" >&5
+echo "$as_me:15270: checking for working mkstemp" >&5
 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
 if test "${cf_cv_func_mkstemp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15068,13 +15275,13 @@
 
 rm -f conftest*
 if test "$cross_compiling" = yes; then
-  echo "$as_me:15071: checking for mkstemp" >&5
+  echo "$as_me:15278: checking for mkstemp" >&5
 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
 if test "${ac_cv_func_mkstemp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 15077 "configure"
+#line 15284 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char mkstemp (); below.  */
@@ -15105,16 +15312,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15108: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15315: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15111: \$? = $ac_status" >&5
+  echo "$as_me:15318: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15114: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15321: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15117: \$? = $ac_status" >&5
+  echo "$as_me:15324: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_mkstemp=yes
 else
@@ -15124,12 +15331,12 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:15127: result: $ac_cv_func_mkstemp" >&5
+echo "$as_me:15334: result: $ac_cv_func_mkstemp" >&5
 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 15132 "configure"
+#line 15339 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -15167,15 +15374,15 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:15170: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15377: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15173: \$? = $ac_status" >&5
+  echo "$as_me:15380: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:15175: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15382: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15178: \$? = $ac_status" >&5
+  echo "$as_me:15385: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_func_mkstemp=yes
 
@@ -15190,7 +15397,7 @@
 fi
 
 fi
-echo "$as_me:15193: result: $cf_cv_func_mkstemp" >&5
+echo "$as_me:15400: result: $cf_cv_func_mkstemp" >&5
 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
 if test "$cf_cv_func_mkstemp" = yes ; then
 	cat >>confdefs.h <<\EOF
@@ -15208,7 +15415,7 @@
 cf_save_cppflags="${CPPFLAGS}"
 cf_save_ldflags="${LDFLAGS}"
 
-echo "$as_me:15211: checking if you want to use the Xpm library for colored icon" >&5
+echo "$as_me:15418: checking if you want to use the Xpm library for colored icon" >&5
 echo $ECHO_N "checking if you want to use the Xpm library for colored icon... $ECHO_C" >&6
 
 # Check whether --with-xpm or --without-xpm was given.
@@ -15218,7 +15425,7 @@
 else
   cf_Xpm_library=no
 fi;
-echo "$as_me:15221: result: $cf_Xpm_library" >&5
+echo "$as_me:15428: result: $cf_Xpm_library" >&5
 echo "${ECHO_T}$cf_Xpm_library" >&6
 
 if test "$cf_Xpm_library" != no ; then
@@ -15226,23 +15433,23 @@
 	CPPFLAGS="$CPPFLAGS -I$withval/include"
 	LDFLAGS="$LDFLAGS -L$withval/lib"
     fi
-    echo "$as_me:15229: checking for X11/xpm.h" >&5
+    echo "$as_me:15436: checking for X11/xpm.h" >&5
 echo $ECHO_N "checking for X11/xpm.h... $ECHO_C" >&6
 if test "${ac_cv_header_X11_xpm_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 15235 "configure"
+#line 15442 "configure"
 #include "confdefs.h"
 #include <X11/xpm.h>
 _ACEOF
-if { (eval echo "$as_me:15239: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:15446: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:15245: \$? = $ac_status" >&5
+  echo "$as_me:15452: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -15261,11 +15468,11 @@
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:15264: result: $ac_cv_header_X11_xpm_h" >&5
+echo "$as_me:15471: result: $ac_cv_header_X11_xpm_h" >&5
 echo "${ECHO_T}$ac_cv_header_X11_xpm_h" >&6
 if test $ac_cv_header_X11_xpm_h = yes; then
 
-	echo "$as_me:15268: checking for XpmCreatePixmapFromData in -lXpm" >&5
+	echo "$as_me:15475: checking for XpmCreatePixmapFromData in -lXpm" >&5
 echo $ECHO_N "checking for XpmCreatePixmapFromData in -lXpm... $ECHO_C" >&6
 if test "${ac_cv_lib_Xpm_XpmCreatePixmapFromData+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15273,7 +15480,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXpm -lX11 $X_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 15276 "configure"
+#line 15483 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -15292,16 +15499,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15295: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15502: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15298: \$? = $ac_status" >&5
+  echo "$as_me:15505: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15301: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15508: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15304: \$? = $ac_status" >&5
+  echo "$as_me:15511: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_Xpm_XpmCreatePixmapFromData=yes
 else
@@ -15312,7 +15519,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:15315: result: $ac_cv_lib_Xpm_XpmCreatePixmapFromData" >&5
+echo "$as_me:15522: result: $ac_cv_lib_Xpm_XpmCreatePixmapFromData" >&5
 echo "${ECHO_T}$ac_cv_lib_Xpm_XpmCreatePixmapFromData" >&6
 if test $ac_cv_lib_Xpm_XpmCreatePixmapFromData = yes; then
 
@@ -15333,7 +15540,7 @@
 fi
 
 if test -n "$cf_x_athena" ; then
-    echo "$as_me:15336: checking if you want to use Xaw scrollbars rather than our own" >&5
+    echo "$as_me:15543: checking if you want to use Xaw scrollbars rather than our own" >&5
 echo $ECHO_N "checking if you want to use Xaw scrollbars rather than our own... $ECHO_C" >&6
 
 # Check whether --with-Xaw-scrollbars or --without-Xaw-scrollbars was given.
@@ -15343,7 +15550,7 @@
 else
   cf_Xaw_scrollbars=no
 fi;
-    echo "$as_me:15346: result: $cf_Xaw_scrollbars" >&5
+    echo "$as_me:15553: result: $cf_Xaw_scrollbars" >&5
 echo "${ECHO_T}$cf_Xaw_scrollbars" >&6
 
     if test "$cf_Xaw_scrollbars" = no ; then
@@ -15360,7 +15567,7 @@
 #define OPT_XAW_SCROLLBARS 1
 EOF
 
-	echo "$as_me:15363: checking if you want to use the drag/scrolling extension with Xaw" >&5
+	echo "$as_me:15570: checking if you want to use the drag/scrolling extension with Xaw" >&5
 echo $ECHO_N "checking if you want to use the drag/scrolling extension with Xaw... $ECHO_C" >&6
 
 # Check whether --with-drag-extension or --without-drag-extension was given.
@@ -15370,7 +15577,7 @@
 else
   cf_drag_extension=no
 fi;
-	echo "$as_me:15373: result: $cf_drag_extension" >&5
+	echo "$as_me:15580: result: $cf_drag_extension" >&5
 echo "${ECHO_T}$cf_drag_extension" >&6
 	if test "$cf_drag_extension" != "no" ; then
 	    cat >>confdefs.h <<\EOF
@@ -15383,7 +15590,7 @@
 
 fi
 
-echo "$as_me:15386: checking if you want to change the number of exec-macros" >&5
+echo "$as_me:15593: checking if you want to change the number of exec-macros" >&5
 echo $ECHO_N "checking if you want to change the number of exec-macros... $ECHO_C" >&6
 
 # Check whether --with-exec-macros or --without-exec-macros was given.
@@ -15393,7 +15600,7 @@
 else
   cf_exec_macros=no
 fi;
-echo "$as_me:15396: result: $cf_exec_macros" >&5
+echo "$as_me:15603: result: $cf_exec_macros" >&5
 echo "${ECHO_T}$cf_exec_macros" >&6
 test "$cf_exec_macros" != no && cat >>confdefs.h <<EOF
 #define OPT_EXEC_MACROS $cf_exec_macros
@@ -15406,7 +15613,7 @@
 fi;
 if test "$enable_largefile" != no; then
 
-  echo "$as_me:15409: checking for special C compiler options needed for large files" >&5
+  echo "$as_me:15616: checking for special C compiler options needed for large files" >&5
 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
 if test "${ac_cv_sys_largefile_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15418,7 +15625,7 @@
      	 # IRIX 6.2 and later do not support large files by default,
      	 # so use the C compiler's -n32 option if that helps.
          cat >conftest.$ac_ext <<_ACEOF
-#line 15421 "configure"
+#line 15628 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
@@ -15438,16 +15645,16 @@
 }
 _ACEOF
      	 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15441: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15648: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15444: \$? = $ac_status" >&5
+  echo "$as_me:15651: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15447: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15654: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15450: \$? = $ac_status" >&5
+  echo "$as_me:15657: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -15457,16 +15664,16 @@
 rm -f conftest.$ac_objext
      	 CC="$CC -n32"
      	 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15460: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15667: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15463: \$? = $ac_status" >&5
+  echo "$as_me:15670: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15466: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15673: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15469: \$? = $ac_status" >&5
+  echo "$as_me:15676: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sys_largefile_CC=' -n32'; break
 else
@@ -15480,13 +15687,13 @@
        rm -f conftest.$ac_ext
     fi
 fi
-echo "$as_me:15483: result: $ac_cv_sys_largefile_CC" >&5
+echo "$as_me:15690: result: $ac_cv_sys_largefile_CC" >&5
 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
   if test "$ac_cv_sys_largefile_CC" != no; then
     CC=$CC$ac_cv_sys_largefile_CC
   fi
 
-  echo "$as_me:15489: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+  echo "$as_me:15696: checking for _FILE_OFFSET_BITS value needed for large files" >&5
 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15494,7 +15701,7 @@
   while :; do
   ac_cv_sys_file_offset_bits=no
   cat >conftest.$ac_ext <<_ACEOF
-#line 15497 "configure"
+#line 15704 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
@@ -15514,16 +15721,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15517: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15724: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15520: \$? = $ac_status" >&5
+  echo "$as_me:15727: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15523: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15730: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15526: \$? = $ac_status" >&5
+  echo "$as_me:15733: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -15532,7 +15739,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line 15535 "configure"
+#line 15742 "configure"
 #include "confdefs.h"
 #define _FILE_OFFSET_BITS 64
 #include <sys/types.h>
@@ -15553,16 +15760,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15556: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15763: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15559: \$? = $ac_status" >&5
+  echo "$as_me:15766: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15562: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15769: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15565: \$? = $ac_status" >&5
+  echo "$as_me:15772: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sys_file_offset_bits=64; break
 else
@@ -15573,7 +15780,7 @@
   break
 done
 fi
-echo "$as_me:15576: result: $ac_cv_sys_file_offset_bits" >&5
+echo "$as_me:15783: result: $ac_cv_sys_file_offset_bits" >&5
 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
 if test "$ac_cv_sys_file_offset_bits" != no; then
 
@@ -15583,7 +15790,7 @@
 
 fi
 rm -f conftest*
-  echo "$as_me:15586: checking for _LARGE_FILES value needed for large files" >&5
+  echo "$as_me:15793: checking for _LARGE_FILES value needed for large files" >&5
 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
 if test "${ac_cv_sys_large_files+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15591,7 +15798,7 @@
   while :; do
   ac_cv_sys_large_files=no
   cat >conftest.$ac_ext <<_ACEOF
-#line 15594 "configure"
+#line 15801 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
@@ -15611,16 +15818,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15614: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15821: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15617: \$? = $ac_status" >&5
+  echo "$as_me:15824: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15620: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15827: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15623: \$? = $ac_status" >&5
+  echo "$as_me:15830: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -15629,7 +15836,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line 15632 "configure"
+#line 15839 "configure"
 #include "confdefs.h"
 #define _LARGE_FILES 1
 #include <sys/types.h>
@@ -15650,16 +15857,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15653: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15860: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15656: \$? = $ac_status" >&5
+  echo "$as_me:15863: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15659: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15866: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15662: \$? = $ac_status" >&5
+  echo "$as_me:15869: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sys_large_files=1; break
 else
@@ -15670,7 +15877,7 @@
   break
 done
 fi
-echo "$as_me:15673: result: $ac_cv_sys_large_files" >&5
+echo "$as_me:15880: result: $ac_cv_sys_large_files" >&5
 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
 if test "$ac_cv_sys_large_files" != no; then
 
@@ -15683,7 +15890,7 @@
 fi
 
     if test "$enable_largefile" != no ; then
-	echo "$as_me:15686: checking for _LARGEFILE_SOURCE value needed for large files" >&5
+	echo "$as_me:15893: checking for _LARGEFILE_SOURCE value needed for large files" >&5
 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
 if test "${ac_cv_sys_largefile_source+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15691,7 +15898,7 @@
   while :; do
   ac_cv_sys_largefile_source=no
   cat >conftest.$ac_ext <<_ACEOF
-#line 15694 "configure"
+#line 15901 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -15703,16 +15910,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15706: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15913: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15709: \$? = $ac_status" >&5
+  echo "$as_me:15916: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15712: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15919: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15715: \$? = $ac_status" >&5
+  echo "$as_me:15922: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -15721,7 +15928,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line 15724 "configure"
+#line 15931 "configure"
 #include "confdefs.h"
 #define _LARGEFILE_SOURCE 1
 #include <stdio.h>
@@ -15734,16 +15941,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15737: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15944: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15740: \$? = $ac_status" >&5
+  echo "$as_me:15947: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15743: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15950: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15746: \$? = $ac_status" >&5
+  echo "$as_me:15953: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sys_largefile_source=1; break
 else
@@ -15754,7 +15961,7 @@
   break
 done
 fi
-echo "$as_me:15757: result: $ac_cv_sys_largefile_source" >&5
+echo "$as_me:15964: result: $ac_cv_sys_largefile_source" >&5
 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
 if test "$ac_cv_sys_largefile_source" != no; then
 
@@ -15768,13 +15975,13 @@
 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
 # in glibc 2.1.3, but that breaks too many other things.
 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
-echo "$as_me:15771: checking for fseeko" >&5
+echo "$as_me:15978: checking for fseeko" >&5
 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
 if test "${ac_cv_func_fseeko+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 15777 "configure"
+#line 15984 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -15786,16 +15993,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15789: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15996: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15792: \$? = $ac_status" >&5
+  echo "$as_me:15999: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15795: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16002: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15798: \$? = $ac_status" >&5
+  echo "$as_me:16005: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_fseeko=yes
 else
@@ -15805,7 +16012,7 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:15808: result: $ac_cv_func_fseeko" >&5
+echo "$as_me:16015: result: $ac_cv_func_fseeko" >&5
 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
 if test $ac_cv_func_fseeko = yes; then
 
@@ -15825,14 +16032,14 @@
 	test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
 	test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
 
-	echo "$as_me:15828: checking whether to use struct dirent64" >&5
+	echo "$as_me:16035: checking whether to use struct dirent64" >&5
 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
 if test "${cf_cv_struct_dirent64+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 15835 "configure"
+#line 16042 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -15853,16 +16060,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15856: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:16063: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15859: \$? = $ac_status" >&5
+  echo "$as_me:16066: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15862: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16069: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15865: \$? = $ac_status" >&5
+  echo "$as_me:16072: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_struct_dirent64=yes
 else
@@ -15873,7 +16080,7 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:15876: result: $cf_cv_struct_dirent64" >&5
+echo "$as_me:16083: result: $cf_cv_struct_dirent64" >&5
 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
 	test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF
 #define HAVE_STRUCT_DIRENT64 1
@@ -15884,14 +16091,14 @@
 # I don't know of a reliable test for working locale, but we can at least check
 # that it is available before offering it as an option.
 
-echo "$as_me:15887: checking for setlocale()" >&5
+echo "$as_me:16094: checking for setlocale()" >&5
 echo $ECHO_N "checking for setlocale()... $ECHO_C" >&6
 if test "${cf_cv_locale+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 15894 "configure"
+#line 16101 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int
@@ -15903,16 +16110,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15906: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16113: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15909: \$? = $ac_status" >&5
+  echo "$as_me:16116: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15912: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16119: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15915: \$? = $ac_status" >&5
+  echo "$as_me:16122: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_locale=yes
 else
@@ -15924,7 +16131,7 @@
 
 fi
 
-echo "$as_me:15927: result: $cf_cv_locale" >&5
+echo "$as_me:16134: result: $cf_cv_locale" >&5
 echo "${ECHO_T}$cf_cv_locale" >&6
 test $cf_cv_locale = yes && { cat >>confdefs.h <<\EOF
 #define LOCALE 1
@@ -15932,7 +16139,7 @@
  }
 
 if test $cf_cv_locale = yes ; then
-echo "$as_me:15935: checking if you want to use i18n locale support" >&5
+echo "$as_me:16142: checking if you want to use i18n locale support" >&5
 echo $ECHO_N "checking if you want to use i18n locale support... $ECHO_C" >&6
 
 # Check whether --with-locale or --without-locale was given.
@@ -15942,7 +16149,7 @@
 else
   cf_locale=yes
 fi;
-echo "$as_me:15945: result: $cf_locale" >&5
+echo "$as_me:16152: result: $cf_locale" >&5
 echo "${ECHO_T}$cf_locale" >&6
 if test "$cf_locale" != no ; then
 	cat >>confdefs.h <<\EOF
@@ -15951,13 +16158,13 @@
 
 	eval 'cf_cv_have_lib_'iconv'=no'
 	cf_libdir=""
-	echo "$as_me:15954: checking for iconv" >&5
+	echo "$as_me:16161: checking for iconv" >&5
 echo $ECHO_N "checking for iconv... $ECHO_C" >&6
 if test "${ac_cv_func_iconv+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 15960 "configure"
+#line 16167 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char iconv (); below.  */
@@ -15988,16 +16195,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15991: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16198: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15994: \$? = $ac_status" >&5
+  echo "$as_me:16201: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:15997: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16204: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16000: \$? = $ac_status" >&5
+  echo "$as_me:16207: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_iconv=yes
 else
@@ -16007,18 +16214,18 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:16010: result: $ac_cv_func_iconv" >&5
+echo "$as_me:16217: result: $ac_cv_func_iconv" >&5
 echo "${ECHO_T}$ac_cv_func_iconv" >&6
 if test $ac_cv_func_iconv = yes; then
   eval 'cf_cv_have_lib_'iconv'=yes'
 else
 
 		cf_save_LIBS="$LIBS"
-		echo "$as_me:16017: checking for iconv in -liconv" >&5
+		echo "$as_me:16224: checking for iconv in -liconv" >&5
 echo $ECHO_N "checking for iconv in -liconv... $ECHO_C" >&6
 		LIBS="-liconv $LIBS"
 		cat >conftest.$ac_ext <<_ACEOF
-#line 16021 "configure"
+#line 16228 "configure"
 #include "confdefs.h"
 #include <iconv.h>
 int
@@ -16030,25 +16237,25 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16033: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16240: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16036: \$? = $ac_status" >&5
+  echo "$as_me:16243: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16039: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16246: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16042: \$? = $ac_status" >&5
+  echo "$as_me:16249: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:16044: result: yes" >&5
+  echo "$as_me:16251: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 			 eval 'cf_cv_have_lib_'iconv'=yes'
 
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:16051: result: no" >&5
+echo "$as_me:16258: result: no" >&5
 echo "${ECHO_T}no" >&6
 			cf_search=""
 
@@ -16108,11 +16315,11 @@
 
 			for cf_libdir in $cf_search
 			do
-				echo "$as_me:16111: checking for -liconv in $cf_libdir" >&5
+				echo "$as_me:16318: checking for -liconv in $cf_libdir" >&5
 echo $ECHO_N "checking for -liconv in $cf_libdir... $ECHO_C" >&6
 				LIBS="-L$cf_libdir -liconv $cf_save_LIBS"
 				cat >conftest.$ac_ext <<_ACEOF
-#line 16115 "configure"
+#line 16322 "configure"
 #include "confdefs.h"
 #include <iconv.h>
 int
@@ -16124,25 +16331,25 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16127: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16334: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16130: \$? = $ac_status" >&5
+  echo "$as_me:16337: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16133: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16340: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16136: \$? = $ac_status" >&5
+  echo "$as_me:16343: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:16138: result: yes" >&5
+  echo "$as_me:16345: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 			 		 eval 'cf_cv_have_lib_'iconv'=yes'
 					 break
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:16145: result: no" >&5
+echo "$as_me:16352: result: no" >&5
 echo "${ECHO_T}no" >&6
 					 LIBS="$cf_save_LIBS"
 fi
@@ -16156,7 +16363,7 @@
 
 eval 'cf_found_library=$cf_cv_have_lib_'iconv
 
-echo "$as_me:16159: checking for iconv function library" >&5
+echo "$as_me:16366: checking for iconv function library" >&5
 echo $ECHO_N "checking for iconv function library... $ECHO_C" >&6
 if test "${cf_cv_func_iconv+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16169,11 +16376,11 @@
 	fi
 
 fi
-echo "$as_me:16172: result: $cf_cv_func_iconv" >&5
+echo "$as_me:16379: result: $cf_cv_func_iconv" >&5
 echo "${ECHO_T}$cf_cv_func_iconv" >&6
 
 if test "$cf_cv_func_iconv" != no ; then
-echo "$as_me:16176: checking if you want to use iconv() for locale support" >&5
+echo "$as_me:16383: checking if you want to use iconv() for locale support" >&5
 echo $ECHO_N "checking if you want to use iconv() for locale support... $ECHO_C" >&6
 
 # Check whether --with-iconv or --without-iconv was given.
@@ -16183,7 +16390,7 @@
 else
   cf_func_iconv=yes
 fi;
-echo "$as_me:16186: result: $cf_func_iconv" >&5
+echo "$as_me:16393: result: $cf_func_iconv" >&5
 echo "${ECHO_T}$cf_func_iconv" >&6
 if test "$cf_func_iconv" = yes ; then
 	cat >>confdefs.h <<\EOF
@@ -16198,7 +16405,7 @@
 
 ###	Debugging/development options
 
-echo "$as_me:16201: checking if you want to link with dbmalloc for testing" >&5
+echo "$as_me:16408: checking if you want to link with dbmalloc for testing" >&5
 echo $ECHO_N "checking if you want to link with dbmalloc for testing... $ECHO_C" >&6
 
 # Check whether --with-dbmalloc or --without-dbmalloc was given.
@@ -16208,26 +16415,26 @@
 else
   with_dbmalloc=no
 fi;
-echo "$as_me:16211: result: $with_dbmalloc" >&5
+echo "$as_me:16418: result: $with_dbmalloc" >&5
 echo "${ECHO_T}$with_dbmalloc" >&6
 if test "$with_dbmalloc" = yes ; then
-	echo "$as_me:16214: checking for dbmalloc.h" >&5
+	echo "$as_me:16421: checking for dbmalloc.h" >&5
 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 16220 "configure"
+#line 16427 "configure"
 #include "confdefs.h"
 #include <dbmalloc.h>
 _ACEOF
-if { (eval echo "$as_me:16224: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:16431: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:16230: \$? = $ac_status" >&5
+  echo "$as_me:16437: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -16246,11 +16453,11 @@
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:16249: result: $ac_cv_header_dbmalloc_h" >&5
+echo "$as_me:16456: result: $ac_cv_header_dbmalloc_h" >&5
 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
 if test $ac_cv_header_dbmalloc_h = yes; then
 
-echo "$as_me:16253: checking for debug_malloc in -ldbmalloc" >&5
+echo "$as_me:16460: checking for debug_malloc in -ldbmalloc" >&5
 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16258,7 +16465,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldbmalloc  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 16261 "configure"
+#line 16468 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -16277,16 +16484,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16280: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16487: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16283: \$? = $ac_status" >&5
+  echo "$as_me:16490: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16286: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16493: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16289: \$? = $ac_status" >&5
+  echo "$as_me:16496: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dbmalloc_debug_malloc=yes
 else
@@ -16297,7 +16504,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:16300: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
+echo "$as_me:16507: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
   cat >>confdefs.h <<EOF
@@ -16312,7 +16519,7 @@
 
 fi
 
-echo "$as_me:16315: checking if you want to link with dmalloc for testing" >&5
+echo "$as_me:16522: checking if you want to link with dmalloc for testing" >&5
 echo $ECHO_N "checking if you want to link with dmalloc for testing... $ECHO_C" >&6
 
 # Check whether --with-dmalloc or --without-dmalloc was given.
@@ -16322,26 +16529,26 @@
 else
   with_dmalloc=no
 fi;
-echo "$as_me:16325: result: $with_dmalloc" >&5
+echo "$as_me:16532: result: $with_dmalloc" >&5
 echo "${ECHO_T}$with_dmalloc" >&6
 if test "$with_dmalloc" = yes ; then
-	echo "$as_me:16328: checking for dmalloc.h" >&5
+	echo "$as_me:16535: checking for dmalloc.h" >&5
 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
 if test "${ac_cv_header_dmalloc_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 16334 "configure"
+#line 16541 "configure"
 #include "confdefs.h"
 #include <dmalloc.h>
 _ACEOF
-if { (eval echo "$as_me:16338: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:16545: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:16344: \$? = $ac_status" >&5
+  echo "$as_me:16551: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -16360,11 +16567,11 @@
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:16363: result: $ac_cv_header_dmalloc_h" >&5
+echo "$as_me:16570: result: $ac_cv_header_dmalloc_h" >&5
 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
 if test $ac_cv_header_dmalloc_h = yes; then
 
-echo "$as_me:16367: checking for dmalloc_debug in -ldmalloc" >&5
+echo "$as_me:16574: checking for dmalloc_debug in -ldmalloc" >&5
 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16372,7 +16579,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldmalloc  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 16375 "configure"
+#line 16582 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -16391,16 +16598,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16394: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16601: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16397: \$? = $ac_status" >&5
+  echo "$as_me:16604: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16400: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16607: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16403: \$? = $ac_status" >&5
+  echo "$as_me:16610: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dmalloc_dmalloc_debug=yes
 else
@@ -16411,7 +16618,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:16414: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
+echo "$as_me:16621: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
   cat >>confdefs.h <<EOF
@@ -16485,17 +16692,17 @@
 
 GCC_VERSION=none
 if test "$GCC" = yes ; then
-	echo "$as_me:16488: checking version of $CC" >&5
+	echo "$as_me:16695: checking version of $CC" >&5
 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
 	GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
 	test -z "$GCC_VERSION" && GCC_VERSION=unknown
-	echo "$as_me:16492: result: $GCC_VERSION" >&5
+	echo "$as_me:16699: result: $GCC_VERSION" >&5
 echo "${ECHO_T}$GCC_VERSION" >&6
 fi
 
 if ( test "$GCC" = yes || test "$GXX" = yes )
 then
-echo "$as_me:16498: checking if you want to check for gcc warnings" >&5
+echo "$as_me:16705: checking if you want to check for gcc warnings" >&5
 echo $ECHO_N "checking if you want to check for gcc warnings... $ECHO_C" >&6
 
 # Check whether --with-warnings or --without-warnings was given.
@@ -16505,7 +16712,7 @@
 else
   cf_opt_with_warnings=no
 fi;
-echo "$as_me:16508: result: $cf_opt_with_warnings" >&5
+echo "$as_me:16715: result: $cf_opt_with_warnings" >&5
 echo "${ECHO_T}$cf_opt_with_warnings" >&6
 if test "$cf_opt_with_warnings" != no ; then
 
@@ -16527,10 +16734,10 @@
 EOF
 if test "$GCC" = yes
 then
-	{ echo "$as_me:16530: checking for $CC __attribute__ directives..." >&5
+	{ echo "$as_me:16737: checking for $CC __attribute__ directives..." >&5
 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
 cat > conftest.$ac_ext <<EOF
-#line 16533 "configure"
+#line 16740 "configure"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
@@ -16568,12 +16775,12 @@
 EOF
 			;;
 		esac
-		if { (eval echo "$as_me:16571: \"$ac_compile\"") >&5
+		if { (eval echo "$as_me:16778: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:16574: \$? = $ac_status" >&5
+  echo "$as_me:16781: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-			test -n "$verbose" && echo "$as_me:16576: result: ... $cf_attribute" >&5
+			test -n "$verbose" && echo "$as_me:16783: result: ... $cf_attribute" >&5
 echo "${ECHO_T}... $cf_attribute" >&6
 			cat conftest.h >>confdefs.h
 		fi
@@ -16589,12 +16796,12 @@
 if test "$GCC" = yes ; then
 	case $host_os in
 	linux*|gnu*)
-		echo "$as_me:16592: checking if this is really Intel C compiler" >&5
+		echo "$as_me:16799: checking if this is really Intel C compiler" >&5
 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
 		cf_save_CFLAGS="$CFLAGS"
 		CFLAGS="$CFLAGS -no-gcc"
 		cat >conftest.$ac_ext <<_ACEOF
-#line 16597 "configure"
+#line 16804 "configure"
 #include "confdefs.h"
 
 int
@@ -16611,16 +16818,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:16614: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:16821: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:16617: \$? = $ac_status" >&5
+  echo "$as_me:16824: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:16620: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16827: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16623: \$? = $ac_status" >&5
+  echo "$as_me:16830: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   INTEL_COMPILER=yes
 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
@@ -16631,14 +16838,14 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 		CFLAGS="$cf_save_CFLAGS"
-		echo "$as_me:16634: result: $INTEL_COMPILER" >&5
+		echo "$as_me:16841: result: $INTEL_COMPILER" >&5
 echo "${ECHO_T}$INTEL_COMPILER" >&6
 		;;
 	esac
 fi
 
 cat > conftest.$ac_ext <<EOF
-#line 16641 "configure"
+#line 16848 "configure"
 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
 EOF
 
@@ -16656,7 +16863,7 @@
 # remark #981: operands are evaluated in unspecified order
 # warning #269: invalid format string conversion
 
-	{ echo "$as_me:16659: checking for $CC warning options..." >&5
+	{ echo "$as_me:16866: checking for $CC warning options..." >&5
 echo "$as_me: checking for $CC warning options..." >&6;}
 	cf_save_CFLAGS="$CFLAGS"
 	EXTRA_CFLAGS="-Wall"
@@ -16673,12 +16880,12 @@
 		wd981
 	do
 		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-		if { (eval echo "$as_me:16676: \"$ac_compile\"") >&5
+		if { (eval echo "$as_me:16883: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:16679: \$? = $ac_status" >&5
+  echo "$as_me:16886: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-			test -n "$verbose" && echo "$as_me:16681: result: ... -$cf_opt" >&5
+			test -n "$verbose" && echo "$as_me:16888: result: ... -$cf_opt" >&5
 echo "${ECHO_T}... -$cf_opt" >&6
 			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
 		fi
@@ -16687,7 +16894,7 @@
 
 elif test "$GCC" = yes
 then
-	{ echo "$as_me:16690: checking for $CC warning options..." >&5
+	{ echo "$as_me:16897: checking for $CC warning options..." >&5
 echo "$as_me: checking for $CC warning options..." >&6;}
 	cf_save_CFLAGS="$CFLAGS"
 	EXTRA_CFLAGS="-W -Wall"
@@ -16707,12 +16914,12 @@
 		Wundef $cf_warn_CONST
 	do
 		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-		if { (eval echo "$as_me:16710: \"$ac_compile\"") >&5
+		if { (eval echo "$as_me:16917: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:16713: \$? = $ac_status" >&5
+  echo "$as_me:16920: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-			test -n "$verbose" && echo "$as_me:16715: result: ... -$cf_opt" >&5
+			test -n "$verbose" && echo "$as_me:16922: result: ... -$cf_opt" >&5
 echo "${ECHO_T}... -$cf_opt" >&6
 			case $cf_opt in #(vi
 			Wcast-qual) #(vi
@@ -16762,7 +16969,7 @@
 
 ac_tr_func=`echo "$ac_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-echo "$as_me:16765: checking for missing \"${ac_func}\" extern" >&5
+echo "$as_me:16972: checking for missing \"${ac_func}\" extern" >&5
 echo $ECHO_N "checking for missing \"${ac_func}\" extern... $ECHO_C" >&6
 if eval "test \"\${cf_cv_func_${ac_func}+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16771,7 +16978,7 @@
 cf_save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $CHECK_DECL_FLAG"
 cat >conftest.$ac_ext <<_ACEOF
-#line 16774 "configure"
+#line 16981 "configure"
 #include "confdefs.h"
 
 $CHECK_DECL_HDRS
@@ -16793,16 +17000,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16796: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17003: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16799: \$? = $ac_status" >&5
+  echo "$as_me:17006: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16802: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17009: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16805: \$? = $ac_status" >&5
+  echo "$as_me:17012: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval 'cf_cv_func_'${ac_func}'=yes'
 else
@@ -16816,7 +17023,7 @@
 fi
 
 eval 'cf_result=$cf_cv_func_'${ac_func}
-echo "$as_me:16819: result: $cf_result" >&5
+echo "$as_me:17026: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 test $cf_result = yes && cat >>confdefs.h <<EOF
 #define MISSING_EXTERN_${ac_tr_func} 1
@@ -16830,7 +17037,7 @@
 #include <tcap.h>
 "
 
-echo "$as_me:16833: checking for term.h" >&5
+echo "$as_me:17040: checking for term.h" >&5
 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
 if test "${cf_cv_term_header+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16843,7 +17050,7 @@
 	term.h
 do
 	cat >conftest.$ac_ext <<_ACEOF
-#line 16846 "configure"
+#line 17053 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header-curses.h}>
@@ -16857,16 +17064,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:16860: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17067: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:16863: \$? = $ac_status" >&5
+  echo "$as_me:17070: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:16866: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17073: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16869: \$? = $ac_status" >&5
+  echo "$as_me:17076: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_term_header=$cf_header
 	 break
@@ -16879,7 +17086,7 @@
 done
 
 fi
-echo "$as_me:16882: result: $cf_cv_term_header" >&5
+echo "$as_me:17089: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 case $cf_cv_term_header in #(vi
@@ -16903,7 +17110,7 @@
 	;;
 esac
 
-echo "$as_me:16906: checking if we should include curses.h or termcap.h" >&5
+echo "$as_me:17113: checking if we should include curses.h or termcap.h" >&5
 echo $ECHO_N "checking if we should include curses.h or termcap.h... $ECHO_C" >&6
 if test "${cf_cv_need_curses_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16922,7 +17129,7 @@
     test -n "$cf_t_opts" && CPPFLAGS="$CPPFLAGS -D$cf_t_opts"
 
     cat >conftest.$ac_ext <<_ACEOF
-#line 16925 "configure"
+#line 17132 "configure"
 #include "confdefs.h"
 /* $cf_c_opts $cf_t_opts */
 $CHECK_DECL_HDRS
@@ -16935,16 +17142,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16938: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17145: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16941: \$? = $ac_status" >&5
+  echo "$as_me:17148: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16944: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17151: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16947: \$? = $ac_status" >&5
+  echo "$as_me:17154: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   test "$cf_cv_need_curses_h" = no && {
 	     cf_cv_need_curses_h=maybe
@@ -16956,7 +17163,7 @@
 cat conftest.$ac_ext >&5
 echo "Recompiling with corrected call (C:$cf_c_opts, T:$cf_t_opts)" >&5
 	cat >conftest.$ac_ext <<_ACEOF
-#line 16959 "configure"
+#line 17166 "configure"
 #include "confdefs.h"
 
 $CHECK_DECL_HDRS
@@ -16969,16 +17176,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16972: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17179: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:16975: \$? = $ac_status" >&5
+  echo "$as_me:17182: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:16978: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17185: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:16981: \$? = $ac_status" >&5
+  echo "$as_me:17188: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_need_curses_h=yes
 	 cf_ok_c_opts=$cf_c_opts
@@ -17015,7 +17222,7 @@
 fi
 
 fi
-echo "$as_me:17018: result: $cf_cv_need_curses_h" >&5
+echo "$as_me:17225: result: $cf_cv_need_curses_h" >&5
 echo "${ECHO_T}$cf_cv_need_curses_h" >&6
 
 case $cf_cv_need_curses_h in
@@ -17049,7 +17256,7 @@
 	;;
 esac
 
-echo "$as_me:17052: checking declaration of tputs 3rd param" >&5
+echo "$as_me:17259: checking declaration of tputs 3rd param" >&5
 echo $ECHO_N "checking declaration of tputs 3rd param... $ECHO_C" >&6
 if test "${cf_cv_type_outchar+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -17065,10 +17272,10 @@
 for R in int char; do
 for S in "" const; do
 
-echo "(line 17068) testing loop variables P:$P, Q:$Q, R:$R, S:$S ..." 1>&5
+echo "(line 17275) testing loop variables P:$P, Q:$Q, R:$R, S:$S ..." 1>&5
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 17071 "configure"
+#line 17278 "configure"
 #include "confdefs.h"
 $CHECK_DECL_HDRS
 int
@@ -17082,16 +17289,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:17085: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17292: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:17088: \$? = $ac_status" >&5
+  echo "$as_me:17295: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:17091: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17298: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17094: \$? = $ac_status" >&5
+  echo "$as_me:17301: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_type_outchar="$Q OutChar($R)"
 	 cf_cv_found=yes
@@ -17110,7 +17317,7 @@
 done
 
 fi
-echo "$as_me:17113: result: $cf_cv_type_outchar" >&5
+echo "$as_me:17320: result: $cf_cv_type_outchar" >&5
 echo "${ECHO_T}$cf_cv_type_outchar" >&6
 
 case $cf_cv_type_outchar in
@@ -17142,7 +17349,7 @@
 
 ac_tr_func=`echo "$ac_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-echo "$as_me:17145: checking for missing \"${ac_func}\" extern" >&5
+echo "$as_me:17352: checking for missing \"${ac_func}\" extern" >&5
 echo $ECHO_N "checking for missing \"${ac_func}\" extern... $ECHO_C" >&6
 if eval "test \"\${cf_cv_func_${ac_func}+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -17151,7 +17358,7 @@
 cf_save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $CHECK_DECL_FLAG"
 cat >conftest.$ac_ext <<_ACEOF
-#line 17154 "configure"
+#line 17361 "configure"
 #include "confdefs.h"
 
 $CHECK_DECL_HDRS
@@ -17173,16 +17380,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17176: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17383: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:17179: \$? = $ac_status" >&5
+  echo "$as_me:17386: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17182: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17389: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17185: \$? = $ac_status" >&5
+  echo "$as_me:17392: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval 'cf_cv_func_'${ac_func}'=yes'
 else
@@ -17196,7 +17403,7 @@
 fi
 
 eval 'cf_result=$cf_cv_func_'${ac_func}
-echo "$as_me:17199: result: $cf_result" >&5
+echo "$as_me:17406: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 test $cf_result = yes && cat >>confdefs.h <<EOF
 #define MISSING_EXTERN_${ac_tr_func} 1
@@ -17272,7 +17479,7 @@
 
 ac_tr_func=`echo "$ac_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-echo "$as_me:17275: checking for missing \"${ac_func}\" extern" >&5
+echo "$as_me:17482: checking for missing \"${ac_func}\" extern" >&5
 echo $ECHO_N "checking for missing \"${ac_func}\" extern... $ECHO_C" >&6
 if eval "test \"\${cf_cv_func_${ac_func}+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -17281,7 +17488,7 @@
 cf_save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $CHECK_DECL_FLAG"
 cat >conftest.$ac_ext <<_ACEOF
-#line 17284 "configure"
+#line 17491 "configure"
 #include "confdefs.h"
 
 $CHECK_DECL_HDRS
@@ -17303,16 +17510,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17306: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17513: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:17309: \$? = $ac_status" >&5
+  echo "$as_me:17516: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17312: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17519: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17315: \$? = $ac_status" >&5
+  echo "$as_me:17522: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval 'cf_cv_func_'${ac_func}'=yes'
 else
@@ -17326,7 +17533,7 @@
 fi
 
 eval 'cf_result=$cf_cv_func_'${ac_func}
-echo "$as_me:17329: result: $cf_result" >&5
+echo "$as_me:17536: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 test $cf_result = yes && cat >>confdefs.h <<EOF
 #define MISSING_EXTERN_${ac_tr_func} 1
@@ -17346,7 +17553,7 @@
 
 ac_tr_func=`echo "$ac_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-echo "$as_me:17349: checking for missing \"${ac_func}\" extern" >&5
+echo "$as_me:17556: checking for missing \"${ac_func}\" extern" >&5
 echo $ECHO_N "checking for missing \"${ac_func}\" extern... $ECHO_C" >&6
 if eval "test \"\${cf_cv_func_${ac_func}+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -17355,7 +17562,7 @@
 cf_save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $CHECK_DECL_FLAG"
 cat >conftest.$ac_ext <<_ACEOF
-#line 17358 "configure"
+#line 17565 "configure"
 #include "confdefs.h"
 
 $CHECK_DECL_HDRS
@@ -17377,16 +17584,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17380: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17587: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:17383: \$? = $ac_status" >&5
+  echo "$as_me:17590: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17386: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17593: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17389: \$? = $ac_status" >&5
+  echo "$as_me:17596: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval 'cf_cv_func_'${ac_func}'=yes'
 else
@@ -17400,7 +17607,7 @@
 fi
 
 eval 'cf_result=$cf_cv_func_'${ac_func}
-echo "$as_me:17403: result: $cf_result" >&5
+echo "$as_me:17610: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 test $cf_result = yes && cat >>confdefs.h <<EOF
 #define MISSING_EXTERN_${ac_tr_func} 1
@@ -17457,13 +17664,13 @@
 if test "$cf_need_libdl" = yes ; then
 
 cf_have_dlsym=no
-echo "$as_me:17460: checking for dlsym" >&5
+echo "$as_me:17667: checking for dlsym" >&5
 echo $ECHO_N "checking for dlsym... $ECHO_C" >&6
 if test "${ac_cv_func_dlsym+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 17466 "configure"
+#line 17673 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dlsym (); below.  */
@@ -17494,16 +17701,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17497: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17704: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:17500: \$? = $ac_status" >&5
+  echo "$as_me:17707: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17503: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17710: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17506: \$? = $ac_status" >&5
+  echo "$as_me:17713: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_dlsym=yes
 else
@@ -17513,14 +17720,14 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:17516: result: $ac_cv_func_dlsym" >&5
+echo "$as_me:17723: result: $ac_cv_func_dlsym" >&5
 echo "${ECHO_T}$ac_cv_func_dlsym" >&6
 if test $ac_cv_func_dlsym = yes; then
   cf_have_dlsym=yes
 else
 
 cf_have_libdl=no
-echo "$as_me:17523: checking for dlsym in -ldl" >&5
+echo "$as_me:17730: checking for dlsym in -ldl" >&5
 echo $ECHO_N "checking for dlsym in -ldl... $ECHO_C" >&6
 if test "${ac_cv_lib_dl_dlsym+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -17528,7 +17735,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 17531 "configure"
+#line 17738 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -17547,16 +17754,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17550: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17757: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:17553: \$? = $ac_status" >&5
+  echo "$as_me:17760: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17556: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17763: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17559: \$? = $ac_status" >&5
+  echo "$as_me:17766: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dl_dlsym=yes
 else
@@ -17567,7 +17774,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:17570: result: $ac_cv_lib_dl_dlsym" >&5
+echo "$as_me:17777: result: $ac_cv_lib_dl_dlsym" >&5
 echo "${ECHO_T}$ac_cv_lib_dl_dlsym" >&6
 if test $ac_cv_lib_dl_dlsym = yes; then
 
@@ -17580,10 +17787,10 @@
 if test "$cf_have_dlsym" = yes ; then
 	test "$cf_have_libdl" = yes && LIBS="-ldl $LIBS"
 
-	echo "$as_me:17583: checking whether able to link to dl*() functions" >&5
+	echo "$as_me:17790: checking whether able to link to dl*() functions" >&5
 echo $ECHO_N "checking whether able to link to dl*() functions... $ECHO_C" >&6
 	cat >conftest.$ac_ext <<_ACEOF
-#line 17586 "configure"
+#line 17793 "configure"
 #include "confdefs.h"
 #include <dlfcn.h>
 int
@@ -17601,16 +17808,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17604: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17811: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:17607: \$? = $ac_status" >&5
+  echo "$as_me:17814: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17610: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17817: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17613: \$? = $ac_status" >&5
+  echo "$as_me:17820: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 		cat >>confdefs.h <<\EOF
@@ -17621,15 +17828,15 @@
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 
-		{ { echo "$as_me:17624: error: Cannot link test program for libdl" >&5
+		{ { echo "$as_me:17831: error: Cannot link test program for libdl" >&5
 echo "$as_me: error: Cannot link test program for libdl" >&2;}
    { (exit 1); exit 1; }; }
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-	echo "$as_me:17629: result: ok" >&5
+	echo "$as_me:17836: result: ok" >&5
 echo "${ECHO_T}ok" >&6
 else
-	{ { echo "$as_me:17632: error: Cannot find dlsym function" >&5
+	{ { echo "$as_me:17839: error: Cannot find dlsym function" >&5
 echo "$as_me: error: Cannot find dlsym function" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -17644,10 +17851,10 @@
 		cf_opt_rdynamic=no
 		cf_save_CFLAGS="$CFLAGS"
 		CFLAGS="-Wall -rdynamic $CFLAGS"
-		echo "$as_me:17647: checking if gcc has -rdynamic option" >&5
+		echo "$as_me:17854: checking if gcc has -rdynamic option" >&5
 echo $ECHO_N "checking if gcc has -rdynamic option... $ECHO_C" >&6
 		cat >conftest.$ac_ext <<_ACEOF
-#line 17650 "configure"
+#line 17857 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -17659,16 +17866,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:17662: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17869: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:17665: \$? = $ac_status" >&5
+  echo "$as_me:17872: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:17668: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17875: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:17671: \$? = $ac_status" >&5
+  echo "$as_me:17878: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_opt_rdynamic=yes
 else
@@ -17677,7 +17884,7 @@
 cf_opt_rdynamic=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-		echo "$as_me:17680: result: $cf_opt_rdynamic" >&5
+		echo "$as_me:17887: result: $cf_opt_rdynamic" >&5
 echo "${ECHO_T}$cf_opt_rdynamic" >&6
 		test "$cf_opt_rdynamic" = no && CFLAGS="$cf_save_CFLAGS"
 
@@ -17694,7 +17901,7 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:17697: checking for $ac_word" >&5
+echo "$as_me:17904: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_SPELL_PROG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -17709,7 +17916,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_SPELL_PROG="$ac_prog"
-echo "$as_me:17712: found $ac_dir/$ac_word" >&5
+echo "$as_me:17919: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -17717,10 +17924,10 @@
 fi
 SPELL_PROG=$ac_cv_prog_SPELL_PROG
 if test -n "$SPELL_PROG"; then
-  echo "$as_me:17720: result: $SPELL_PROG" >&5
+  echo "$as_me:17927: result: $SPELL_PROG" >&5
 echo "${ECHO_T}$SPELL_PROG" >&6
 else
-  echo "$as_me:17723: result: no" >&5
+  echo "$as_me:17930: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -17832,7 +18039,7 @@
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:17835: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:18042: creating $CONFIG_STATUS" >&5
 echo "$as_me: creating $CONFIG_STATUS" >&6;}
 cat >$CONFIG_STATUS <<_ACEOF
 #! $SHELL
@@ -18008,7 +18215,7 @@
     echo "$ac_cs_version"; exit 0 ;;
   --he | --h)
     # Conflict between --help and --header
-    { { echo "$as_me:18011: error: ambiguous option: $1
+    { { echo "$as_me:18218: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -18027,7 +18234,7 @@
     ac_need_defaults=false;;
 
   # This is an error.
-  -*) { { echo "$as_me:18030: error: unrecognized option: $1
+  -*) { { echo "$as_me:18237: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -18085,7 +18292,7 @@
   "filters/makefile.tmp" ) CONFIG_FILES="$CONFIG_FILES filters/makefile.tmp:filters/makefile.2nd" ;;
   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
   "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config_h.in" ;;
-  *) { { echo "$as_me:18088: error: invalid argument: $ac_config_target" >&5
+  *) { { echo "$as_me:18295: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
@@ -18228,6 +18435,7 @@
 s,@IMAKE@,$IMAKE,;t t
 s,@IMAKE_CFLAGS@,$IMAKE_CFLAGS,;t t
 s,@IMAKE_LOADFLAGS@,$IMAKE_LOADFLAGS,;t t
+s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
 s,@ICON_SUFFIX@,$ICON_SUFFIX,;t t
 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
 s,@EXTRAOBJS@,$EXTRAOBJS,;t t
@@ -18354,7 +18562,7 @@
   esac
 
   if test x"$ac_file" != x-; then
-    { echo "$as_me:18357: creating $ac_file" >&5
+    { echo "$as_me:18565: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
     rm -f "$ac_file"
   fi
@@ -18372,7 +18580,7 @@
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:18375: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:18583: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -18385,7 +18593,7 @@
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:18388: error: cannot find input file: $f" >&5
+           { { echo "$as_me:18596: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -18451,7 +18659,7 @@
   * )   ac_file_in=$ac_file.in ;;
   esac
 
-  test x"$ac_file" != x- && { echo "$as_me:18454: creating $ac_file" >&5
+  test x"$ac_file" != x- && { echo "$as_me:18662: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
 
   # First look for the input files in the build tree, otherwise in the
@@ -18462,7 +18670,7 @@
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:18465: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:18673: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -18475,7 +18683,7 @@
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:18478: error: cannot find input file: $f" >&5
+           { { echo "$as_me:18686: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -18533,7 +18741,7 @@
   rm -f $tmp/in
   if test x"$ac_file" != x-; then
     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
-      { echo "$as_me:18536: $ac_file is unchanged" >&5
+      { echo "$as_me:18744: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
Index: configure.in
Prereq:  1.224 
--- vile-9.5k+/configure.in	2006-08-13 20:49:42.000000000 +0000
+++ vile-9.5l/configure.in	2006-10-28 17:46:42.000000000 +0000
@@ -1,12 +1,12 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_REVISION($Revision: 1.224 $)
+AC_REVISION($Revision: 1.225 $)
 AC_PREREQ(2.13.20030927)
 rm -f config.cache
 
 ### Use "configure -with-screen" to override the default configuration, which is
 ### termcap-based on unix systems.
 
-dnl $Header: /usr/build/vile/vile/RCS/configure.in,v 1.224 2006/08/13 20:49:42 tom Exp $
+dnl $Header: /usr/build/vile/vile/RCS/configure.in,v 1.225 2006/10/28 17:46:42 tom Exp $
 
 define(MAKELIST, sh $srcdir/filters/makelist.sh $srcdir/filters/genmake.mak)
 
@@ -502,15 +502,13 @@
 		SCREEN=curses
 		TARGET=vile
 		AC_DEFINE(DISP_CURSES)
-		CF_NCURSES_CPPFLAGS
-		CF_NCURSES_LIBS
+		CF_NCURSES_CONFIG
 	;;
 	ncursesw)
 		SCREEN=curses
 		TARGET=vile
 		AC_DEFINE(DISP_CURSES)
-		CF_NCURSES_CPPFLAGS(ncursesw)
-		CF_NCURSES_LIBS(ncursesw)
+		CF_NCURSES_CONFIG(ncursesw)
 	;;
 	* )
 		SCREEN=tcap
Index: csrch.c
Prereq:  1.32 
--- vile-9.5k+/csrch.c	2004-04-11 23:23:13.000000000 +0000
+++ vile-9.5l/csrch.c	2006-11-06 21:00:51.000000000 +0000
@@ -1,8 +1,8 @@
 /*
  * These functions perform vi's on-this-line character scanning functions.
- * written for vile: Copyright (c) 1990, 1995-2002 by Paul Fox
+ * written for vile.  Copyright (c) 1990, 1995-2002 by Paul Fox
  *
- * $Header: /usr/build/vile/vile/RCS/csrch.c,v 1.32 2004/04/11 23:23:13 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/csrch.c,v 1.34 2006/11/06 21:00:51 tom Exp $
  *
 */
 
@@ -26,8 +26,7 @@
     int i;
     int doto;
 
-    if (!f || n <= 0)
-	n = 1;
+    n = need_at_least(f, n, 1);
 
     lstchar = c;
     lstscan = FORW;
@@ -65,8 +64,7 @@
     int i;
     int doto;
 
-    if (!f || n <= 0)
-	n = 1;
+    n = need_at_least(f, n, 1);
 
     lstchar = c;
     lstscan = BACK;
Index: display.c
Prereq:  1.418 
--- vile-9.5k+/display.c	2006-04-25 20:18:04.000000000 +0000
+++ vile-9.5l/display.c	2006-11-04 11:48:01.000000000 +0000
@@ -5,7 +5,7 @@
  * functions use hints that are left in the windows by the commands.
  *
  *
- * $Header: /usr/build/vile/vile/RCS/display.c,v 1.418 2006/04/25 20:18:04 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/display.c,v 1.421 2006/11/04 11:48:01 tom Exp $
  *
  */
 
@@ -325,6 +325,7 @@
 	default:
 	    (*outfunc) (c);
 	    n = 1;
+	    break;
 	}
 	the_width -= n;
 	while (the_width-- > 0) {
@@ -1573,11 +1574,11 @@
     while (num-- != 0) {
 	curwp = wp = tbl[num].wp;
 	curbp = curwp->w_bufp;
-	(void) gotoline(TRUE, tbl[num].top);
+	(void) vl_gotoline(tbl[num].top);
 	wp->w_line.l = wp->w_dot.l;
 	wp->w_line.o = 0;
 	if (tbl[num].line != tbl[num].top)
-	    (void) gotoline(TRUE, tbl[num].line);
+	    (void) vl_gotoline(tbl[num].line);
 	(void) gocol(tbl[num].col);
 	wp->w_flag |= WFMOVE | WFSBAR;
 	copy_mvals(NUM_W_VALUES, wp->w_values.wv, tbl[num].w_vals);
@@ -2854,8 +2855,7 @@
 		 * token, to reformat it.  Don't bother reformatting if
 		 * it is just a 'd' added to make the string unambiguous.
 		 */
-		while (isDigit(*fs))
-		    fs++;
+		fs = skip_cnumber(fs);
 		if (isAlpha(*fs)) {
 		    if ((*fs != 'd' || fs != save_fs)) {
 			char format[NSTRING];
Index: doc/macros.doc
Prereq:  1.96 
--- vile-9.5k+/doc/macros.doc	2006-02-16 01:22:49.000000000 +0000
+++ vile-9.5l/doc/macros.doc	2006-11-01 21:23:26.000000000 +0000
@@ -656,11 +656,15 @@
 
 	$sres           Current screen size on a DOS PC (meaningless on a
 			Win32 host).  Values:
-			    "2",     "25",    "80x25",
-			    "4",     "43",    "80x43",
-			    "5",     "50",    "80x50",
-			    "80x14", "80x28",
-			    "40x12", "40x21", "40x25", "40x28", "40x50"
+			    "2",     "25",
+			    "4",     "43",
+			    "5",     "50",
+			    "6",     "60"
+
+			Values for VMS:
+			    "WIDE",  "NORMAL"
+
+			Other drivers ignore the value.
 
 	$startup-file   The name of the startup file (e.g. .vilerc)
 
@@ -1497,6 +1501,6 @@
 	========================= end vile.rc =======================
 
 -----------------------------------
-  $Header: /usr/build/vile/vile/doc/RCS/macros.doc,v 1.96 2006/02/16 01:22:49 tom Exp $
+  $Header: /usr/build/vile/vile/doc/RCS/macros.doc,v 1.97 2006/11/01 21:23:26 tom Exp $
 -----------------------------------
 
Index: edef.h
Prereq:  1.323 
--- vile-9.5k+/edef.h	2006-02-16 00:13:49.000000000 +0000
+++ vile-9.5l/edef.h	2006-11-04 15:40:39.000000000 +0000
@@ -6,7 +6,7 @@
  */
 
 /*
- * $Header: /usr/build/vile/vile/RCS/edef.h,v 1.323 2006/02/16 00:13:49 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/edef.h,v 1.326 2006/11/04 15:40:39 tom Exp $
  */
 
 #ifndef VILE_EDEF_H
@@ -33,7 +33,7 @@
 #endif
 
 decl_uninit( char *prog_arg );		/* argv[0] from main.c */
-decl_init( char *exec_pathname, ".");	/* replaced at runtime with path-head of argv[0] */
+decl_init( char *exec_pathname, "." );	/* replaced at runtime with path-head of argv[0] */
 
 #ifndef PROGRAM_NAME
 # if DISP_X11
@@ -47,31 +47,37 @@
 # endif
 #endif /* PROGRAM_NAME */
 
-decl_init( char prognam[], PROGRAM_NAME);
-decl_init( char version[], "version " VILE_VERSION);
+decl_init( char prognam[], PROGRAM_NAME );
+decl_init( char version[], "version " VILE_VERSION );
 
 #ifdef SYSTEM_NAME
-decl_init( char opersys[], SYSTEM_NAME);
+decl_init( char opersys[], SYSTEM_NAME );
 #else
 #if SYS_UNIX
-decl_init( char opersys[], "unix");
+decl_init( char opersys[], "unix" );
 #endif
 #if SYS_VMS
-decl_init( char opersys[], "vms");
+decl_init( char opersys[], "vms" );
 #endif
 #if SYS_MSDOS
-decl_init( char opersys[], "dos");
+decl_init( char opersys[], "dos" );
 #endif
 #if SYS_OS2
-decl_init( char opersys[], "os/2");
+decl_init( char opersys[], "os/2" );
 #endif
 #if SYS_WINNT
-decl_init( char opersys[], "win32");
+decl_init( char opersys[], "win32" );
 #endif
 #endif
 
+#if SYS_MSDOS || SYS_OS2 || SYS_WINNT || SYS_VMS
+#define DFT_STARTUP_FILE "vile.rc"
+#else /* SYS_UNIX */
+#define DFT_STARTUP_FILE ".vilerc"
+#endif
+
 #if SYS_WINNT
-decl_uninit(int nowait_pipe_cmd);	/* if set, don't slowreadf() this pipe
+decl_uninit( int nowait_pipe_cmd );	/* if set, don't slowreadf() this pipe
 					 * command.
 					 */
 #endif
@@ -80,7 +86,7 @@
 decl_init( int i_am_dead, 0 );		/* have we been burned? */
 
 
-decl_init( int autoindented , -1);	/* how many chars (not cols) indented */
+decl_init( int autoindented , -1 );	/* how many chars (not cols) indented */
 decl_uninit( int isnamedcmd );		/* are we typing a command name */
 decl_uninit( int calledbefore );	/* called before during this command? */
 decl_uninit( CHARTYPE vl_chartypes_[N_chars] );	/* character types	*/
@@ -94,8 +100,8 @@
 decl_uninit( int lastkey );		/* last keystoke (tgetc)	*/
 decl_uninit( int lastcmd );		/* last command	(kbd_seq)	*/
 decl_uninit( REGIONSHAPE regionshape );	/* shape of region		*/
-decl_init (REGION *haveregion, 0);
-decl_init (REGION *wantregion, 0);
+decl_init( REGION *haveregion, 0 );
+decl_init( REGION *wantregion, 0 );
 #if OPT_VIDEO_ATTRS
 decl_uninit( VIDEO_ATTR videoattribute );
 					/* attribute to set in call to
@@ -112,7 +118,7 @@
 decl_uninit( MARK post_op_dot );	/* current pos. after operator motion */
 
 decl_uninit( MARK scanboundpos );	/* where do searches end? */
-decl_uninit( int scanbound_is_header);	/* is scanboundpos the header line? */
+decl_uninit( int scanbound_is_header );	/* is scanboundpos the header line? */
 
 decl_uninit( short opcmd );		/* what sort of operator?	*/
 decl_uninit( const CMDFUNC *havemotion ); /* so we can use "oper" routines
@@ -136,8 +142,8 @@
 decl_init( TBUFF *replacepat, 0 );	/* replacement pattern		*/
 decl_uninit( int  last_srch_direc );	/* Direction of last search */
 decl_uninit( regexp *gregexp );		/* compiled version of searchpat */
-decl_init( TBUFF *tb_matched_pat, 0);	/* text that scan found */
-decl_init( TBUFF *lastfileedited, 0);
+decl_init( TBUFF *tb_matched_pat, 0 );	/* text that scan found */
+decl_init( TBUFF *lastfileedited, 0 );
 
 #if OPT_HOOKS
 decl_uninit( HOOK cdhook );		/* proc to run when change dir */
@@ -153,17 +159,20 @@
 
 decl_init( int curgoal, -1 );		/* column goal			*/
 decl_uninit( char *execstr );		/* string being executed	*/
+
 #if OPT_MLFORMAT
 decl_uninit( char *modeline_format );	/* modeline formatting string */
 #endif
+
 #if OPT_POSFORMAT
 decl_uninit( char *position_format );	/* position formatting string */
 #endif
-decl_init( int	eolexist, TRUE );	/* does clear to EOL exist	*/
+
+decl_init( int eolexist, TRUE );	/* does clear to EOL exist	*/
 decl_uninit( int revexist );		/* does reverse video exist?	*/
 
 #ifdef realdef
-DECL_EXTERN(MARK nullmark) = { NULL, 0 };
+DECL_EXTERN( MARK nullmark) = { NULL, 0 };
 #else
 extern	MARK	nullmark;
 #endif
@@ -179,15 +188,15 @@
 
 decl_init( int sgarbf, TRUE );		/* TRUE if screen is garbage	*/
 decl_init( int need_update, TRUE );	/* TRUE if screen is not updated*/
-decl_uninit( int clexec	);		/* command line execution flag	*/
+decl_uninit( int clexec );		/* command line execution flag	*/
 decl_uninit( int clhide );		/* hide results of this command	*/
 decl_init( int quiet, FALSE );		/* hide output of this command	*/
 decl_init( int miniedit, FALSE );	/* editing minibuffer with vi-cmds */
 decl_init( int no_minimsgs, FALSE );	/* suppress messages in minibuffer */
-decl_init( int vl_msgs, TRUE);		/* suppress command output?	*/
+decl_init( int vl_msgs, TRUE );		/* suppress command output?	*/
 decl_init( int no_errs, FALSE );	/* suppress bells/alarms?	*/
-decl_init( int vl_echo, TRUE);		/* echo user input 		*/
-decl_init( int qpasswd, FALSE);		/* querying for password	*/
+decl_init( int vl_echo, TRUE );		/* echo user input 		*/
+decl_init( int qpasswd, FALSE );	/* querying for password	*/
 decl_init( int in_autocolor, FALSE );	/* Autocoloring			*/
 
 decl_uninit( int vtrow );		/* Row location of SW cursor	*/
@@ -208,9 +217,9 @@
 
 #if OPT_TITLE
 decl_init( int auto_set_title, TRUE );	/* automatically set title	*/
-decl_init ( TBUFF * title_format, 0 );	/* format, if any		*/
-decl_init ( TBUFF * current_title, 0 );
-decl_init ( TBUFF * request_title, 0 );
+decl_init( TBUFF * title_format, 0 );	/* format, if any		*/
+decl_init( TBUFF * current_title, 0 );
+decl_init( TBUFF * request_title, 0 );
 #endif
 
 /* Special characters, used in keyboard control (some values are set on
@@ -221,21 +230,21 @@
 decl_init( int cntl_a, tocntrl('A') );	/* rebindable control-A prefix	*/
 decl_init( int cntl_x, tocntrl('X') );	/* rebindable control-X prefix	*/
 decl_init( int reptc, 'K' );		/* rebindable "repeat" arg	*/
-decl_init( int esc_c, tocntrl('[') );	/* rebindable vi esc char	*/
+decl_init( int esc_c,  tocntrl('[') );	/* rebindable vi esc char	*/
 decl_init( int poundc, '#' );		/* pseudo function key prefix	*/
 
 /* rebindable via the "set-terminal" interface */
-decl_init( int editc, tocntrl('G') );	/* toggle edit-mode in minibuffer */
+decl_init( int editc,  tocntrl('G') );	/* toggle edit-mode in minibuffer */
 decl_init( int quotec, tocntrl('V') );	/* current quoting char		*/
-decl_init( int killc, tocntrl('U') );	/* current line kill char	*/
+decl_init( int killc,  tocntrl('U') );	/* current line kill char	*/
 decl_init( int wkillc, tocntrl('W') );	/* current word kill char	*/
-decl_init( int intrc, tocntrl('C') );	/* current interrupt char	*/
-decl_init( int suspc, tocntrl('Z') );	/* current suspend char	*/
+decl_init( int intrc,  tocntrl('C') );	/* current interrupt char	*/
+decl_init( int suspc,  tocntrl('Z') );	/* current suspend char	*/
 decl_init( int startc, tocntrl('Q') );	/* current output start char	*/
-decl_init( int stopc, tocntrl('S') );	/* current output stop char	*/
-decl_init( int backspc, '\b');		/* current backspace char	*/
-decl_init( int name_cmpl, '\t');	/* do name-completion		*/
-decl_init( int test_cmpl, '?');		/* show name-completion		*/
+decl_init( int stopc,  tocntrl('S') );	/* current output stop char	*/
+decl_init( int backspc, '\b' );		/* current backspace char	*/
+decl_init( int name_cmpl, '\t' );	/* do name-completion		*/
+decl_init( int test_cmpl, '?' );	/* show name-completion		*/
 
 decl_uninit( KILLREG kbs[NKREGS] );	/* all chars, 1 thru 9, and default */
 decl_uninit( short ukb );		/* index of current kbuffs */
@@ -249,7 +258,7 @@
 #if !SMALLER
 decl_uninit( TBUFF *prompt_string );	/* command-line prompt-string	*/
 decl_uninit( WINDOW *swindow );		/* saved window pointer		*/
-decl_init( TBUFF *with_prefix, 0);	/* prefix set by "~with"	*/
+decl_init( TBUFF *with_prefix, 0 );	/* prefix set by "~with"	*/
 #endif
 
 #if OPT_ENCRYPT
@@ -257,8 +266,8 @@
 #endif
 
 decl_uninit( int dotcmdactive );	/* current dot command mode	*/
-decl_init( int dotcmdarg, FALSE);	/* was there an arg to '.'? */
-decl_uninit( short dotcmdkreg);		/* original dot command kill reg */
+decl_init( int dotcmdarg, FALSE );	/* was there an arg to '.'? */
+decl_uninit( short dotcmdkreg );	/* original dot command kill reg */
 decl_uninit( ITBUFF *dotcmd );		/* recorded-text of dot-commands */
 decl_uninit( int dotcmdcnt );		/* down-counter for dot-commands */
 decl_uninit( int dotcmdrep );		/* original dot-command repeat-count */
@@ -273,7 +282,11 @@
 decl_init( int tracemacros, FALSE );	/* macro tracing flag		*/
 #endif
 
-decl_init ( int im_displaying, 0 );	/* flag set during screen updates */
+#if OPT_MODELINE
+decl_init( int in_modeline, FALSE );	/* set during vi-style modeline */
+#endif
+
+decl_init( int im_displaying, 0 );	/* flag set during screen updates */
 decl_uninit( int vile_is_busy );	/* disabling flag, e.g., working */
 
 #if OPT_WORKING
@@ -283,7 +296,7 @@
 #endif
 
 #if OPT_SHELL
-decl_init ( int cd_on_open, FALSE );
+decl_init( int cd_on_open, FALSE );
 #endif
 
 	/* These pointers are nonnull only while animating a given buffer or
@@ -333,7 +346,7 @@
 #define vl_locale "built-in"
 #endif
 
-decl_init ( L_NUM help_at, -1 );	/* position in help-file */
+decl_init( L_NUM help_at, -1 );		/* position in help-file */
 decl_uninit( char *helpfile );
 decl_init( char vl_pathchr, PATHCHR );	/* $pathlist-separator */
 decl_init( char vl_pathsep, PATHSEP );	/* $pathname-separator */
@@ -347,105 +360,106 @@
 decl_uninit( char *menu_file );
 #endif
 
-decl_init_const( char hexdigits[], "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
+decl_init_const( char hexdigits[], "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" );
 #if SYS_WINNT
-decl_init_const( char ctrldigits[], "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_");
+decl_init_const( char ctrldigits[], "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" );
 #endif
 
 /*--------------------------------------------------------------------------*/
 
-decl_init_const( char HELP_BufName[],		"[Help]");
-decl_init_const( char BINDINGLIST_BufName[],	"[Binding List]");
-decl_init_const( char CMD_BINDINGS_BufName[],	"[Command-Bindings]");
-decl_init_const( char INS_BINDINGS_BufName[],	"[Insert-Bindings]");
-decl_init_const( char SEL_BINDINGS_BufName[],	"[Select-Bindings]");
+decl_init_const( char HELP_BufName[],		"[Help]" );
+decl_init_const( char BINDINGLIST_BufName[],	"[Binding List]" );
+decl_init_const( char CMD_BINDINGS_BufName[],	"[Command-Bindings]" );
+decl_init_const( char INS_BINDINGS_BufName[],	"[Insert-Bindings]" );
+decl_init_const( char SEL_BINDINGS_BufName[],	"[Select-Bindings]" );
 #if OPT_REBIND
-decl_init_const( char KEY_NAMES_BufName[],	"[Key Names]");
+decl_init_const( char KEY_NAMES_BufName[],	"[Key Names]" );
 # if OPT_TERMCHRS
-decl_init_const( char TERMINALCHARS_BufName[],	"[Terminal Chars]");
+decl_init_const( char TERMINALCHARS_BufName[],	"[Terminal Chars]" );
 # endif
 #endif
 #if OPT_COLOR_SCHEMES
-decl_init_const( char COLOR_SCHEMES_BufName[],	"[Color Schemes]");
+decl_init_const( char COLOR_SCHEMES_BufName[],	"[Color Schemes]" );
 #endif
 #if OPT_SHELL
-decl_init_const( char DIRSTACK_BufName[],	"[DirStack]");
+decl_init_const( char DIRSTACK_BufName[],	"[DirStack]" );
 #endif
 #if OPT_SHOW_COLORS
-decl_init_const( char PALETTE_COLORS_BufName[],	"[Color Palette]");
+decl_init_const( char PALETTE_COLORS_BufName[],	"[Color Palette]" );
 #endif
 #if OPT_SHOW_CTYPE
-decl_init_const( char PRINTABLECHARS_BufName[],	"[Printable Chars]");
+decl_init_const( char PRINTABLECHARS_BufName[],	"[Printable Chars]" );
 #endif
 #if OPT_POPUPCHOICE
-decl_init_const( char COMPLETIONS_BufName[],	"[Completions]");
+decl_init_const( char COMPLETIONS_BufName[],	"[Completions]" );
 #endif
-decl_init_const( char BUFFERLIST_BufName[],	"[Buffer List]");
+decl_init_const( char BUFFERLIST_BufName[],	"[Buffer List]" );
 #if OPT_SHOW_EVAL
-decl_init_const( char VARIABLES_BufName[],	"[Variables]");
+decl_init_const( char VARIABLES_BufName[],	"[Variables]" );
 #endif
-decl_init_const( char MACRO_N_BufName[],	"[Macro %d]");
+decl_init_const( char MACRO_N_BufName[],	"[Macro %d]" );
 #if COMPLETE_FILES
-decl_init_const( char FILECOMPLETION_BufName[],	"[FileCompletion]");
+decl_init_const( char FILECOMPLETION_BufName[],	"[FileCompletion]" );
 #endif
 #if COMPLETE_DIRS
-decl_init_const( char DIRCOMPLETION_BufName[],	"[DirCompletion]");
+decl_init_const( char DIRCOMPLETION_BufName[],	"[DirCompletion]" );
 #endif
-decl_init_const( char OUTPUT_BufName[],		"[Output]");
+decl_init_const( char OUTPUT_BufName[],		"[Output]" );
 #if OPT_EVAL || OPT_DEBUGMACROS
-decl_init_const( char TRACE_BufName[],		"[Trace]");
+decl_init_const( char TRACE_BufName[],		"[Trace]" );
 #endif
 #if OPT_FINDERR
 decl_init( TBUFF *filename_expr, 0 );
 decl_init( TBUFF *error_expr, 0 );
 decl_init( TBUFF *error_match, 0 );
 decl_init( int error_tabstop, 8 );
-decl_init_const( char ERRORS_BufName[],		"[Error Expressions]");
-decl_init_const( char ERR_REGEX_BufName[],	"[Error Patterns]");
+decl_init_const( char ERRORS_BufName[],		"[Error Expressions]" );
+decl_init_const( char ERR_REGEX_BufName[],	"[Error Patterns]" );
 #endif
 #if OPT_HISTORY
-decl_init_const( char HISTORY_BufName[],	"[History]");
+decl_init_const( char HISTORY_BufName[],	"[History]" );
 #endif
 #if OPT_SHOW_REGS
-decl_init_const( char REGISTERS_BufName[],	"[Registers]");
+decl_init_const( char REGISTERS_BufName[],	"[Registers]" );
 #endif
-decl_init_const( char STDIN_BufName[],		"[Standard Input]");
-decl_init_const( char UNNAMED_BufName[],	"[unnamed]");
-decl_init_const( char VILEINIT_BufName[],	"[vileinit]");
+decl_init_const( char STDIN_BufName[],		"[Standard Input]" );
+decl_init_const( char UNNAMED_BufName[],	"[unnamed]" );
+decl_init_const( char VILEINIT_BufName[],	"[vileinit]" );
+decl_init_const( char VILEOPTS_BufName[],	"[vileopts]" );
 #if OPT_SHOW_MAPS
-decl_init_const( char MAP_BufName[],		"[Map Sequences]");
-decl_init_const( char MAPBANG_BufName[],	"[Map! Sequences]");
-decl_init_const( char ABBR_BufName[],		"[Abbreviations]");
-decl_init_const( char SYSMAP_BufName[],		"[System Maps]");
+decl_init_const( char MAP_BufName[],		"[Map Sequences]" );
+decl_init_const( char MAPBANG_BufName[],	"[Map! Sequences]" );
+decl_init_const( char ABBR_BufName[],		"[Abbreviations]" );
+decl_init_const( char SYSMAP_BufName[],		"[System Maps]" );
 #else
 /* needed anyway, since they're passed around as args */
-decl_init_const( char MAP_BufName[],		"");
-decl_init_const( char MAPBANG_BufName[],	"");
-decl_init_const( char ABBR_BufName[],		"");
-decl_init_const( char SYSMAP_BufName[],		"");
+decl_init_const( char MAP_BufName[],		"" );
+decl_init_const( char MAPBANG_BufName[],	"" );
+decl_init_const( char ABBR_BufName[],		"" );
+decl_init_const( char SYSMAP_BufName[],		"" );
 #endif
 #if OPT_SHOW_MARKS
-decl_init_const( char MARKS_BufName[],		"[Named Marks]");
+decl_init_const( char MARKS_BufName[],		"[Named Marks]" );
 #endif
 #if OPT_SHOW_WHICH
-decl_init_const( char WHICH_BufName[],		"[Which Files]");
+decl_init_const( char WHICH_BufName[],		"[Which Files]" );
 #endif
-decl_init_const( char SETTINGS_BufName[],	"[Settings]");
+decl_init_const( char SETTINGS_BufName[],	"[Settings]" );
 #if OPT_MAJORMODE
-decl_init_const( char MAJORMODES_BufName[],	"[Major Modes]");
+decl_init_const( char MAJORMODES_BufName[],	"[Major Modes]" );
 #endif
 #if OPT_POPUP_MSGS
-decl_init_const( char MESSAGES_BufName[],	"[Messages]");
+decl_init_const( char MESSAGES_BufName[],	"[Messages]" );
 #endif
-decl_init_const( char P_LINES_BufName[],	"[p-lines]");
+decl_init_const( char P_LINES_BufName[],	"[p-lines]" );
 #if OPT_SHOW_TAGS
-decl_init_const( char TAGSTACK_BufName[],	"[Tag Stack]");
+decl_init_const( char TAGSTACK_BufName[],	"[Tag Stack]" );
 #endif
 #if OPT_TAGS
-decl_init_const( char TAGFILE_BufName[],	"[Tags %d]");
+decl_init_const( char TAGFILE_BufName[],	"[Tags %d]" );
 #endif
 #ifdef MDFILTERMSGS
-decl_init_const( char FLTMSGS_BufName[],	"[Filter Messages]");
+decl_init_const( char FLTMSGS_BufName[],	"[Filter Messages]" );
 #endif
 
 /* defined in nebind.h and nename.h */
@@ -460,7 +474,7 @@
 extern BINDINGS sel_bindings;
 
 /* vars useful for writing procedures that are : commands */
-decl_uninit(int ev_end_of_cmd);
+decl_uninit( int ev_end_of_cmd );
 
 /* terminal structure is defined in the configured screen driver */
 extern	TERM	term;			/* Terminal information.	*/
@@ -469,10 +483,10 @@
 #endif
 extern	TERM	null_term;
 
-decl_init(int utf8_locale, FALSE);
+decl_init( int utf8_locale, FALSE );
 
 #if DISP_BORLAND || DISP_VIO
-decl_init( char *current_res_name, "default");
+decl_init( char *current_res_name, "default" );
 #endif	/* resolution */
 
 #ifdef __cplusplus
Index: estruct.h
Prereq:  1.597 
--- vile-9.5k+/estruct.h	2006-05-21 20:58:10.000000000 +0000
+++ vile-9.5l/estruct.h	2006-10-16 00:19:14.000000000 +0000
@@ -12,7 +12,7 @@
 */
 
 /*
- * $Header: /usr/build/vile/vile/RCS/estruct.h,v 1.597 2006/05/21 20:58:10 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/estruct.h,v 1.598 2006/10/16 00:19:14 tom Exp $
  */
 
 #ifndef _estruct_h
@@ -619,6 +619,7 @@
 #define OPT_MAJORMODE   !SMALLER		/* majormode support */
 #define OPT_MACRO_ARGS	(!SMALLER && OPT_EVAL)	/* macro argument parsing */
 #define OPT_MLFORMAT    !SMALLER		/* modeline-format */
+#define OPT_MODELINE    !SMALLER		/* vi-style modeline-support */
 #define OPT_NAMEBST     !SMALLER		/* name's stored in a bst */
 #define OPT_ONLINEHELP  !SMALLER		/* short per-command help */
 #define OPT_POPUPCHOICE !SMALLER		/* popup-choices mode */
Index: eval.c
Prereq:  1.353 
--- vile-9.5k+/eval.c	2006-04-25 20:22:26.000000000 +0000
+++ vile-9.5l/eval.c	2006-11-04 11:41:25.000000000 +0000
@@ -2,7 +2,7 @@
  *	eval.c -- function and variable evaluation
  *	original by Daniel Lawrence
  *
- * $Header: /usr/build/vile/vile/RCS/eval.c,v 1.353 2006/04/25 20:22:26 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/eval.c,v 1.354 2006/11/04 11:41:25 tom Exp $
  *
  */
 
@@ -1703,6 +1703,14 @@
 }
 
 const char *
+skip_cnumber(const char *s)
+{
+    while (isDigit(*s))
+	s++;
+    return s;
+}
+
+const char *
 skip_cstring(const char *src)
 {
     return src + strlen(src);
@@ -1729,6 +1737,14 @@
 }
 
 char *
+skip_number(char *s)
+{
+    while (isDigit(*s))
+	s++;
+    return s;
+}
+
+char *
 skip_string(char *src)
 {
     return src + strlen(src);
Index: exec.c
Prereq:  1.288 
--- vile-9.5k+/exec.c	2006-06-12 22:28:06.000000000 +0000
+++ vile-9.5l/exec.c	2006-11-06 00:45:22.000000000 +0000
@@ -4,7 +4,7 @@
  *	original by Daniel Lawrence, but
  *	much modified since then.  assign no blame to him.  -pgf
  *
- * $Header: /usr/build/vile/vile/RCS/exec.c,v 1.288 2006/06/12 22:28:06 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/exec.c,v 1.307 2006/11/06 00:45:22 tom Exp $
  *
  */
 
@@ -13,12 +13,7 @@
 #include "nefunc.h"
 #include "nefsms.h"
 
-static int rangespec(const char *specp,
-		     LINE **fromlinep,
-		     LINE **tolinep,
-		     CMDFLAGS * flagp);
-
-/* while loops are described by a list of small structs.  these point
+/* while-loops are described by a list of small structs.  these point
  * at the line on which they were found, and at the line to which one
  * might want to go from there, i.e.:
  *
@@ -79,29 +74,371 @@
 
 /*----------------------------------------------------------------------------*/
 
-/*ARGSUSED*/
+#define isSign(c)    ((c) == '-' || (c) == '+')
+#define isPattern(c) ((c) == '?' || (c) == '/')
+
+/* on entry, s points to a pattern delimiter */
+static const char *
+skip_pattern(const char *s, int *done)
+{
+    int ch = *s++;
+
+    while (*s != ch && *s != EOS) {
+	if (*s == BACKSLASH) {
+	    if (*++s == EOS) {
+		/* FIXME let's not try to escape a null */
+		break;
+	    }
+	}
+	++s;
+    }
+    if (*s == EOS) {
+	*done = FALSE;
+    } else {
+	++s;
+    }
+    return s;
+}
+
+/*
+ * Like parse_linespec(), but does not update marks.
+ */
+static const char *
+skip_linespec(const char *s, const char **before, int *done)
+{
+    /* parse each ;-delimited clause of this linespec */
+    do {
+	/* skip an initial ';', if any */
+	if (*s == ';')
+	    s++;
+
+	s = skip_cblanks(s);	/* skip leading spaces */
+
+	*done = TRUE;		/* we usually complete the parse */
+	*before = s;		/* remember what we tried to parse */
+	if (*s == '.') {	/* dot means current position */
+	    s++;
+	} else if (*s == '$') {	/* '$' means the last line */
+	    s++;
+	} else if (isDigit(*s)) {
+	    s = skip_cnumber(s);
+	} else if (*s == SQUOTE) {
+	    /* apostrophe means go to a set mark */
+	    s += 2;		/* FIXME: see making_mark() */
+	} else if (isSign(*s)) {
+	    int ch = *s;
+	    s = skip_cnumber(s + 1);
+	    while (*s == ch)
+		s++;
+	} else if (isPattern(*s)) {
+	    s = skip_pattern(s, done);
+	}
+
+	/* maybe add an offset */
+	if (isSign(*s)) {
+	    *before = s;
+	    s = skip_cnumber(s + 1);
+	}
+    } while (*s == ';' || isSign(*s));
+
+    return s;
+}
+
+/* on entry, s points to a digit */
+static const char *
+parse_number(const char *s, int *number)
+{
+    *number = 0;
+    while (isDigit(*s)) {
+	*number = (*number * 10) + *s - '0';
+	++s;
+    }
+    return s;
+}
+
+/* on entry, s points to a sign */
+static const char *
+parse_signed_number(const char *s, int *number)
+{
+    int ch = *s++;
+
+    s = parse_number(s, number);
+    if (*number == 0)
+	*number = 1;
+    while (*s == ch) {
+	++s;
+	*number += 1;
+    }
+    if (ch == '-')
+	*number = -(*number);
+    return s;
+}
+
+/*
+ * parse an ex-style line spec -- code originally from elvis, file ex.c, by
+ * Steve Kirkendall
+ */
+static const char *
+parse_linespec(const char *s, LINE **markptr)
+{
+    int num;
+    LINE *lp;			/* where the linespec takes us */
+    int status;
+
+    (void) setmark();
+    lp = NULL;
+
+    /* parse each ;-delimited clause of this linespec */
+    do {
+	/* skip an initial ';', if any */
+	if (*s == ';')
+	    s++;
+
+	s = skip_cblanks(s);	/* skip leading spaces */
+
+	if (*s == '.') {
+	    /* dot means current position */
+	    s++;
+	    lp = DOT.l;
+	} else if (*s == '$') {
+	    /* '$' means the last line */
+	    s++;
+	    status = gotoeob(TRUE, 1);
+	    if (status)
+		lp = DOT.l;
+	} else if (isDigit(*s)) {
+	    /* digit means an absolute line number */
+	    s = parse_number(s, &num);
+	    status = gotoline(TRUE, num);
+	    if (status)
+		lp = DOT.l;
+	} else if (*s == SQUOTE) {
+	    /* apostrophe means go to a set mark */
+	    s++;
+	    status = gonmmark(*s);
+	    if (status)
+		lp = DOT.l;
+	    s++;
+	} else if (isSign(*s)) {
+	    s = parse_signed_number(s, &num);
+	    status = forwline(TRUE, num);
+	    if (status)
+		lp = DOT.l;
+	} else if (isPattern(*s)) {
+	    int done = 1;
+	    int found = FALSE;
+	    const char *save = s;
+	    MARK save_DOT = DOT;
+
+	    last_srch_direc = (*save == '/') ? FORWARD : REVERSE;
+	    s = skip_pattern(save, &done);
+	    tb_init(&searchpat, EOS);
+	    tb_bappend(&searchpat, save + 1, s - save - 1 - done);
+	    tb_append(&searchpat, EOS);
+
+	    if ((gregexp = regcomp(tb_values(searchpat),
+				   tb_length(searchpat) - 1,
+				   b_val(curbp, MDMAGIC))) != 0) {
+
+		scanboundry(TRUE, DOT, last_srch_direc);
+		if (scanner(gregexp,
+			    last_srch_direc,
+			    TRUE,
+			    (int *) 0)) {
+		    lp = DOT.l;
+		    found = TRUE;
+		}
+		DOT = save_DOT;
+		if (!found)
+		    mlwarn("[Not found: %s]", tb_values(searchpat));
+	    } else {
+		mlwarn("[Not a legal expression: %s]", tb_values(searchpat));
+	    }
+	} else if (*s == EOS) {	/* empty string matches '.' */
+	    lp = DOT.l;
+	}
+
+	/* if linespec was faulty, quit now */
+	if (!lp) {
+	    *markptr = lp;
+	    swapmark();
+	    return s;
+	}
+
+	/* maybe add an offset */
+	if (isSign(*s)) {
+	    s = parse_signed_number(s, &num);
+	    if (forwline(TRUE, num) == TRUE)
+		lp = DOT.l;
+	}
+    } while (*s == ';' || isSign(*s));
+
+    *markptr = lp;
+    swapmark();
+    return s;
+}
+
+/*
+ * parse an ex-style line range -- code originally from elvis, file ex.c, by
+ * Steve Kirkendall
+ */
 static int
-eol_range(EOL_ARGS)
+rangespec(const char *specp, LINE **fromlinep, LINE **tolinep,
+	  CMDFLAGS * flagp)
 {
-    (void) eolchar;
+    const char *scan;		/* used to scan thru specp */
+    LINE *fromline;		/* first linespec */
+    LINE *toline;		/* second linespec */
 
-    if (is_edit_char(c))
+    *flagp = 0;
+
+    if (specp == 0)
 	return FALSE;
 
-    /* sorry, cannot scroll with arrow keys */
-    if (isSpecial(c) || isCntrl(c))
+    /* ignore command lines that start with a double-quote */
+    if (*specp == '"') {
+	*fromlinep = *tolinep = DOT.l;
 	return TRUE;
+    }
+
+    /* permit extra colons at the start of the line */
+    while (isBlank(*specp) || *specp == ':') {
+	specp++;
+    }
 
-    if (islinespecchar(c)
-	|| (c == ':' && (cpos == 0 || buffer[cpos - 1] == c))
-	||			/* special test for 'a style mark references */
-	(cpos != 0
-	 && buffer[cpos - 1] == SQUOTE
-	 && can_set_nmmark(c)))
+    /* parse the line specifier */
+    scan = specp;
+    if (*scan == '0') {
+	fromline = toline = buf_head(curbp);	/* _very_ top of buffer */
+	*flagp |= (FROM | ZERO);
+	scan++;
+    } else if (*scan == '%') {
+	/* '%' means all lines */
+	fromline = lforw(buf_head(curbp));
+	toline = lback(buf_head(curbp));
+	scan++;
+	*flagp |= (FROM | TO);
+    } else {
+	scan = parse_linespec(scan, &toline);
+	*flagp |= FROM;
+	if (toline == 0)
+	    toline = DOT.l;
+	fromline = toline;
+	while (*scan == ',') {
+	    fromline = toline;
+	    scan++;
+	    scan = parse_linespec(scan, &toline);
+	    *flagp |= TO;
+	    if (toline == 0) {
+		/* faulty line spec */
+		return FALSE;
+	    }
+	}
+    }
+
+    if (is_empty_buf(curbp))
+	fromline = toline = 0;
+
+    if (scan == specp)
+	*flagp |= DFLALL;
+
+    /* skip whitespace */
+    scan = skip_cblanks(scan);
+
+    if (*scan) {
+	/* dbgwrite("crud at end %s (%s)",specp, scan); */
 	return FALSE;
+    }
+
+    *fromlinep = fromline;
+    *tolinep = toline;
+
     return TRUE;
 }
 
+/* special test for 'a style mark references */
+static int
+making_mark(EOL_ARGS)
+{
+    (void) eolchar;
+
+    return (cpos != 0
+	    && buffer[cpos - 1] == SQUOTE
+	    && can_set_nmmark(c));
+}
+
+const char *
+skip_linespecs(const char *buffer, int cpos, int *done)
+{
+    const char *src = buffer;
+    const char *before = 0;
+
+    TRACE(("skip_linespecs(%d) \"%.*s\"\n", cpos, cpos, buffer));
+    if (cpos != 0) {
+	/* skip over previous linespec's */
+	while ((src - buffer) < cpos) {
+	    src = skip_linespec(src, &before, done);
+	    TRACE(("after linespec %d(%d):%.*s\n",
+		   *done,
+		   cpos - (src - buffer),
+		   cpos - (src - buffer),
+		   src));
+	    if (*src != ',')
+		break;
+	    ++src;
+	}
+    }
+    return src;
+}
+
+/*
+ * Check if we've started accepting a /pattern/ or ?pattern?, and not completed
+ * it.  In those cases, we accept further characters in eol_range().
+ */
+static int
+making_pattern(EOL_ARGS)
+{
+    int done = FALSE;
+    int in_regexp = FALSE;
+    const char *src = buffer;
+
+    (void) eolchar;
+
+    TRACE(("making_pattern(buffer=%.*s, cpos=%d, c=%#x, eolchar=%#x)\n",
+	   cpos, buffer, cpos, c, eolchar));
+    if (cpos != 0) {
+	src = skip_linespecs(buffer, cpos, &done);
+	in_regexp = !done || isPattern(c);
+    } else if (isPattern(c)) {
+	in_regexp = TRUE;
+    }
+    TRACE(("...making_pattern:%d\n", in_regexp));
+    return in_regexp;
+}
+
+/*ARGSUSED*/
+static int
+eol_range(EOL_ARGS)
+{
+    int result = FALSE;
+
+    (void) eolchar;
+
+    if (is_edit_char(c)) {
+	result = FALSE;
+    } else if (isSpecial(c) || isCntrl(c)) {
+	result = TRUE;
+    } else if (islinespecchar(c)
+	       || (c == ':' && (cpos == 0 || buffer[cpos - 1] == c))
+	       || making_mark(buffer, cpos, c, eolchar)
+	       || making_pattern(buffer, cpos, c, eolchar)) {
+	result = FALSE;
+    } else {
+	result = TRUE;
+    }
+    return result;
+}
+
 /*
  * Returns true iff the user ended the last prompt with a carriage-return.
  */
@@ -531,213 +868,17 @@
 namedcmd(int f, int n)
 {
     int status;
+
     hst_init(EOS);
     status = execute_named_command(f, n);
     hst_flush();
-    return status;
-}
-#endif
-
-/*
- * parse an ex-style line spec -- code originally from elvis, file ex.c, by
- * Steve Kirkendall
- */
-static const char *
-parse_linespec(const char *s, LINE **markptr)
-{
-    int num;
-    LINE *lp;			/* where the linespec takes us */
-    const char *t;
-    int status;
-
-    (void) setmark();
-    lp = NULL;
-
-    /* parse each ;-delimited clause of this linespec */
-    do {
-	/* skip an initial ';', if any */
-	if (*s == ';')
-	    s++;
 
-	/* skip leading spaces */
-	while (isBlank(*s))
-	    s++;
+    if (clexec)
+	map_drain();		/* don't let stray characters go too far */
 
-	/* dot means current position */
-	if (*s == '.') {
-	    s++;
-	    lp = DOT.l;
-	} else if (*s == '$') {	/* '$' means the last line */
-	    s++;
-	    status = gotoeob(TRUE, 1);
-	    if (status)
-		lp = DOT.l;
-	} else if (isDigit(*s)) {
-	    /* digit means an absolute line number */
-	    for (num = 0; isDigit(*s); s++) {
-		num = num * 10 + *s - '0';
-	    }
-	    status = gotoline(TRUE, num);
-	    if (status)
-		lp = DOT.l;
-	} else if (*s == SQUOTE) {
-	    /* apostrophe means go to a set mark */
-	    s++;
-	    status = gonmmark(*s);
-	    if (status)
-		lp = DOT.l;
-	    s++;
-	} else if (*s == '+') {
-	    s++;
-	    for (num = 0; isDigit(*s); s++)
-		num = num * 10 + *s - '0';
-	    if (num == 0)
-		num++;
-	    while (*s == '+')
-		s++, num++;
-	    status = forwline(TRUE, num);
-	    if (status)
-		lp = DOT.l;
-	} else if (*s == '-') {
-	    s++;
-	    for (num = 0; isDigit(*s); s++)
-		num = num * 10 + *s - '0';
-	    if (num == 0)
-		num++;
-	    while (*s == '-')
-		s++, num++;
-	    status = forwline(TRUE, -num);
-	    if (status)
-		lp = DOT.l;
-	}
-#if VILE_MAYBE
-	else if (*s == '/' || *s == '?') {	/* slash means do a search */
-	    /* put a null at the end of the search pattern */
-	    t = parseptrn(s);
-
-	    /* search for the pattern */
-	    lp &= ~(BLKSIZE - 1);
-	    if (*s == '/') {
-		pfetch(markline(lp));
-		if (plen > 0)
-		    lp += plen - 1;
-		lp = m_fsrch(lp, s);
-	    } else {
-		lp = m_bsrch(lp, s);
-	    }
-
-	    /* adjust command string pointer */
-	    s = t;
-	}
-#endif
-	else if (*s == EOS) {	/* empty string matches '.' */
-	    lp = DOT.l;
-	}
-
-	/* if linespec was faulty, quit now */
-	if (!lp) {
-	    *markptr = lp;
-	    swapmark();
-	    return s;
-	}
-
-	/* maybe add an offset */
-	t = s;
-	if (*t == '-' || *t == '+') {
-	    s++;
-	    for (num = 0; isDigit(*s); s++) {
-		num = num * 10 + *s - '0';
-	    }
-	    if (num == 0)
-		num = 1;
-	    if (forwline(TRUE, (*t == '+') ? num : -num) == TRUE)
-		lp = DOT.l;
-	}
-    } while (*s == ';' || *s == '+' || *s == '-');
-
-    *markptr = lp;
-    swapmark();
-    return s;
-}
-
-/*
- * parse an ex-style line range -- code originally from elvis, file ex.c, by
- * Steve Kirkendall
- */
-static int
-rangespec(const char *specp, LINE **fromlinep, LINE **tolinep,
-	  CMDFLAGS * flagp)
-{
-    const char *scan;		/* used to scan thru specp */
-    LINE *fromline;		/* first linespec */
-    LINE *toline;		/* second linespec */
-
-    *flagp = 0;
-
-    if (specp == 0)
-	return FALSE;
-
-    /* ignore command lines that start with a double-quote */
-    if (*specp == '"') {
-	*fromlinep = *tolinep = DOT.l;
-	return TRUE;
-    }
-
-    /* permit extra colons at the start of the line */
-    while (isBlank(*specp) || *specp == ':') {
-	specp++;
-    }
-
-    /* parse the line specifier */
-    scan = specp;
-    if (*scan == '0') {
-	fromline = toline = buf_head(curbp);	/* _very_ top of buffer */
-	*flagp |= (FROM | ZERO);
-	scan++;
-    } else if (*scan == '%') {
-	/* '%' means all lines */
-	fromline = lforw(buf_head(curbp));
-	toline = lback(buf_head(curbp));
-	scan++;
-	*flagp |= (FROM | TO);
-    } else {
-	scan = parse_linespec(scan, &toline);
-	*flagp |= FROM;
-	if (toline == 0)
-	    toline = DOT.l;
-	fromline = toline;
-	while (*scan == ',') {
-	    fromline = toline;
-	    scan++;
-	    scan = parse_linespec(scan, &toline);
-	    *flagp |= TO;
-	    if (toline == 0) {
-		/* faulty line spec */
-		return FALSE;
-	    }
-	}
-    }
-
-    if (is_empty_buf(curbp))
-	fromline = toline = 0;
-
-    if (scan == specp)
-	*flagp |= DFLALL;
-
-    /* skip whitespace */
-    while (isBlank(*scan))
-	scan++;
-
-    if (*scan) {
-	/* dbgwrite("crud at end %s (%s)",specp, scan); */
-	return FALSE;
-    }
-
-    *fromlinep = fromline;
-    *tolinep = toline;
-
-    return TRUE;
+    return status;
 }
+#endif
 
 /*
  * take a passed string as a command line and translate it to be executed as a
@@ -776,8 +917,11 @@
 	}
     } while (!*token);
 
-    /* if it doesn't look like a command (and command names can't
-     * be hidden in variables), then it must be a leading argument */
+    /*
+     * If it doesn't look like a command (and command names can't
+     * be hidden in variables), then it must be a leading argument, e.g., a
+     * repeat-count (CNT).
+     */
     if (toktyp(token) != TOK_LITSTR || isDigit(token[0])) {
 	f = TRUE;
 	n = strtol(tokval(token), 0, 0);
@@ -962,8 +1106,7 @@
 	return src;
 
     /* first scan past any whitespace in the source string */
-    while (isBlank(*src))
-	++src;
+    src = skip_blanks(src);
 
     /* scan through the source string, which may be quoted */
     while ((c = *src) != EOS) {
@@ -1055,6 +1198,17 @@
 		    break;
 		}
 	    } else {
+#if OPT_MODELINE
+		/*
+		 * Multiple settings on the line may be separated by colons.
+		 */
+		if (c == ':' && in_modeline) {
+		    if (actual != 0)
+			*actual = ' ';
+		    src++;
+		    break;
+		} else
+#endif
 		if (c == eolchar) {
 		    if (actual != 0)
 			*actual = *src;
@@ -1088,8 +1242,7 @@
     }
 
     /* scan past any whitespace remaining in the source string */
-    while (isBlank(*src))
-	++src;
+    src = skip_blanks(src);
     token_ended_line = isreturn(*src) || *src == EOS;
 
     tb_append(tok, EOS);
@@ -1444,7 +1597,7 @@
     if ((bp = find_b_name(bufn)) == NULL) {
 	return FALSE;
     }
-    return dobuf(bp, f ? n : 1);
+    return dobuf(bp, need_a_count(f, n, 1));
 
 }
 
@@ -1471,7 +1624,7 @@
 	return FALSE;
     }
 
-    return dobuf(bp, f ? n : 1);
+    return dobuf(bp, need_a_count(f, n, 1));
 }
 #endif
 
@@ -2411,6 +2564,7 @@
 
     static int dobufnesting;	/* flag to prevent runaway recursion */
 
+    TRACE((T_CALLED "dobuf(%s, %d)\n", bp->b_bname, limit));
     beginDisplay();
     if (++dobufnesting < 9) {
 
@@ -2497,7 +2651,7 @@
 
     endofDisplay();
 
-    return status;
+    returnCode(status);
 }
 
 /*
@@ -2662,7 +2816,7 @@
 	return FALSE;
     }
 
-    return dobuf(bp, f ? n : 1);
+    return dobuf(bp, need_a_count(f, n, 1));
 }
 
 #include "neexec.h"
Index: file.c
Prereq:  1.395 
--- vile-9.5k+/file.c	2006-09-24 23:57:43.000000000 +0000
+++ vile-9.5l/file.c	2006-10-25 22:01:24.000000000 +0000
@@ -5,7 +5,7 @@
  * reading and writing of the disk are
  * in "fileio.c".
  *
- * $Header: /usr/build/vile/vile/RCS/file.c,v 1.395 2006/09/24 23:57:43 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/file.c,v 1.396 2006/10/25 22:01:24 tom Exp $
  */
 
 #include "estruct.h"
@@ -1688,6 +1688,12 @@
     if (lockfl && s != FIOERR)
 	grab_lck_file(bp, fname);
 #endif
+#if OPT_MODELINE
+    /* do this before the $read-hook, so one can set a majormode in the
+     * modeline, causing the file to be colored.
+     */
+    do_modelines(bp);
+#endif
 #if OPT_HOOKS
     if (s <= FIOEOF && (bp == curbp))
 	run_readhook();
Index: filters/filters.h
Prereq:  1.96 
--- vile-9.5k+/filters/filters.h	2006-01-09 20:23:38.000000000 +0000
+++ vile-9.5l/filters/filters.h	2006-10-03 00:12:43.000000000 +0000
@@ -1,5 +1,5 @@
 /*
- * $Header: /usr/build/vile/vile/filters/RCS/filters.h,v 1.96 2006/01/09 20:23:38 tom Exp $
+ * $Header: /usr/build/vile/vile/filters/RCS/filters.h,v 1.97 2006/10/03 00:12:43 tom Exp $
  */
 
 #ifndef FILTERS_H
@@ -250,7 +250,8 @@
 extern char *vile_getenv(const char *name);
 
 #define WriteToken(attr) flt_puts(yytext, yyleng, attr)
-#define WriteToken2(attr,len) flt_puts(yytext+len, yyleng-len, attr)
+#define WriteToken2(attr,len) flt_puts(yytext + (len), yyleng - (len), attr)
+#define WriteToken3(attr,len) flt_puts(yytext, (len), attr)
 
 #define BeginQuote(state, attr) \
 			BEGIN(state); \
Index: filters/lua-filt.l
Prereq:  1.5 
--- vile-9.5k+/filters/lua-filt.l	2006-05-21 19:50:19.000000000 +0000
+++ vile-9.5l/filters/lua-filt.l	2006-11-06 00:54:43.000000000 +0000
@@ -2,7 +2,7 @@
 
 %{
 /*
- * $Header: /usr/build/vile/vile/filters/RCS/lua-filt.l,v 1.5 2006/05/21 19:50:19 tom Exp $
+ * $Header: /usr/build/vile/vile/filters/RCS/lua-filt.l,v 1.6 2006/11/06 00:54:43 tom Exp $
  *
  * Filter to add vile "attribution" sequences to selected bits of lua
  * input text.
@@ -42,14 +42,14 @@
 
 <INITIAL>"--"{LONG_L}	{ WriteToken(Comment_attr); push_state(LONG_CMT); long_str = yyleng - 2; }
 <LONG_CMT>{LONG_R}	{ WriteToken(Comment_attr); if (yyleng == long_str) pop_state(); }
-<LONG_CMT>[^[=\]]+	{ WriteToken(Comment_attr); }
+<LONG_CMT>[^[]=]+	{ WriteToken(Comment_attr); }
 <LONG_CMT>.		{ WriteToken(Comment_attr); }
 
 <INITIAL>"--"[^\r\n]*	{ WriteToken(Comment_attr); }
 
 <INITIAL>{LONG_L}	{ WriteToken(String_attr); push_state(LONG_STR); long_str = yyleng; }
 <LONG_STR>{LONG_R}	{ WriteToken(String_attr); if (yyleng == long_str) pop_state(); }
-<LONG_STR>[^[=\]]+	{ WriteToken(String_attr); }
+<LONG_STR>[^[]=]+	{ WriteToken(String_attr); }
 <LONG_STR>.		{ WriteToken(String_attr); }
 
 %%
Index: filters/tc-filt.l
Prereq:  1.26 
--- vile-9.5k+/filters/tc-filt.l	2006-05-30 20:24:21.000000000 +0000
+++ vile-9.5l/filters/tc-filt.l	2006-11-06 00:57:48.000000000 +0000
@@ -1,17 +1,22 @@
-%s DESC GAPS CAPS VALS LINK
+%s NAME DESC GAPS CAPS VALS LINK
 
 %{
 
 /*
- * $Header: /usr/build/vile/vile/filters/RCS/tc-filt.l,v 1.26 2006/05/30 20:24:21 tom Exp $
+ * $Header: /usr/build/vile/vile/filters/RCS/tc-filt.l,v 1.30 2006/11/06 00:57:48 tom Exp $
  *
  * Filter to add vile "attribution" sequences to selected bits of termcap
  */
 
 #include <filters.h>
+#undef YY_NO_UNPUT
 
 DefineFilter("tc");
 
+#define WriteAlias(attr) \
+	WriteToken3(attr, yyleng - 1); \
+	WriteToken2(String_attr, yyleng - 1)
+
 static char *Action_attr;
 static char *Comment_attr;
 static char *Error_attr;
@@ -34,20 +39,33 @@
 ALIAS		[[:alnum:]_\.+-]+
 
 NUMBER		"#"[[:digit:]]+
-STRING		[^#:\\\r\n](\\[.\n]|[^:\r\n])*
+
+GAPS		\\[\n]([[:blank:]]*)
+CNTRL		"^"(([\\][\\]?)|[][[:alnum:]@^~_?])
+ESCAPE		[\\][[:print:]]
+STRING		({CNTRL}|{ESCAPE}|[^#:^\\\r\n])({CNTRL}|{ESCAPE}|[^:^\\\r\n]|{GAPS})*
+STRINGER	({CNTRL}|{ESCAPE})({CNTRL}|{ESCAPE}|[^:^\\\r\n]|{GAPS})*
 
 %%
 
 ^"#"[^\r\n]*			{ WriteToken(Comment_attr); }
 \n\n				{ ECHO; BEGIN(INITIAL); }
 
-^({ALIAS}"|"|(\\\n\t)*)*	{ WriteToken(Ident_attr); BEGIN(DESC); }
+^{ALIAS}"|"			{ WriteAlias(Ident_attr); BEGIN(NAME); }
+<NAME>{ALIAS}"|"		{ WriteAlias(Ident_attr); }
+<NAME>(\\\n\t)+			{ ECHO; }
+<NAME>":"			{ ECHO; BEGIN(GAPS); }
+<NAME>.				{ unput(yytext[0]); BEGIN(DESC); }
 ^{ALIAS}			{ WriteToken(Ident_attr); BEGIN(GAPS); }
 
 <DESC>[^:\r\n]*			{ WriteToken(Comment_attr); BEGIN(GAPS); }
 <GAPS,VALS>(:|:\\\n\t)+		{ commented=0; ECHO; BEGIN(CAPS); }
 <GAPS,CAPS>\n(\t)+		{ flt_error("unexpected whitespace");
 				  WriteToken(Error_attr); }
+<GAPS,CAPS>{GAPS}		{ ECHO; }
+<GAPS,CAPS>{STRINGER}		{ flt_error("unexpected string");
+				  WriteToken(Error_attr); }
+
 <CAPS>{CAPNAME}			{ write_capname(yytext, yyleng); begin_value(yytext); }
 <CAPS>{DOTNAME}			{ WriteToken(Comment_attr); commented = 1; begin_value(yytext); }
 <VALS>{NUMBER}			{ write_value(yytext, yyleng, Number_attr); }
Index: filters/ti-filt.l
Prereq:  1.18 
--- vile-9.5k+/filters/ti-filt.l	2006-05-21 19:50:48.000000000 +0000
+++ vile-9.5l/filters/ti-filt.l	2006-10-03 20:57:52.000000000 +0000
@@ -1,17 +1,22 @@
-%s DESC GAPS CAPS VALS
+%s NAME DESC GAPS CAPS VALS
 
 %{
 
 /*
- * $Header: /usr/build/vile/vile/filters/RCS/ti-filt.l,v 1.18 2006/05/21 19:50:48 tom Exp $
+ * $Header: /usr/build/vile/vile/filters/RCS/ti-filt.l,v 1.21 2006/10/03 20:57:52 tom Exp $
  *
  * Filter to add vile "attribution" sequences to selected bits of terminfo
  */
 
 #include <filters.h>
+#undef YY_NO_UNPUT
 
 DefineFilter("ti");
 
+#define WriteAlias(attr) \
+	WriteToken3(attr, yyleng - 1); \
+	WriteToken2(String_attr, yyleng - 1)
+
 static char *Action_attr;
 static char *Comment_attr;
 static char *Number_attr;
@@ -31,7 +36,7 @@
 CAPNAME		[[:alpha:]][[:alnum:]_]*
 DOTNAME		\.{CAPNAME}
 
-ALIAS		[[:alnum:]_\.+-]+
+ALIAS		[[:alnum:]][[:alnum:] _\.+-]*
 
 COMMA		[,]
 ESCNL		{COMMA}{SPACE}*\\\n\t
@@ -47,8 +52,11 @@
 				  flt_putc(',');
 				  BEGIN(CAPS);
 				}
-^({ALIAS}"|")+			{ WriteToken(Ident_attr); BEGIN(DESC); }
-<DESC>[^,\r\n]*			{ WriteToken(Comment_attr); BEGIN(GAPS); }
+^({ALIAS}"|")			{ WriteAlias(Ident_attr); BEGIN(NAME); }
+<NAME>({ALIAS}"|")		{ WriteAlias(Ident_attr); }
+<NAME>.				{ unput(yytext[0]); BEGIN(DESC); }
+<DESC>[^,\r\n]+			{ WriteToken(Comment_attr); BEGIN(GAPS); }
+<DESC>.				{ unput(yytext[0]); BEGIN(GAPS); }
 <GAPS,VALS>({COMMA}|{ESCNL})*	{ commented = 0; ECHO; BEGIN(CAPS); }
 <CAPS>{CAPNAME}			{ WriteToken(check_name(yytext)); BEGIN(VALS); }
 <CAPS>{DOTNAME}			{ WriteToken(Comment_attr); commented = 1; BEGIN(VALS); }
Index: filters/txt-filt.l
Prereq:  1.23 
--- vile-9.5k+/filters/txt-filt.l	2006-05-21 19:50:48.000000000 +0000
+++ vile-9.5l/filters/txt-filt.l	2006-10-29 20:33:08.000000000 +0000
@@ -1,16 +1,17 @@
-%s NORMAL QUOTED QUOTES
+%s TEXT NOTE QUOTED QUOTES
 
 %o 6000
 
 %{
 
 /*
- * $Header: /usr/build/vile/vile/filters/RCS/txt-filt.l,v 1.23 2006/05/21 19:50:48 tom Exp $
+ * $Header: /usr/build/vile/vile/filters/RCS/txt-filt.l,v 1.29 2006/10/29 20:33:08 tom Exp $
  *
  * Filter to add vile "attribution" sequences to an ordinary text file
  */
 
 #include <filters.h>
+#include <fltstack.h>
 
 DefineFilter("txt");
 
@@ -24,7 +25,7 @@
 
 %}
 
-COMMENT		(^(-[-]+[ \t]+[^\r\n]+))|([ \t]*-[ \t-]*)\n
+DASHES		(-([[:blank:]]-)+)
 
 KEYWORD		([[:alpha:]_][[:alnum:]_.]*|[[:upper:]][+/&][[:upper:]])
 
@@ -32,9 +33,11 @@
 DECIMAL		[[:digit:]_]+
 OCTAL		0[0-7_]+
 HEXADECIMAL	0x[[:xdigit:]_]+
-REAL		[-+]?([[:digit:]_]*\.[[:digit:]][[:digit:]_]*)([eE][+-]?[[:digit:]_]+)?
+REAL		([[:digit:]_]*\.[[:digit:]][[:digit:]_]*)([eE]{SIGN}?[[:digit:]_]+)?
 NUMBER		{SIGN}?({DECIMAL}|{OCTAL}|{HEXADECIMAL}|{REAL})
 
+IDENT		"$"{KEYWORD}:[^$\r\n]+"$"
+
 NAME		[[:alnum:]_.#-]+
 ADDRESS		({NAME}|\.)+
 EMAIL		{NAME}@{ADDRESS}
@@ -43,33 +46,48 @@
 
 %%
 
-<NORMAL>[[:upper:]]\'{KEYWORD} { ECHO; }
+<TEXT>[[:upper:]]\'{KEYWORD} { ECHO; }
 
-<NORMAL>{KEYWORD}	{ WriteToken(mixedcase(yytext) ? "" : Keyword_attr); }
-<NORMAL>{COMMENT}	{ WriteToken(Comment_attr); }
-<NORMAL>{NUMBER}	{ WriteToken(Number_attr); }
-<NORMAL>{EMAIL}		{ WriteToken(Ident2_attr); }
-<NORMAL>{URL}		{ WriteToken(Ident2_attr); }
+<TEXT>^[[:blank:]]*"--"[[:blank:]]	{ PushQuote(NOTE, Comment_attr); }
+<TEXT>^[-]+$		|
+<TEXT>{DASHES}		{ WriteToken(Comment_attr); }
+<TEXT>{KEYWORD}		{ WriteToken(mixedcase(yytext) ? "" : Keyword_attr); }
+<TEXT>{NUMBER}		{ WriteToken(Number_attr); }
+<TEXT>{EMAIL}		{ WriteToken(Ident2_attr); }
+<TEXT>{URL}		{ WriteToken(Ident2_attr); }
+<TEXT>{IDENT}		{ WriteToken(Ident2_attr); }
 
 <QUOTES,QUOTED>{EMAIL}	{ flt_bfr_embed(yytext, yyleng, Ident2_attr); }
 <QUOTES,QUOTED>{URL}	{ flt_bfr_embed(yytext, yyleng, Ident2_attr); }
+<QUOTES,QUOTED>{IDENT}	{ flt_bfr_embed(yytext, yyleng, Ident2_attr); }
 
-<NORMAL>\(\"\)		|
-<NORMAL>\'.\'		{ ECHO; }
+<TEXT>\(\"\)		|
+<TEXT>\'.\'		{ ECHO; }
 
-<NORMAL>\"		{ BeginQuote(QUOTED, String_attr); }
-<QUOTED>\"		{ FinishQuote(NORMAL); }
+<TEXT,NOTE>\"		{ PushQuote(QUOTED, String_attr); }
+<QUOTED>\"		{ PopQuote(); }
 <QUOTED>.		{ flt_bfr_append(yytext, yyleng); }
-<QUOTED>^[\n]		{ FinishQuote(NORMAL); }
+<QUOTED>^[\n]		{ PopQuote(); }
 <QUOTED>[\n]		{ flt_bfr_append(yytext, yyleng); }
 
-<NORMAL>\`\`		{ BeginQuote(QUOTES, String_attr); }
-<QUOTES>\'\'		{ FinishQuote(NORMAL); }
+<TEXT,NOTE>\`\`		{ PushQuote(QUOTES, String_attr); }
+<QUOTES>\'\'		{ PopQuote(); }
 <QUOTES>.		{ flt_bfr_append(yytext, yyleng); }
-<QUOTES>^[\n]		{ FinishQuote(NORMAL); }
+<QUOTES>^[\n]		{ PopQuote(); }
 <QUOTES>[\n]		{ flt_bfr_append(yytext, yyleng); }
 
-<NORMAL>.		{ ECHO; }
+<TEXT>[\r\n]		{ ECHO; }
+<TEXT>.			{ ECHO; }
+
+<NOTE>[\r\n]		{ PopQuote(); }
+<NOTE>{KEYWORD}		{ flt_bfr_embed(yytext, yyleng, mixedcase(yytext) ? Comment_attr : Keyword_attr); }
+<NOTE>{NUMBER}		{ flt_bfr_embed(yytext, yyleng, Number_attr); }
+<NOTE>{EMAIL}		{ flt_bfr_embed(yytext, yyleng, Ident2_attr); }
+<NOTE>{URL}		{ flt_bfr_embed(yytext, yyleng, Ident2_attr); }
+<NOTE>{IDENT}		{ flt_bfr_embed(yytext, yyleng, Ident2_attr); }
+<NOTE>\(\"\)		|
+<NOTE>\'.\'		|
+<NOTE>.			{ flt_puts(yytext, yyleng, Comment_attr); }
 
 %%
 
@@ -103,8 +121,9 @@
     Number_attr  = class_attr(NAME_NUMBER);
     String_attr  = class_attr(NAME_LITERAL);
 
-    BEGIN(NORMAL);
+    begin_state(TEXT);
     while (yylex() > 0) {
     }
     flt_bfr_finish();
+    end_state();
 }
Index: globals.c
Prereq:  1.48 
--- vile-9.5k+/globals.c	2004-04-11 23:24:54.000000000 +0000
+++ vile-9.5l/globals.c	2006-11-06 21:00:51.000000000 +0000
@@ -1,8 +1,8 @@
 /* ed/vi/ex style global commands, where first the file is scanned for
  *	matching lines, then for each such line, an action is performed.
- *	written for vile: Copyright (c) 1990-1999 by Paul Fox
+ *	written for vile.  Copyright (c) 1990-1999 by Paul Fox
  *
- * $Header: /usr/build/vile/vile/RCS/globals.c,v 1.48 2004/04/11 23:24:54 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/globals.c,v 1.49 2006/11/06 21:00:51 tom Exp $
  *
  */
 
Index: history.c
Prereq:  1.84 
--- vile-9.5k+/history.c	2006-05-21 10:53:43.000000000 +0000
+++ vile-9.5l/history.c	2006-11-06 00:42:29.000000000 +0000
@@ -55,7 +55,7 @@
  *	not (yet) correspond to :-commands.  Before implementing, probably will
  *	have to make TESTC a settable mode.
  *
- * $Header: /usr/build/vile/vile/RCS/history.c,v 1.84 2006/05/21 10:53:43 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/history.c,v 1.85 2006/11/06 00:42:29 tom Exp $
  *
  */
 
@@ -200,7 +200,7 @@
 		    }
 		} else
 #endif
-		if ((*parm->endfunc) (src, n, src[n], parm->eolchar))
+		if ((parm->endfunc) (src, n, src[n], parm->eolchar))
 		    break;
 	    }
 	}
@@ -531,7 +531,7 @@
 static void
 hst_display(HST * parm, char *src, int srclen)
 {
-    TRACE(("hst_display(%.*s) eolchar='%c'\n",
+    TRACE((T_CALLED "hst_display(%.*s) eolchar='%c'\n",
 	   srclen, src,
 	   isreturn(parm->eolchar) ? ' ' : parm->eolchar));
 
@@ -568,6 +568,7 @@
 	    free(stripped);
 #endif
     }
+    returnVoid();
 }
 
 /*
Index: insert.c
Prereq:  1.143 
--- vile-9.5k+/insert.c	2005-07-13 23:42:48.000000000 +0000
+++ vile-9.5l/insert.c	2006-11-06 21:26:32.000000000 +0000
@@ -7,7 +7,7 @@
  * Most code probably by Dan Lawrence or Dave Conroy for MicroEMACS
  * Extensions for vile by Paul Fox
  *
- * $Header: /usr/build/vile/vile/RCS/insert.c,v 1.143 2005/07/13 23:42:48 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/insert.c,v 1.147 2006/11/06 21:26:32 tom Exp $
  *
  */
 
@@ -106,8 +106,7 @@
     int i;
     int flag = FALSE;
 
-    if (!f || n < 0)
-	n = 1;
+    n = need_at_least(f, n, 1);
 
     for (i = 0; i < n; i++) {
 	if ((status = ins_anytime((i != 0), i, n, &flag)) != TRUE)
@@ -124,8 +123,8 @@
 {
     int s;
 
-    if (!f)
-	n = 1;
+    n = need_a_count(f, n, 1);
+
     if (n < 0)
 	return (FALSE);
     if (n == 0)
@@ -162,6 +161,36 @@
 }
 
 /*
+ * Implements the nvi/vim ex "i!" command.
+ */
+int
+openup_i(int f, int n)
+{
+    int s;
+    int oallow = allow_aindent;
+
+    allow_aindent = !oallow;
+    s = openup(f, n);
+    allow_aindent = oallow;
+    return s;
+}
+
+/*
+ * Implements the nvi/vim ex "c!" command.
+ */
+int
+operchg_i(int f, int n)
+{
+    int s;
+    int oallow = allow_aindent;
+
+    allow_aindent = !oallow;
+    s = operchg(f, n);
+    allow_aindent = oallow;
+    return s;
+}
+
+/*
  * as above, but override all autoindenting and cmode-ing
  */
 int
@@ -181,8 +210,8 @@
 {
     int s;
 
-    if (!f)
-	n = 1;
+    n = need_a_count(f, n, 1);
+
     if (n < 0)
 	return (FALSE);
     if (n == 0)
@@ -281,6 +310,22 @@
 }
 
 /*
+ * Implements the nvi/vim ex "a!" command.
+ */
+int
+append_i(int f, int n)
+{
+    int code;
+    int mode = allow_aindent;
+
+    allow_aindent = !allow_aindent;
+    code = opendown(f, n);
+    allow_aindent = mode;
+
+    return code;
+}
+
+/*
  * Implements the vi 'A' command.
  */
 int
@@ -370,8 +415,8 @@
     }
     c = kcod2key(c);
 
-    if (!f || !n)
-	n = 1;
+    n = need_a_count(f, n, 1);
+
     if (n < 0)
 	s = FALSE;
     else {
@@ -884,8 +929,7 @@
     if (status != TRUE)
 	return (status);
 
-    if (!f)
-	n = 1;
+    n = need_a_count(f, n, 1);
 
     if (n < 0)
 	n = -n;
@@ -930,9 +974,9 @@
 {
     int s;
 
-    if (!f)
-	n = 1;
-    else if (n < 0)
+    n = need_a_count(f, n, 1);
+
+    if (n < 0)
 	return (FALSE);
 
     /* if we are in C or auto-indent modes and this is a default <NL> */
@@ -1185,8 +1229,9 @@
 tab(int f, int n)
 {
     int ccol;
-    if (!f)
-	n = 1;
+
+    n = need_a_count(f, n, 1);
+
     if (n <= 0)
 	return FALSE;
 
@@ -1297,8 +1342,7 @@
 {
     int c, s;
 
-    if (!f)
-	n = 1;
+    n = need_a_count(f, n, 1);
     c = read_quoted(n, TRUE);
 
     if (c < 0) {
Index: line.c
Prereq:  1.171 
--- vile-9.5k+/line.c	2006-04-20 00:09:10.000000000 +0000
+++ vile-9.5l/line.c	2006-11-02 01:44:56.000000000 +0000
@@ -10,7 +10,7 @@
  * editing must be being displayed, which means that "b_nwnd" is non zero,
  * which means that the dot and mark values in the buffer headers are nonsense.
  *
- * $Header: /usr/build/vile/vile/RCS/line.c,v 1.171 2006/04/20 00:09:10 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/line.c,v 1.172 2006/11/02 01:44:56 tom Exp $
  *
  */
 
@@ -1312,8 +1312,7 @@
 {
     int s, oukb;
 
-    if (!f)
-	n = 1;
+    n = need_a_count(f, n, 1);
 
     oukb = ukb;
     kregcirculate(FALSE);	/* cf: 'index2ukb()' */
@@ -1631,9 +1630,9 @@
     char *sp;
     KILL *tkp;
 
-    if (!f)
-	n = 1;
-    else if (n <= 0)
+    n = need_a_count(f, n, 1);
+
+    if (n <= 0)
 	return TRUE;
 
     if ((status = mlreply_reg("Execute register: ", cbuf, &c, lastreg)) != TRUE)
Index: macros/modes.rc
Prereq:  1.47 
--- vile-9.5k+/macros/modes.rc	2006-08-09 22:44:23.000000000 +0000
+++ vile-9.5l/macros/modes.rc	2006-10-28 15:52:29.000000000 +0000
@@ -1,4 +1,4 @@
-; $Id: modes.rc,v 1.47 2006/08/09 22:44:23 tom Exp $
+; $Id: modes.rc,v 1.49 2006/10/28 15:52:29 tom Exp $
 ; majormodes in this file are ordered alphabetically for convenience - the
 ; precedence used by vile is strictly alphabetic, counting case.  Use the
 ; before and after qualifiers to override the precedence.
@@ -469,7 +469,7 @@
 
 define-mode make
 ~with define-submode make
-	mode-filename	'^\([Mm]akefile.*\|make\..*\|.*\.mak\|.*\.mk\)$'
+	mode-filename	'^\([Mm]akefile.*\|make\..*\|.*\.mak\|.*\.mk\|Jamdefs.*\|Jamfile\)$'
 	comment-prefix	'^\s*[!#]'
 	comments	'^\s*[!#]\s*$'
 ~elsewith define-submode make group 'gnumake'
@@ -595,7 +595,7 @@
 ; Python
 define-mode py
 ~with define-submode py
-	pre '^\(\(#!\s*\/.*python[\d_.-]*\>\(\s*[-]\+[\a]*\s*\)\?\)\|:\)\s*$'
+	pre '^\(\(#!\s*\/.*python[\d_.-]*\>\)\(\(\s*[-]\+[\a]*\s*\)\?\|:\)\)\s*$'
 	suffixes	'\.py$'
 	comment-prefix '^\s*#'
 	comments   '^\s*#\s\+\s*$'
@@ -667,9 +667,10 @@
 ~endwith
 
 ; This is matched after 'csh', and will pick up /bin/sh, /bin/bash, /bin/ksh
+; FIXME "Jamrules" is something like sh, but uses different rules for "^", etc.
 define-mode sh
 ~with define-submode sh
-	mode-filename	'^[a-z.-]*profile$'
+	mode-filename	'^\(\([a-z.-]*profile\)\|Jamrules\)$'
 	suffixes	'\(\.\(sh\|ksh\|shar\|.*rc\|bash_[a-z]\+\|ebuild\)$\)'
 	pre '^\(\(#!\s*\/.*sh\>\(\s*[-]\+[\a]*\s*\)\?\)\|:\)\s*$'
 	comment-prefix	'^\s*[:#]'
Index: macros/which.rc
Prereq:  1.14 
--- vile-9.5k+/macros/which.rc	2004-12-16 00:48:32.000000000 +0000
+++ vile-9.5l/macros/which.rc	2006-10-25 22:37:36.000000000 +0000
@@ -1,4 +1,4 @@
-;; $Header: /usr/build/vile/vile/macros/RCS/which.rc,v 1.14 2004/12/16 00:48:32 tom Exp $
+;; $Header: /usr/build/vile/vile/macros/RCS/which.rc,v 1.15 2006/10/25 22:37:36 tom Exp $
 ;;
 ;; Show where vile looks for keyword file, and where it finds it.  If we
 ;; always implemented built-in filters, the natural place for this would be
@@ -179,9 +179,6 @@
 
 ~if &seq $progname "xvile"
 store-procedure which-menu "Display location of menu file"
-	~if &seq '' $1
-		~return
-	~endif
 	~local %path %leaf %suffix %pathdot %dothides %index %mybuffer %found %dotname
 	setv %found="no"
 	~local $report $terse
Index: main.c
Prereq:  1.551 
--- vile-9.5k+/main.c	2006-05-21 00:22:10.000000000 +0000
+++ vile-9.5l/main.c	2006-11-06 20:52:12.000000000 +0000
@@ -17,12 +17,12 @@
  * distributable status.  This version of vile is distributed under the
  * terms of the GNU Public License (see COPYING).
  *
- * Copyright (c) 1992-2005 by Paul Fox and Thomas Dickey
+ * Copyright (c) 1992-2006 by Paul Fox and Thomas Dickey
  *
  */
 
 /*
- * $Header: /usr/build/vile/vile/RCS/main.c,v 1.551 2006/05/21 00:22:10 cmorgan Exp $
+ * $Header: /usr/build/vile/vile/RCS/main.c,v 1.568 2006/11/06 20:52:12 tom Exp $
  */
 
 #define realdef			/* Make global definitions not external */
@@ -116,6 +116,98 @@
 
 /*--------------------------------------------------------------------------*/
 
+static void
+save_buffer_state(BUFFER **save_bp, UINT * save_flags)
+{
+    *save_bp = curbp;
+    if (*save_bp) {
+	*save_flags = (*save_bp)->b_flag;
+	/* mark as modified, to prevent undispbuff() from clobbering */
+	b_set_changed(*save_bp);
+    }
+}
+
+static void
+restore_buffer_state(BUFFER *save_bp, UINT save_flags)
+{
+    if (save_bp) {
+	swbuffer(save_bp);
+	save_bp->b_flag = save_flags;
+    }
+}
+
+static int
+run_startup_commands(BUFFER *cmds)
+{
+    int result = TRUE;
+    BUFFER *save_bp = NULL;	/* saves curbp when doing startup commands */
+    LINE *lp;
+    UINT save_flags = 0;	/* saves curbp's flags when doing startup */
+
+    TRACE((T_CALLED "run_startup_commands %s\n", cmds->b_bname));
+
+    save_buffer_state(&save_bp, &save_flags);
+
+    /* remove blank lines to make the trace simpler */
+    for (lp = lforw(buf_head(cmds)); lp != buf_head(cmds);) {
+	LINE *nlp = lforw(lp);
+
+	if (lisreal(lp) && !llength(lp)) {
+	    lremove(cmds, lp);
+	}
+	lp = nlp;
+    }
+
+    /* don't want swbuffer to try to read it */
+    cmds->b_active = TRUE;
+    set_rdonly(cmds, cmds->b_fname, MDVIEW);
+
+    /* go execute it! */
+    if (dobuf(cmds, 1) != TRUE) {
+	result = FALSE;
+    }
+    /* if we managed to load a buffer, don't go back to the unnamed buffer */
+    if (cmds != save_bp
+	&& eql_bname(save_bp, UNNAMED_BufName)
+	&& is_empty_buf(save_bp)
+	&& save_bp->b_nwnd == 0
+	&& !b_is_scratch(curbp)) {
+	b_clr_changed(save_bp);
+	(void) zotbuf(save_bp);
+    } else {
+	restore_buffer_state(save_bp, save_flags);
+    }
+    if (result) {		/* remove the now unneeded buffer */
+	b_set_scratch(cmds);	/* make sure it will go */
+	(void) zotbuf(cmds);
+    }
+
+    returnCode(result);
+}
+
+static void
+setup_command(BUFFER *opts_bp, char *param)
+{
+    char *p1;
+    char *p2;
+    /*
+     * Check for special cases where a leading number should be treated
+     * as a repeat-count (see docmd(), which does something similar).
+     */
+    param = skip_blanks(param);
+    p1 = skip_number(param);
+    if (p1 != param) {		/* we found a number */
+	p2 = skip_blanks(p1);
+	if (*p2 == '*' || *p2 == ':') {
+	    b2printf(opts_bp, "%.*s ", p1 - param, param);
+	    param = skip_blanks(p2 + 1);
+	}
+    }
+    b2printf(opts_bp, "execute-named-command %s\n", param);
+}
+
+/*--------------------------------------------------------------------------*/
+
 int
 MainProgram(int argc, char *argv[])
 {
@@ -125,11 +217,9 @@
     char *vileinit = NULL;	/* the startup file or VILEINIT var */
     int startstat = TRUE;	/* result of running startup */
     BUFFER *havebp = NULL;	/* initial buffer to read */
+    BUFFER *init_bp = NULL;	/* may contain startup commands */
+    BUFFER *opts_bp = NULL;	/* may contain startup commands */
     char *havename = NULL;	/* name of first buffer in cmd line */
-    int gotoflag = FALSE;	/* do we need to goto line at start? */
-    int gline = FALSE;		/* if so, what line? */
-    int helpflag = FALSE;	/* do we need help at start? */
-    REGEXVAL *search_exp = 0;	/* initial search-pattern */
     const char *msg;
 #if SYS_VMS
     char *init_descrip = NULL;
@@ -137,10 +227,6 @@
 #ifdef VILE_OLE
     int ole_register = FALSE;
 #endif
-#if OPT_TAGS
-    int didtag = FALSE;		/* look up a tag to start? */
-    char *tname = NULL;
-#endif
 #if DISP_NTCONS
     int new_console = FALSE;
 #endif
@@ -274,6 +360,15 @@
 #endif
 	tt_opened = open_terminal(&null_term);
 
+    /*
+     * Create buffers for storing command-line options.
+     */
+    if ((init_bp = bfind(VILEINIT_BufName, BFEXEC | BFINVS)) == 0)
+	tidy_exit(BADEXIT);
+
+    if ((opts_bp = bfind(VILEOPTS_BufName, BFEXEC | BFINVS)) == 0)
+	tidy_exit(BADEXIT);
+
     /* Parse the passed in parameters */
     for (carg = 1; carg < argc; ++carg) {
 	char *param = argv[carg];
@@ -299,8 +394,8 @@
 	    } else
 #endif /* screen resolution stuff */
 		switch (*param) {
-#if DISP_NTCONS
 		case 'c':
+#if DISP_NTCONS
 		    if (strcmp(param, "console") == 0) {
 			/*
 			 * start editor in a new console env if
@@ -310,28 +405,28 @@
 			 * unavailable (bug).
 			 */
 			new_console = TRUE;
-		    } else
-			print_usage(BADEXIT);
-		    break;
+			break;
+		    }
 #endif /* DISP_NTCONS */
+		    setup_command(opts_bp, GetArgVal(param));
+		    break;
 #if OPT_EVAL || OPT_DEBUGMACROS
 		case 'D':
+		    /* must be outside [vileinit] and [vileopts] */
 		    tracemacros = TRUE;
 		    break;
 #endif
 		case 'e':	/* -e for Edit file */
 		case 'E':
-		    set_global_b_val(MDVIEW, FALSE);
+		    b2printf(opts_bp, "set noview\n");
 		    break;
 		case 'g':	/* -g for initial goto */
 		case 'G':
-		    gotoflag = TRUE;
-		    param = GetArgVal(param);
-		    gline = atoi(param);
+		    b2printf(opts_bp, "%s goto-line\n", GetArgVal(param));
 		    break;
 		case 'h':	/* -h for initial help */
 		case 'H':
-		    helpflag = TRUE;
+		    b2printf(opts_bp, "help\n");
 		    break;
 
 		case 'i':
@@ -344,6 +439,7 @@
 		    if (cfg_locate(vileinit, LOCATE_SOURCE) != 0
 			&& cfg_locate(startup_file, LOCATE_SOURCE) == 0)
 			make_startup_file(vileinit);
+		    b2printf(init_bp, "source %s\n", vileinit);
 		    break;
 
 #if OPT_ENCRYPT
@@ -363,24 +459,20 @@
 #endif
 		case 's':	/* -s <pattern> */
 		case 'S':
-		  dosearch:
-		    param = GetArgVal(param);
-		    search_exp = new_regexval(param,
-					      global_b_val(MDMAGIC));
+		    b2printf(opts_bp, "search-forward %s\n", GetArgVal(param));
 		    break;
 #if OPT_TAGS
 		case 't':	/* -t for initial tag lookup */
 		case 'T':
-		    param = GetArgVal(param);
-		    tname = param;
+		    b2printf(opts_bp, "tag %s\n", GetArgVal(param));
 		    break;
 #endif
 		case 'v':	/* -v is view mode */
-		    set_global_b_val(MDVIEW, TRUE);
+		    b2printf(opts_bp, "set view\n");
 		    break;
 
 		case 'R':	/* -R is readonly mode */
-		    set_global_b_val(MDREADONLY, TRUE);
+		    b2printf(opts_bp, "set readonly\n");
 		    break;
 
 		case 'V':
@@ -399,18 +491,10 @@
 		}
 
 	} else if (*param == '+') {	/* alternate form of -g */
-	    if (*(++param) == '/') {
-		size_t len = strlen(param);
-		if (len != 0 && param[len - 1] == '/')
-		    param[--len] = EOS;
-		if (len == 0)
-		    print_usage(BADEXIT);
-		goto dosearch;
-	    }
-	    gotoflag = TRUE;
-	    gline = atoi(param);
+	    setup_command(opts_bp, GetArgVal(param));
 	} else if (*param == '@') {
 	    vileinit = ++param;
+	    b2printf(init_bp, "source %s\n", param);
 	} else if (*param != EOS) {
 
 	    /* must be a filename */
@@ -627,58 +711,35 @@
     fix_cmode(bp, FALSE);
     swbuffer(bp);
 
-    /* run the specified, or the system startup file here.
-       if vileinit is set, it's the name of the user's
-       command-line startup file, i.e. 'vile @mycmds'
+    /*
+     * Run the specified, or the system startup file here.  If vileinit is set,
+     * it is the name of the user's command-line startup file, e.g.,
+     *
+     * 'vile @mycmds'
+     *
+     * If more than one startup file is named, remember the last.
      */
-    if (vileinit && *vileinit) {
-	if (do_source(vileinit, 1, FALSE) != TRUE) {
-	    startstat = FALSE;
+    if (!is_empty_buf(init_bp)) {
+	startstat = run_startup_commands(init_bp);
+	if (!startstat)
 	    goto begin;
+
+	if (!isEmpty(vileinit)) {
+	    free(startup_file);
+	    startup_file = strmalloc(vileinit);
 	}
-	free(startup_file);
-	startup_file = strmalloc(vileinit);
     } else {
 
 	/* else vileinit is the contents of their VILEINIT variable */
 	vileinit = vile_getenv("VILEINIT");
 	if (vileinit != NULL) {	/* set... */
-	    BUFFER *vbp, *obp;
-	    UINT oflags = 0;
 	    if (*vileinit) {	/* ...and not null */
-		/* mark as modified, to prevent
-		 * undispbuff() from clobbering */
-		obp = curbp;
-		if (obp) {
-		    oflags = obp->b_flag;
-		    b_set_changed(obp);
-		}
 
-		if ((vbp = bfind(VILEINIT_BufName, BFEXEC)) == 0)
-		    tidy_exit(BADEXIT);
+		b2printf(init_bp, "%s", vileinit);
 
-		/* don't want swbuffer to try to read it */
-		vbp->b_active = TRUE;
-		swbuffer(vbp);
-		b_set_scratch(vbp);
-		bprintf("%s", vileinit);
-		/* if we leave it scratch, swbuffer(obp)
-		   may zot it, and we may zot it again */
-		b_clr_scratch(vbp);
-		set_rdonly(vbp, vbp->b_fname, MDVIEW);
-
-		/* go execute it! */
-		if (dobuf(vbp, 1) != TRUE) {
-		    startstat = FALSE;
+		startstat = run_startup_commands(init_bp);
+		if (!startstat)
 		    goto begin;
-		}
-		if (obp) {
-		    swbuffer(obp);
-		    obp->b_flag = oflags;
-		}
-		/* remove the now unneeded buffer */
-		b_set_scratch(vbp);	/* make sure it will go */
-		(void) zotbuf(vbp);
 	    }
 	} else {		/* find and run .vilerc */
 	    if (do_source(startup_file, 1, TRUE) != TRUE) {
@@ -717,48 +778,14 @@
 	if (bp2any_wp(bp) && bp2any_wp(havebp))
 	    zotwp(bp);
     }
-#if OPT_TAGS
-    else if (tname) {
-	cmdlinetag(tname);
-	didtag = TRUE;
-    }
-#endif
-    msg = s_NULL;
-    if (helpflag) {
-	if (vl_help(TRUE, 1) != TRUE) {
-	    msg =
-		"[Problem with help information. Type \":quit\" to exit if you wish]";
-	}
-    } else {
-	msg = "[Use ^A-h, ^X-h, or :help to get help]";
-    }
+    /*
+     * Execute command-line options here, after reading the initial buffer.
+     * That ensures that they override the init-file(s).
+     */
+    msg = "[Use ^A-h, ^X-h, or :help to get help]";
+    if (!run_startup_commands(opts_bp))
+	startstat = FALSE;
 
-    /* honor command-line actions */
-    if (gotoflag + (search_exp != 0)
-#if OPT_TAGS
-	+ (tname ? 1 : 0)
-#endif
-	> 1) {
-#if OPT_TAGS
-	msg = "[Search, goto and tag are used one at a time]";
-#else
-	msg = "[Cannot search and goto at the same time]";
-#endif
-    } else if (gotoflag) {
-	if (gotoline(gline != 0, gline) == FALSE) {
-	    msg = "[Not that many lines in buffer]";
-	    (void) gotoeob(FALSE, 1);
-	}
-    } else if (search_exp) {
-	FreeIfNeeded(gregexp);
-	searchpat = tb_string(search_exp->pat);
-	gregexp = search_exp->reg;
-	(void) forwhunt(FALSE, 0);
-#if OPT_TAGS
-    } else if (tname && !didtag) {
-	cmdlinetag(tname);
-#endif
-    }
 #if OPT_POPUP_MSGS
     purge_msgs();
 #endif
@@ -1314,6 +1341,9 @@
 #ifdef MDLOCKED
 	    setINT(MDLOCKED, FALSE);	/* LOCKED */
 #endif
+#ifdef MDMODELINE
+	    setINT(MDMODELINE, FALSE);
+#endif
 #ifdef MDUPBUFF
 	    setINT(MDUPBUFF, TRUE);	/* animated */
 #endif
@@ -1335,6 +1365,9 @@
 #ifdef VAL_LOCKER
 	    setTXT(VAL_LOCKER, "");	/* Name locker */
 #endif
+#ifdef VAL_MODELINES
+	    setINT(VAL_MODELINES, 5);
+#endif
 #ifdef VAL_RECORD_FORMAT
 	    setINT(VAL_RECORD_FORMAT, FAB$C_UDF);
 #endif
@@ -1403,12 +1436,6 @@
 #define DFT_LIBDIR_PATH ""
 #endif
 
-#if SYS_MSDOS || SYS_OS2 || SYS_WINNT || SYS_VMS
-#define DFT_STARTUP_FILE "vile.rc"
-#else /* SYS_UNIX */
-#define DFT_STARTUP_FILE ".vilerc"
-#endif
-
 #define DFT_MLFORMAT \
 "%-%i%- %b %m:: :%f:is : :%=%F: : :%l:(:,:%c::) :%p::% :%C:char ::%S%-%-%|"
 
@@ -1882,10 +1909,7 @@
 
     f = *fp;
     n = *np;
-    if (f)
-	oldn = n;
-    else
-	oldn = 1;
+    oldn = need_a_count(f, n, 1);
     n = 1;
 
     if (isDigit(c) && c != '0') {
@@ -1930,10 +1954,7 @@
     f = *fp;
     n = *np;
 
-    if (f)
-	oldn = n;
-    else
-	oldn = 1;
+    oldn = need_a_count(f, n, 1);
 
     n = 4;			/* start with a 4 */
     f = TRUE;			/* there is a # arg */
Index: makefile.in
Prereq:  1.202 
--- vile-9.5k+/makefile.in	2006-02-17 00:50:20.000000000 +0000
+++ vile-9.5l/makefile.in	2006-11-04 11:56:07.000000000 +0000
@@ -20,7 +20,7 @@
 #
 # gnu autoconf support by kevin buettner, 5/94
 #
-# $Header: /usr/build/vile/vile/RCS/makefile.in,v 1.202 2006/02/17 00:50:20 tom Exp $
+# $Header: /usr/build/vile/vile/RCS/makefile.in,v 1.203 2006/11/04 11:56:07 tom Exp $
 
 SHELL		= /bin/sh
 
@@ -470,15 +470,12 @@
 	$(LINT) $(CPPFLAGS) $(SRC) $(LIBS)
 	$(LINT) $(CPPFLAGS) mktbls.c
 
-tags:
+tags:	$(SRC) $(HDRS)
 	ctags $(SRC) $(HDRS)
 
-TAGS:
+TAGS:	$(SRC) $(HDRS)
 	etags $(SRC) $(HDRS)
 
-dotags:
-	dotags $(SRC) $(HDRS)
-
 #	 this builds vile-N.Ndev.tar.gz, including all development files
 devtarball:	$(DEV_DISTFILES) /tmp/vilevers release_warnings
 	echo vile-`cat /tmp/vilevers` > .fname
Index: map.c
Prereq:  1.109 
--- vile-9.5k+/map.c	2006-04-20 09:49:23.000000000 +0000
+++ vile-9.5l/map.c	2006-11-04 01:28:05.000000000 +0000
@@ -3,7 +3,7 @@
  *	Original interface by Otto Lind, 6/3/93
  *	Additional map and map! support by Kevin Buettner, 9/17/94
  *
- * $Header: /usr/build/vile/vile/RCS/map.c,v 1.109 2006/04/20 09:49:23 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/map.c,v 1.110 2006/11/04 01:28:05 tom Exp $
  *
  */
 
@@ -817,6 +817,13 @@
     return mapgetc_ungotcnt > 0;
 }
 
+void
+map_drain(void)
+{
+    while (mapped_ungotc_avail())
+	mapgetc();
+}
+
 static int
 mapped_c_start(void)
 {
Index: menu.c
Prereq:  1.48 
--- vile-9.5k+/menu.c	2005-11-18 01:30:37.000000000 +0000
+++ vile-9.5l/menu.c	2006-10-24 21:57:15.000000000 +0000
@@ -8,7 +8,7 @@
 /************************************************************************/
 
 /*
- * $Header: /usr/build/vile/vile/RCS/menu.c,v 1.48 2005/11/18 01:30:37 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/menu.c,v 1.49 2006/10/24 21:57:15 tom Exp $
  */
 
 /* Vile includes */
@@ -340,6 +340,14 @@
 }
 #endif
 
+static void *
+make_header(void *menub, int count)
+{
+    char label[80];
+    sprintf(label, "Menu%d", count);
+    return gui_make_menu(menub, label, 'C');
+}
+
 /************************************************************************/
 /* Main function : Take the menu-bar as argument and create all the     */
 /* Cascades, PullDowns Menus and Buttons read from the rc file          */
@@ -352,6 +360,7 @@
     void *pm = 0;
     void *pm_w;
     int rc;
+    int fixup = 0;
     char *menurc = menu_filename();
 
     if (menurc == 0) {
@@ -376,18 +385,24 @@
 
 	    /* SEPARATOR WIDGET */
 	case 'S':
+	    if (pm == 0)
+		pm = make_header(menub, ++fixup);
 	    gui_add_menu_item(pm, "sep", NULL, Token[i].type);
 	    break;
 
 	    /* LIST (BUFFER LIST) */
 	case 'L':
 	    if (!strcmp(Token[i].action, "list_buff")) {
+		if (pm == 0)
+		    pm = make_header(menub, ++fixup);
 		gui_add_list_callback(pm);
 	    }
 	    break;
 
 	    /* BUTTON WIDGET */
 	case 'B':
+	    if (pm == 0)
+		pm = make_header(menub, ++fixup);
 	    if (Token[i].macro > 0) {
 		if ((macro = castalloc(char, 50)) != 0) {
 		    sprintf(macro, "execute-macro-%d", Token[i].macro);
Index: mktbls.c
Prereq:  1.135 
--- vile-9.5k+/mktbls.c	2006-05-21 20:53:14.000000000 +0000
+++ vile-9.5l/mktbls.c	2006-10-19 22:25:52.000000000 +0000
@@ -15,7 +15,7 @@
  * by Tom Dickey, 1993.    -pgf
  *
  *
- * $Header: /usr/build/vile/vile/RCS/mktbls.c,v 1.135 2006/05/21 20:53:14 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/mktbls.c,v 1.136 2006/10/19 22:25:52 tom Exp $
  *
  */
 
@@ -1318,10 +1318,16 @@
 }
 
 /******************************************************************************/
+static int
+ok_submode(char *side_effect)
+{
+    return strcmp(side_effect, "chgd_major") != 0;
+}
+
 static void
 save_bmodes(char *type, char **vec)
 {
-    char *key = Mode2Key(type, vec[1], vec[4], TRUE);
+    char *key = Mode2Key(type, vec[1], vec[4], ok_submode(vec[3]));
     InsertSorted(&all_bmodes, key, vec[2], vec[3], vec[4], vec[0]);
 #if NO_LEAKS
     free(key);
Index: modes.c
Prereq:  1.317 
--- vile-9.5k+/modes.c	2006-05-21 19:24:48.000000000 +0000
+++ vile-9.5l/modes.c	2006-10-19 21:34:04.000000000 +0000
@@ -7,7 +7,7 @@
  * Major extensions for vile by Paul Fox, 1991
  * Majormode extensions for vile by T.E.Dickey, 1997
  *
- * $Header: /usr/build/vile/vile/RCS/modes.c,v 1.317 2006/05/21 19:24:48 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/modes.c,v 1.320 2006/10/19 21:34:04 tom Exp $
  *
  */
 
@@ -989,6 +989,21 @@
 }
 #endif /* OPT_ENUM_MODES */
 
+static int
+ok_local_mode(void)
+{
+#if OPT_MODELINE
+    /*
+     * When processing modeline, disallow major changes.
+     */
+    if (in_modeline) {
+	TRACE(("ignored (within modeline)\n"));
+	return FALSE;
+    }
+#endif
+    return TRUE;
+}
+
 /*
  * Lookup the mode named with 'cp[]' and adjust its value.
  */
@@ -1016,6 +1031,10 @@
     if (no && !is_bool_type(names->type))
 	return FALSE;		/* this shouldn't happen */
 
+    if ((names->side_effect == chgd_major) && !ok_local_mode()) {
+	return FALSE;
+    }
+
     /*
      * Check if we're allowed to change this mode in the current context.
      */
@@ -1497,6 +1516,9 @@
     if (tb_length(cbuf) == 0)
 	return FALSE;
     if (!strcmp(tb_values(cbuf), "all")) {
+	if (!ok_local_mode()) {
+	    return FALSE;
+	}
 	hst_glue(' ');
 	return listmodes(FALSE, 1);
     }
@@ -1876,11 +1898,11 @@
     return TRUE;
 }
 
-	/* Change a "major" mode */
+	/* Change a "major" mode (one that we cannot use in majormodes) */
 int
 chgd_major(BUFFER *bp, VALARGS * args, int glob_vals, int testing)
 {
-    /* prevent major-mode changes for scratch-buffers */
+    /* prevent major changes for scratch-buffers */
     if (testing) {
 	if (!glob_vals) {
 	    if (b_is_scratch(bp))
@@ -1892,7 +1914,7 @@
     return TRUE;
 }
 
-	/* Change the "undoable" mode */
+	/* Change the "undoable" mode (this is also a major change) */
 int
 chgd_undoable(BUFFER *bp, VALARGS * args, int glob_vals, int testing)
 {
@@ -1905,9 +1927,9 @@
     return FALSE;
 }
 
-	/* Change a major mode that affects the windows on the buffer */
+	/* Change a mode that affects the window(s) on the buffer */
 int
-chgd_major_w(BUFFER *bp, VALARGS * args, int glob_vals, int testing)
+chgd_win_mode(BUFFER *bp, VALARGS * args, int glob_vals, int testing)
 {
     if (testing) {
 	if (!chgd_major(bp, args, glob_vals, testing))
@@ -1968,7 +1990,7 @@
     }
 
     set_winflags(TRUE, WFMODE);
-    return chgd_major_w(bp, args, glob_vals, testing);
+    return chgd_win_mode(bp, args, glob_vals, testing);
 }
 
 	/* Change something on the mode/status line */
@@ -3512,7 +3534,7 @@
     major_valnames[j].name = strmalloc(longname);
     major_valnames[j].shortname = strmalloc(shortname);
     major_valnames[j].type = VALTYPE_MAJOR;
-    major_valnames[j].side_effect = chgd_major_w;
+    major_valnames[j].side_effect = chgd_win_mode;
 
     if (major_valnames[j].name == 0
 	|| major_valnames[j].shortname == 0) {
Index: modetbl
Prereq:  1.239 
--- vile-9.5k+/modetbl	2006-05-21 00:22:10.000000000 +0000
+++ vile-9.5l/modetbl	2006-10-16 21:45:37.000000000 +0000
@@ -11,7 +11,7 @@
 #
 # The modes are table entries in the BUFFER and WINDOW structures.
 #
-# $Header: /usr/build/vile/vile/RCS/modetbl,v 1.239 2006/05/21 00:22:10 cmorgan Exp $
+# $Header: /usr/build/vile/vile/RCS/modetbl,v 1.240 2006/10/16 21:45:37 tom Exp $
 #
 #
 # Mode-table entries.  Capitalized letters are used for abbreviations.
@@ -103,9 +103,9 @@
 	"BackspaceLimit" BACKLIMIT	0		# backspace limited in insert mode
 	"check-modtime" CHK_MODTIME	0		!SMALLER # check buffer-modtime
 	"CIndent"	CINDENT		0		# c-style indent
-	"cmode"		CMOD		chgd_major_w	!OPT_MAJORMODE # C indentation and fence match
+	"cmode"		CMOD		chgd_win_mode	!OPT_MAJORMODE # C indentation and fence match
 	"crypt"		CRYPT		chgd_major	OPT_ENCRYPT	# encrytion mode active
-	"dos"		DOS		chgd_major_w	# "dos" mode -- lines end in crlf
+	"dos"		DOS		chgd_win_mode	# "dos" mode -- lines end in crlf
 	"FilterMsgs"	FILTERMSGS	0		OPT_MAJORMODE&&OPT_FILTER # Name of syntax-filter
 	"HighLight"	HILITE		chgd_filter	OPT_MAJORMODE # true if we enable syntax highlighting
 	"IgnoreCase"	IGNCASE		chgd_hilite	# Exact matching for searches
@@ -113,10 +113,11 @@
 	"locked"	LOCKED		chgd_disabled	OPT_LCKFILES # mode locked
 	"magic"		MAGIC		chgd_hilite	# regular expressions in search
 	"Meta-Insert-Bindings" METAINSBIND 0		# honor meta bindings in insert mode
+	"ModeLine"	MODELINE	0		OPT_MODELINE # modeline (selected :setl only) (vi-style)
 	"NewLine"	NEWLINE		chgd_buffer	# trailing newline (vi-style)
 	"ReadOnly"	READONLY	chgd_major	# allow writing the buffer
 	"ShowMatch"	SHOWMAT		0		# show matching braces during insert
-	"ShowMoDe"	SHOWMODE	chgd_major	# show insert/replace/command mode
+	"ShowMoDe"	SHOWMODE	chgd_status	# show insert/replace/command mode
 	"TabInsert"	TABINSERT	0		# okay to insert tab chars
 	"TagignoreCase"	TAGIGNORECASE	0		!SMALLER # ignore upper/lower case in tags
 	"TagRelative"	TAGSRELTIV	0		# tags are relative to tagsfile path
@@ -139,13 +140,14 @@
 	"AutoColor"	AUTOCOLOR	0		OPT_COLOR&&!SMALLER # auto color
 	"AutoSaveCNT"	ASAVECNT	0		# how often auto-saves occur
 	"C-ShiftWidth"	C_SWIDTH	0		!OPT_MAJORMODE # shift-width for C buffers
-	"C-TabStop"	C_TAB		chgd_major_w	!OPT_MAJORMODE # tab spacing for C buffers
+	"C-TabStop"	C_TAB		chgd_win_mode	!OPT_MAJORMODE # tab spacing for C buffers
 	"fence-limit"	FENCE_LIMIT	0		OPT_MAJORMODE # fence iteration-limit
 	"FillCol"	FILL		0		# column for paragraph reformat, and line break
+	"ModeLineS"	MODELINES	0		OPT_MODELINE # modeline (selected :setl only) (vi-style)
 	"percent-crlf"	PERCENT_CRLF	0		# threshold for converting to DOS-mode
 	"record-length" RECORD_LENGTH	0		SYS_VMS	# specify record-length to use
 	"ShiftWidth"	SWIDTH		0		# shiftwidth for ^T/^D/<</>>
-	"TabStop"	TAB		chgd_major_w	# tab spacing for most buffers
+	"TabStop"	TAB		chgd_win_mode	# tab spacing for most buffers
 	"TagLength"	TAGLEN		0		# required significant length for tag lookups
 	"UndoLimit"	UNDOLIM		0		# how much undo stack is saved
 	"WrapMargin"	WRAPMARGIN	0		# width of right margin for autowrap
Index: ntwinio.c
Prereq:  1.159 
--- vile-9.5k+/ntwinio.c	2006-04-25 23:13:32.000000000 +0000
+++ vile-9.5l/ntwinio.c	2006-10-31 21:44:16.000000000 +0000
@@ -1,7 +1,7 @@
 /*
  * Uses the Win32 screen API.
  *
- * $Header: /usr/build/vile/vile/RCS/ntwinio.c,v 1.159 2006/04/25 23:13:32 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/ntwinio.c,v 1.160 2006/10/31 21:44:16 tom Exp $
  * Written by T.E.Dickey for vile (october 1997).
  * -- improvements by Clark Morgan (see w32cbrd.c, w32pipe.c).
  */
@@ -2700,7 +2700,7 @@
     switch (msg) {
     case SB_BOTTOM:
 	TRACE(("-> SB_BOTTOM\n"));
-	gotoline(FALSE, 1);
+	gotoeob(FALSE, 1);
 	break;
     case SB_LINEDOWN:
 	TRACE(("-> SB_LINEDOWN\n"));
@@ -2720,7 +2720,7 @@
 	break;
     case SB_THUMBPOSITION:
 	TRACE(("-> SB_THUMBPOSITION: %d\n", nPos));
-	gotoline(TRUE, fix_scrollbar_tracking(nPos) + 1);
+	vl_gotoline(fix_scrollbar_tracking(nPos) + 1);
 	break;
     case SB_THUMBTRACK:
 	TRACE(("-> SB_THUMBTRACK: %d\n", nPos));
@@ -2734,7 +2734,7 @@
 	break;
     case SB_TOP:
 	TRACE(("-> SB_TOP\n"));
-	gotoline(TRUE, 1);
+	vl_gotoline(1);
 	break;
     case SB_ENDSCROLL:
 	TRACE(("-> SB_ENDSCROLL\n"));
Index: opers.c
Prereq:  1.90 
--- vile-9.5k+/opers.c	2004-12-07 01:29:50.000000000 +0000
+++ vile-9.5l/opers.c	2006-11-06 21:26:32.000000000 +0000
@@ -1,9 +1,9 @@
 /*
  * This file contains the command processing functions for the commands
  * that take motion operators.
- * written for vile: Copyright (c) 1990, 1995-2003 by Paul Fox
+ * written for vile.  Copyright (c) 1990, 1995-2003 by Paul Fox
  *
- * $Header: /usr/build/vile/vile/RCS/opers.c,v 1.90 2004/12/07 01:29:50 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/opers.c,v 1.92 2006/11/06 21:26:32 tom Exp $
  *
  */
 
@@ -190,34 +190,6 @@
     return s;
 }
 
-#if 0
-#define toggle_b_val(bp, mode) set_b_val(bp, mode, !b_val(bp, mode))
-
-static int
-toggle_autoindent(void)
-{
-    int code = b_val(curbp, MDAIND);
-
-    toggle_b_val(curbp, MDAIND);
-
-    return code;
-}
-
-int
-operchg_i(int f, int n)
-{
-    int s, indent;
-
-    opcmd = OPOTHER;
-    indent = toggle_autoindent();
-    s = vile_op(f, n, chgreg, indent ? "Change (noai)" : "Change (ai)");
-    if (s == TRUE)
-	swapmark();
-    (void) toggle_autoindent();
-    return s;
-}
-#endif
-
 int
 operlinechg(int f, int n)
 {
Index: patchlev.h
--- vile-9.5k+/patchlev.h	2006-08-13 18:08:47.000000000 +0000
+++ vile-9.5l/patchlev.h	2006-10-02 23:18:18.000000000 +0000
@@ -1,3 +1,3 @@
 #define VILE_VERSION "9.5"
 /* set to "" for no patches */
-#define VILE_PATCHLEVEL "k"
+#define VILE_PATCHLEVEL "l"
Index: proto.h
Prereq:  1.567 
--- vile-9.5k+/proto.h	2006-05-21 10:52:15.000000000 +0000
+++ vile-9.5l/proto.h	2006-11-05 23:47:00.000000000 +0000
@@ -4,7 +4,7 @@
  *
  *   Created: Thu May 14 15:44:40 1992
  *
- * $Header: /usr/build/vile/vile/RCS/proto.h,v 1.567 2006/05/21 10:52:15 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/proto.h,v 1.574 2006/11/05 23:47:00 tom Exp $
  *
  */
 
@@ -110,6 +110,7 @@
 extern int nextchar (LINE *lp, int off);
 extern int setmark (void);
 extern int show_mark_is_set (int c);
+extern int vl_gotoline (int n);
 extern void swapmark (void);
 
 #if OPT_MOUSE
@@ -222,9 +223,13 @@
 extern int has_C_suffix (BUFFER *bp);
 #endif
 
+#if OPT_MODELINE
+extern void do_modelines(BUFFER *bp);
+#endif
+
 #if OPT_UPBUFF
-void updatelistbuffers (void);
-void update_scratch (const char *name, UpBuffFunc func);
+extern void updatelistbuffers (void);
+extern void update_scratch (const char *name, UpBuffFunc func);
 #else
 #define updatelistbuffers()
 #define update_scratch(name, func)
@@ -348,6 +353,7 @@
 extern char * skip_space_tab(char *src);
 extern const char * tokval (char *tokn);
 extern const char * skip_cblanks (const char *str);
+extern const char * skip_cnumber (const char *str);
 extern const char * skip_cstring (const char *str);
 extern const char * skip_ctext (const char *str);
 extern int absol (int x);
@@ -363,10 +369,12 @@
 
 #ifdef const
 #define skip_blanks(s) skip_cblanks(s)
+#define skip_number(s) skip_cnumber(s)
 #define skip_string(s) skip_cstring(s)
 #define skip_text(s) skip_ctext(s)
 #else
 extern char *skip_blanks (char *str);
+extern char *skip_number (char *str);
 extern char *skip_string (char *str);
 extern char *skip_text (char *str);
 #endif
@@ -424,7 +432,8 @@
 #endif
 
 /* exec.c */
-extern DIRECTIVE dname_to_dirnum(char **cmdp, size_t length);
+extern DIRECTIVE dname_to_dirnum (char **cmdp, size_t length);
+extern const char *skip_linespecs (const char *buffer, int cpos, int *done);
 extern int do_source (char *fname, int n, int optional);
 extern int dobuf (BUFFER *bp, int n);
 extern int docmd (char *cline, int execflag, int f, int n);
@@ -712,6 +721,7 @@
 extern void abbr_check (int *backsp_limit_p);
 extern void addtosysmap (const char *seq, int seqlen, int code);
 extern void delfromsysmap (const char *seq, int seqlen);
+extern void map_drain (void);
 extern void mapungetc (int c);
 
 /* menu.c */
@@ -904,6 +914,8 @@
 extern int is_user_fence (int ch, int *sdirp);
 extern int line_report (L_NUM before);
 extern int liststuff (const char *name, int appendit, void (*)(LIST_ARGS), int iarg, void *vargp);
+extern int need_a_count (int f, int n, int need);
+extern int need_at_least (int f, int n, int need);
 extern int restore_dot(MARK saved_dot);
 extern int set_directory (const char *dir);
 extern long vl_atol (char *str, int base, int *failed);
@@ -1087,11 +1099,6 @@
 #define pressreturn() (void)keystroke()
 #endif
 
-/* tags.c */
-#if OPT_TAGS
-extern int cmdlinetag (const char *t);
-#endif /* OPT_TAGS */
-
 /* tbuff.c */
 TBUFF *	tb_alloc (TBUFF **p, size_t n);
 TBUFF *	tb_append (TBUFF **p, int c);
Index: random.c
Prereq:  1.292 
--- vile-9.5k+/random.c	2006-04-20 00:02:43.000000000 +0000
+++ vile-9.5l/random.c	2006-11-08 01:40:23.000000000 +0000
@@ -2,7 +2,7 @@
  * This file contains the command processing functions for a number of random
  * commands. There is no functional grouping here, for sure.
  *
- * $Header: /usr/build/vile/vile/RCS/random.c,v 1.292 2006/04/20 00:02:43 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/random.c,v 1.297 2006/11/08 01:40:23 tom Exp $
  *
  */
 
@@ -410,6 +410,23 @@
     curwp->w_flag |= WFMOVE;
     return TRUE;
 }
+
+/*
+ * Go to the given percent index in the buffer, i.e., the line that matches
+ * the given percent.
+ */
+int
+gotopct(int f, int n)
+{
+    int status = FALSE;
+
+    if (f && (n >= 0 && n <= 100)) {
+	bsizes(curbp);
+	status = gotoline(TRUE,
+			  (int) ((curbp->b_linecount) * (n / 100.0) + 0.5));
+    }
+    return status;
+}
 #endif
 
 /*
@@ -451,14 +468,27 @@
     return getcol(DOT, bflg);
 }
 
+int
+need_a_count(int f, int n, int need)
+{
+    if (!f)
+	n = need;
+    return n;
+}
+
+int
+need_at_least(int f, int n, int need)
+{
+    return ((!f || n < need) ? need : n);
+}
+
 /*
  * Set current column, based on counting from 1
  */
 int
 gotocol(int f, int n)
 {
-    if (!f || n <= 0)
-	n = 1;
+    n = need_at_least(f, n, 1);
     return gocol(n - 1);
 }
 
@@ -563,9 +593,7 @@
     int s = TRUE;
     B_COUNT len_rs = len_record_sep(curbp);
 
-    if (!f || n < 0)
-	n = 0;
-    n_arg = n;
+    n_arg = need_at_least(f, n, 0);
 
     lp1 = DOT.l;
     /* scan backward */
@@ -1729,8 +1757,7 @@
 		cp++;
 		rc = FALSE;
 		if (isDigit(*cp++)) {
-		    while (*cp && isDigit(*cp))
-			cp++;
+		    cp = skip_number(cp);
 		    if (*cp == '\0')
 			rc = TRUE;
 		}
@@ -1805,8 +1832,7 @@
 	sign = (*cp == '-') ? -1 : 1;
 	cp++;
 	if (isDigit(*cp++)) {
-	    while (*cp && isDigit(*cp))
-		cp++;
+	    cp = skip_number(cp);
 	    if (*cp == '\0')
 		rc = TRUE;
 	}
Index: revlist
--- vile-9.5k+/revlist	2006-09-25 00:13:23.000000000 +0000
+++ vile-9.5l/revlist	2006-11-08 01:45:56.000000000 +0000
@@ -1,6 +1,6 @@
-revlist for vile, version v9_5k
+revlist for vile, version v9_5l
 --------------------------------------------------------------------------------
-CHANGES	1.935
+CHANGES	1.951
 CHANGES.R3	1.1
 CHANGES.R4	1.1
 CHANGES.R5	1.1
@@ -13,94 +13,94 @@
 README	1.96
 README.PC	1.33
 README.VMS	1.5
-aclocal.m4	1.163
+aclocal.m4	1.165
 ansi.c	1.48
-api.c	1.37
+api.c	1.38
 api.h	1.13
-basic.c	1.124
-bind.c	1.296
+basic.c	1.126
+bind.c	1.300
 borland.c	1.36
 btree.c	1.23
 btree.h	1.5
-buffer.c	1.300
-buglist	1.403
+buffer.c	1.307
+buglist	1.405
 builtflt.c	1.47
-chgdfunc.h	1.18
-cmdtbl	1.238
+chgdfunc.h	1.19
+cmdtbl	1.244
 config.guess	1.5
 config.sub	1.6
 config_h.in	1.2
-configure	1.7
-configure.in	1.224
-csrch.c	1.32
+configure	1.8
+configure.in	1.225
+csrch.c	1.34
 curses.c	1.27
 descrip.mms	1.48
 dirstuff.h	1.30
-display.c	1.418
+display.c	1.421
 djhandl.c	1.6
 dumbterm.c	1.21
-edef.h	1.323
-estruct.h	1.597
-eval.c	1.353
-exec.c	1.288
+edef.h	1.326
+estruct.h	1.598
+eval.c	1.354
+exec.c	1.307
 externs.c	1.10
 fences.c	1.84
-file.c	1.395
+file.c	1.396
 filec.c	1.124
 fileio.c	1.181
 finderr.c	1.130
 glob.c	1.89
-globals.c	1.48
+globals.c	1.49
 gppconio.c	1.2
-history.c	1.84
+history.c	1.85
 input.c	1.289
-insert.c	1.143
+insert.c	1.147
 install.sh	1.7
 isearch.c	1.60
 itbuff.c	1.25
 lckfiles.c	1.11
-line.c	1.171
-main.c	1.551
+line.c	1.172
+main.c	1.568
 makefile.blc	1.20
 makefile.djg	1.35
 makefile.icc	1.16
-makefile.in	1.202
+makefile.in	1.203
 makefile.wnt	1.91
-map.c	1.109
-menu.c	1.48
+map.c	1.110
+menu.c	1.49
 mkdirs.sh	1.6
 mkprlenv.wnt	1.9
-mktbls.c	1.135
-modes.c	1.317
-modetbl	1.239
+mktbls.c	1.136
+modes.c	1.320
+modetbl	1.240
 msgs.c	1.26
 npopen.c	1.94
 ntconio.c	1.87
-ntwinio.c	1.159
+ntwinio.c	1.160
 nullterm.c	1.3
 oneliner.c	1.109
-opers.c	1.90
+opers.c	1.92
 os2keys.h	1.2
 os2pipe.c	1.5
 os2vio.c	1.35
-patchlev.h	1.347
+patchlev.h	1.348
 path.c	1.151
 perl.xs	1.104
 plugin.c	1.1
 plugin.h	1.1
-proto.h	1.567
+proto.h	1.574
 pscreen.h	1.2
 ptypemap	1.7
-random.c	1.292
+random.c	1.297
 regexp.c	1.118
 region.c	1.133
-revlist	v9_5k
-search.c	1.138
-select.c	1.161
+revlist	v9_5l
+search.c	1.142
+select.c	1.162
 sinstall.sh	1.1
 spawn.c	1.191
 statevar.c	1.98
-tags.c	1.130
+tags.c	1.134
 tbuff.c	1.66
 tcap.c	1.170
 tcap.h	1.11
@@ -109,11 +109,11 @@
 trace.c	1.54
 trace.h	1.24
 ucrypt.c	1.15
-undo.c	1.88
-version.c	1.59
-vile-9.5.spec	1.12
-vile.1	1.31
-vile.hlp	1.612
+undo.c	1.90
+version.c	1.61
+vile-9.5.spec	1.13
+vile.1	1.36
+vile.hlp	1.616
 vile.wmconfig	1.1
 vl_alloc.h	1.1
 vl_ctype.h	1.4
@@ -134,12 +134,12 @@
 w32reg.h	1.1
 w32vile.h	1.4
 watch.c	1.5
-window.c	1.106
+window.c	1.107
 winvile.h	1.11
 winvile.odl	1.6
 winvile.rc	1.11
-word.c	1.80
-wordmov.c	1.22
+word.c	1.81
+wordmov.c	1.23
 wvwrap.cpp	1.10
 x11.c	1.286
 x11menu.c	1.10
@@ -151,7 +151,7 @@
 doc/config.doc	1.14
 doc/dir.doc	1.3
 doc/filters.doc	1.35
-doc/macros.doc	1.96
+doc/macros.doc	1.97
 doc/menus.doc	1.7
 doc/modes.doc	1.16
 doc/ncu-indent	1.12
@@ -206,7 +206,7 @@
 filters/fdl.key	1.4
 filters/filterio.c	1.29
 filters/filters.c	1.99
-filters/filters.h	1.96
+filters/filters.h	1.97
 filters/filters.rc	1.205
 filters/flt_defs.h	1.3
 filters/fltstack.h	1.9
@@ -230,7 +230,7 @@
 filters/lex.key	1.8
 filters/lisp.key	1.2
 filters/lispfilt.l	1.13
-filters/lua-filt.l	1.5
+filters/lua-filt.l	1.6
 filters/lua.key	1.2
 filters/m4-filt.c	1.27
 filters/m4.key	1.3
@@ -303,16 +303,16 @@
 filters/tagsfilt.c	1.8
 filters/tbl-filt.l	1.11
 filters/tbl.key	1.1
-filters/tc-filt.l	1.26
+filters/tc-filt.l	1.30
 filters/tc.key	1.2
 filters/tcl-filt.l	1.18
 filters/tcl.key	1.10
 filters/tex.key	1.3
 filters/texi.key	1.1
 filters/texifilt.l	1.6
-filters/ti-filt.l	1.18
+filters/ti-filt.l	1.21
 filters/ti.key	1.2
-filters/txt-filt.l	1.23
+filters/txt-filt.l	1.29
 filters/unfilter.c	1.9
 filters/unfilter.h	1.1
 filters/vb.key	1.7
@@ -347,7 +347,7 @@
 macros/gnugpg.rc	1.3
 macros/loaderrs.rc	1.1
 macros/manpage.rc	1.21
-macros/modes.rc	1.47
+macros/modes.rc	1.49
 macros/palettes.rc	1.7
 macros/pictmode.rc	1.4
 macros/search.rc	1.3
@@ -357,7 +357,7 @@
 macros/vileinit.rc	1.33
 macros/vilemenu.rc	1.3
 macros/vileperl.rc	1.7
-macros/which.rc	1.14
+macros/which.rc	1.15
 package/winvile.iss	1.5
 package/winvile.nsi	1.3
 perl/Breadcrumbs.pm	1.4
Index: search.c
Prereq:  1.138 
--- vile-9.5k+/search.c	2006-04-19 23:52:57.000000000 +0000
+++ vile-9.5l/search.c	2006-11-02 21:01:24.000000000 +0000
@@ -3,7 +3,7 @@
  * and backward directions.
  *  heavily modified by Paul Fox, 1990
  *
- * $Header: /usr/build/vile/vile/RCS/search.c,v 1.138 2006/04/19 23:52:57 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/search.c,v 1.142 2006/11/02 21:01:24 tom Exp $
  *
  * original written Aug. 1986 by John M. Gamble, but I (pgf) have since
  * replaced his regex stuff with Henry Spencer's regexp package.
@@ -49,7 +49,7 @@
 int
 forwsearch(int f, int n)
 {
-    register int status;
+    int status;
     hst_init('/');
     status = fsearch(f, n, FALSE, FALSE);
     hst_flush();
@@ -62,7 +62,7 @@
 int
 fsearch(int f, int n, int marking, int fromscreen)
 {
-    register int status = TRUE;
+    int status = TRUE;
     int wrapok;
     MARK curpos;
     int didmark = FALSE;
@@ -153,7 +153,7 @@
 int
 forwhunt(int f, int n)
 {
-    register int status = TRUE;
+    int status = TRUE;
     int wrapok;
     MARK curpos;
     int didwrap;
@@ -217,7 +217,7 @@
 int
 backsearch(int f, int n)
 {
-    register int status;
+    int status;
     hst_init('?');
     status = rsearch(f, n, FALSE, FALSE);
     hst_flush();
@@ -228,7 +228,7 @@
 static int
 rsearch(int f, int n, int dummy GCC_UNUSED, int fromscreen)
 {
-    register int status;
+    int status;
     int wrapok;
     MARK curpos;
     int didwrap;
@@ -291,7 +291,7 @@
 int
 backhunt(int f, int n)
 {
-    register int status = TRUE;
+    int status = TRUE;
     int wrapok;
     MARK curpos;
     int didwrap;
@@ -402,9 +402,13 @@
     int wrapped = FALSE;
     int leftmargin = b_left_margin(curbp);
 
+    TRACE((T_CALLED "scanner %s %s\n",
+	   ((direct == FORWARD) ? "forward" : "backward"),
+	   (wrapok ? "wrapok" : "nowrapok")));
+
     if (!exp) {
 	mlforce("BUG: null exp");
-	return FALSE;
+	returnCode(FALSE);
     }
 
     /* Set starting search position to current position
@@ -415,12 +419,12 @@
 
     /* Scan each character until we hit the scan boundary */
     for_ever {
-	register int startoff, srchlim;
+	int startoff, srchlim;
 
 	if (interrupted()) {
 	    if (wrappedp)
 		*wrappedp = wrapped;
-	    return ABORT;
+	    returnCode(ABORT);
 	}
 
 	if (sameline(curpos, scanboundpos)) {
@@ -486,7 +490,7 @@
 		    last++;
 		if (!lregexec(exp, curpos.l, (int) (got - txt), srchlim)) {
 		    mlforce("BUG: prev. match no good");
-		    return FALSE;
+		    returnCode(FALSE);
 		}
 	    } else if (llength(curpos.l) <= leftmargin
 		       || last < llength(curpos.l))
@@ -498,7 +502,10 @@
 		curwp->w_flag |= WFMOVE;	/* flag that we have moved */
 		if (wrappedp)
 		    *wrappedp = wrapped;
-		return TRUE;
+#if OPT_TRACE
+		trace_mark("...scanner", &DOT, curbp);
+#endif
+		returnCode(TRUE);
 	    }
 	} else {
 	    if (sameline(curpos, scanboundpos) &&
@@ -531,7 +538,7 @@
 
     if (wrappedp)
 	*wrappedp = wrapped;
-    return FALSE;		/* We could not find a match. */
+    returnCode(FALSE);		/* We could not find a match. */
 }
 
 #if OPT_HILITEMATCH
@@ -810,8 +817,8 @@
 static void
 movenext(MARK *pdot, int dir)
 {
-    register LINE *curline;
-    register int curoff;
+    LINE *curline;
+    int curoff;
 
     curline = pdot->l;
     curoff = pdot->o;
@@ -845,8 +852,7 @@
     if (!exp)
 	return FALSE;
 
-    if (!f)
-	n = 1;
+    n = need_a_count(f, n, 1);
 
     s = TRUE;
     scanboundpos = curbp->b_line;	/* was scanboundry(FALSE,savepos,0); */
Index: select.c
Prereq:  1.161 
--- vile-9.5k+/select.c	2006-05-21 00:22:10.000000000 +0000
+++ vile-9.5l/select.c	2006-11-02 21:01:24.000000000 +0000
@@ -18,7 +18,7 @@
  * transferring the selection are not dealt with in this file.  Procedures
  * for dealing with the representation are maintained in this file.
  *
- * $Header: /usr/build/vile/vile/RCS/select.c,v 1.161 2006/05/21 00:22:10 cmorgan Exp $
+ * $Header: /usr/build/vile/vile/RCS/select.c,v 1.162 2006/11/02 21:01:24 tom Exp $
  *
  */
 
@@ -932,8 +932,8 @@
      * I'd use int-casts of the enum value, but declaring enums with
      * specific values isn't 100% portable.
      */
-    if (!f || n <= 0)
-	n = 1;
+    n = need_at_least(f, n, 1);
+
     if (n == 3)
 	regionshape = RECTANGLE;
     else if (n == 2)
Index: tags.c
Prereq:  1.130 
--- vile-9.5k+/tags.c	2006-04-25 20:13:21.000000000 +0000
+++ vile-9.5l/tags.c	2006-11-06 21:00:51.000000000 +0000
@@ -3,9 +3,9 @@
  *	Invoked either by ":ta routine-name" or by "^]" while sitting
  *	on a string.  In the latter case, the tag is the word under
  *	the cursor.
- *	written for vile: Copyright (c) 1990, 1995-2003 by Paul Fox
+ *	written for vile.  Copyright (c) 1990, 1995-2003 by Paul Fox
  *
- * $Header: /usr/build/vile/vile/RCS/tags.c,v 1.130 2006/04/25 20:13:21 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/tags.c,v 1.134 2006/11/06 21:00:51 tom Exp $
  *
  */
 #include "estruct.h"
@@ -500,7 +500,7 @@
     if (s == TRUE) {
 	/* it's an absolute move -- remember where we are */
 	odot = DOT;
-	s = gotoline(TRUE, lineno);
+	s = vl_gotoline(lineno);
 	/* if we moved, update the "last dot" mark */
 	if (s == TRUE) {
 	    gocol(colno);
@@ -911,14 +911,6 @@
 }
 
 int
-cmdlinetag(const char *t)
-{
-    return tag_search(strncpy0(tagname, t, NFILEN),
-		      global_b_val(VAL_TAGLEN),
-		      TRUE);
-}
-
-int
 untagpop(int f, int n)
 {
     L_NUM lineno = 0;
@@ -926,8 +918,8 @@
     char fname[NFILEN];
     int s;
 
-    if (!f)
-	n = 1;
+    n = need_a_count(f, n, 1);
+
     while (n && popuntag(fname, &lineno, &colno))
 	n--;
     if (lineno && fname[0]) {
Index: undo.c
Prereq:  1.88 
--- vile-9.5k+/undo.c	2005-01-24 00:23:42.000000000 +0000
+++ vile-9.5l/undo.c	2006-11-06 21:00:51.000000000 +0000
@@ -1,9 +1,9 @@
 /* these routines take care of undo operations
  * code by Paul Fox, original algorithm mostly by Julia Harper May, 89
  *
- * written for vile: Copyright (c) 1990, 1995-2001 by Paul Fox
+ * written for vile.  Copyright (c) 1990, 1995-2001 by Paul Fox
  *
- * $Header: /usr/build/vile/vile/RCS/undo.c,v 1.88 2005/01/24 00:23:42 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/undo.c,v 1.90 2006/11/06 21:00:51 tom Exp $
  *
  */
 
@@ -362,8 +362,7 @@
 
     TRACE((T_CALLED "undo(%d,%d)\n", f, n));
 
-    if (!f || n < 1)
-	n = 1;
+    n = need_at_least(f, n, 1);
 
     if (b_val(curbp, MDVIEW)) {
 	status = rdonly();
@@ -390,8 +389,7 @@
 
     TRACE((T_CALLED "backundo(%d,%d)\n", f, n));
 
-    if (!f || n < 1)
-	n = 1;
+    n = need_at_least(f, n, 1);
 
     if (b_val(curbp, MDVIEW)) {
 	status = rdonly();
@@ -417,8 +415,7 @@
 
     TRACE((T_CALLED "forwundo(%d,%d)\n", f, n));
 
-    if (!f || n < 1)
-	n = 1;
+    n = need_at_least(f, n, 1);
 
     if (b_val(curbp, MDVIEW)) {
 	status = rdonly();
Index: version.c
Prereq:  1.59 
--- vile-9.5k+/version.c	2006-01-12 22:37:43.000000000 +0000
+++ vile-9.5l/version.c	2006-11-04 15:43:59.000000000 +0000
@@ -1,7 +1,7 @@
 /*
  * version & usage-messages for vile
  *
- * $Header: /usr/build/vile/vile/RCS/version.c,v 1.59 2006/01/12 22:37:43 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/version.c,v 1.61 2006/11/04 15:43:59 tom Exp $
  *
  */
 
@@ -16,70 +16,88 @@
 {
     static const char *const options[] =
     {
-	"-h             to get help on startup",
-	"-gNNN          or simply +NNN to go to line NNN",
-#if SYS_WINNT && DISP_NTWIN
-	"-fn fontspec   to change font",
-	"-geometry CxR  to set initial size to R rows and C columns",
-#endif
-#if SYS_WINNT && DISP_NTCONS
-	"-console       if stdin is not a tty, start editor in a new console",
+	"-h             display [Help] on startup",
+	"-c command     execute the given ex-style command",
+	"-e             edit in \"noview\" mode -- changes permitted",
+#if OPT_EVAL || OPT_DEBUGMACROS
+	"-D             trace macros into [Trace] buffer",
 #endif
-#if SYS_WINNT && defined(VILE_OLE) && DISP_NTWIN
-	"-Oa            invoke as an OLE Automation server",
-	"-Or            register ole automation interface and exit",
-	"-Ou            unregister ole automation interface and exit",
-	"-invisible     OLE Automation server does not initially show a window",
-	"-multiple      multiple instances of OLE Automation server permitted",
+	"-I             use vileinit.rc to initialize",
+#if OPT_ENCRYPT
+	"-k cryptkey    for encrypted files",
 #endif
-	"-sstring       or +/string to search for \"string\"",
+	"-R             edit files \"read-only\" -- no writes permitted",
 #if OPT_TAGS
 #if DISP_X11			/* because -title is predefined */
-	"-Ttagname      to look up a tag",
+	"-T tagname     look up a tag",
 #else
-	"-ttagname      to look up a tag",
+	"-t tagname     look up a tag",
 #endif
 #endif
-	"-v             to edit in \"view\" mode -- no changes permitted",
-	"-R             to edit files \"read-only\" -- no writes permitted",
-#if OPT_ENCRYPT
-	"-kcryptkey     for encrypted files (same as -K)",
-#endif
-#if DISP_X11
-	"-name name     to change program name for X resources",
-	"-title name    to set name in title bar",
-	"-fg color      to change foreground color",
-	"-bg color      to change background color",
-	"-fn fontname   to change font",
-	"-fork          to spawn xvile immediately on startup",
-	"+fork          to force xvile to not spawn on startup",
-	"-display       displayname to change the default display",
-	"-rv            for reverse video",
-	"-geometry CxR  to set initial size to R rows and C columns",
-	"-xrm Resource  to change an xvile resource",
-	"-leftbar       Put scrollbar(s) on left",
-	"-rightbar      Put scrollbar(s) on right (default)",
+	"-v             edit in \"view\" mode -- no changes permitted",
+	"-V             for version info",
+	"use @cmdfile to run cmdfile as commands (this suppresses "
+	DFT_STARTUP_FILE ")",
+
+#if SYS_VMS
+	"",
+	"VMS-specific:",
+	"-80            80-column mode",
+	"-132           132-column mode",
 #endif
+
 #if DISP_BORLAND
+	"",
+	"DOS-specific:",
 	"-2             25-line mode",
 	"-4             43-line mode",
 	"-5             50-line mode",
-#if SYS_OS2
 	"-6             60-line mode",
-#endif
 	"(see help file for more screen resolutions)",
 #endif
-#if SYS_VMS
-	"-80            80-column mode",
-	"-132           132-column mode",
+
+#if SYS_WINNT
+	"",
+	"Win32-specific:",
+#if DISP_NTWIN
+	"-fn fontspec   change font",
+	"-geometry CxR  set initial size to R rows and C columns",
+#if defined(VILE_OLE)
+	"-Oa            invoke as an OLE Automation server",
+	"-Or            register ole automation interface and exit",
+	"-Ou            unregister ole automation interface and exit",
+	"-invisible     OLE Automation server does not initially show a window",
+	"-multiple      multiple instances of OLE Automation server permitted",
 #endif
-#if OPT_EVAL || OPT_DEBUGMACROS
-	"-D             trace macros into [Trace] buffer",
+#endif				/* DISP_NTWIN */
+
+#if DISP_NTCONS
+	"-console       if stdin is not a tty, start editor in a new console",
 #endif
-	"-V             for version info",
-	"-I             use vileinit.rc to initialize",
-	"use @cmdfile to run cmdfile as commands (this will suppress .vilerc)",
-	"single-letter options usually are case-independent"
+#endif				/* SYS_WINNT */
+
+#if DISP_X11
+	"",
+	"X11-specific:",
+	"-name name     change program name for X resources",
+	"-title name    set name in title bar",
+	"-fg color      change foreground color",
+	"-bg color      change background color",
+	"-fn fontname   change font",
+	"-fork          spawn xvile immediately on startup",
+	"+fork          force xvile to not spawn on startup",
+	"-display       displayname to change the default display",
+	"-rv            for reverse video",
+	"-geometry CxR  set initial size to R rows and C columns",
+	"-xrm resource  change an xvile resource",
+	"-leftbar       put scrollbar(s) on left",
+	"-rightbar      put scrollbar(s) on right (default)",
+#endif				/* DISP_X11 */
+
+	"",
+	"Obsolete:",
+	"-g NNN         or simply +NNN to go to line NNN",
+	"-s string      or +/string to search for \"string\"",
     };
 
     term.clean(TRUE);
@@ -90,8 +108,14 @@
 		   prog_arg);
     {
 	unsigned j;
-	for (j = 0; j < TABLESIZE(options); j++)
-	    (void) fprintf(stderr, "\t%s\n", options[j]);
+	for (j = 0; j < TABLESIZE(options); j++) {
+	    char *colon = strrchr(options[j], ':');
+	    if (colon != 0 && colon[1] == EOS) {
+		(void) fprintf(stderr, "%s\n", options[j]);
+	    } else {
+		(void) fprintf(stderr, "\t%s\n", options[j]);
+	    }
+	}
     }
 #endif
     ExitProgram(code);
Index: vile-9.5.spec
Prereq:  1.12 
--- vile-9.5k+/vile-9.5.spec	2006-08-13 18:08:19.000000000 +0000
+++ vile-9.5l/vile-9.5.spec	2006-10-02 23:18:55.000000000 +0000
@@ -1,7 +1,7 @@
 Summary: VILE VI Like Emacs editor
-# $Header: /usr/build/vile/vile/RCS/vile-9.5.spec,v 1.12 2006/08/13 18:08:19 tom Exp $
+# $Header: /usr/build/vile/vile-9.5k2/RCS/vile-9.5.spec,v 1.13 2006/10/02 23:18:55 tom Exp $
 Name: vile
-Version: 9.5k
+Version: 9.5l
 # each patch should update the version
 Release: 1
 Copyright: GPL
@@ -19,6 +19,7 @@
 Patch9: vile-9.5i.patch.gz
 Patch10: vile-9.5j.patch.gz
 Patch11: vile-9.5k.patch.gz
+Patch12: vile-9.5l.patch.gz
 # each patch should add itself to this list
 Packager: Thomas Dickey <dickey@invisible-island.net>
 BuildRoot: %{_tmppath}/%{name}-root
@@ -42,6 +43,7 @@
 %patch9 -p1
 %patch10 -p1
 %patch11 -p1
+%patch12 -p1
 # each patch should add itself to this list
 
 %build
@@ -94,6 +96,9 @@
 %changelog
 # each patch should add its ChangeLog entries here
 
+* Mon Oct 02 2006 Thomas Dickey
+- added patch for 9.5k
+
 * Sun Aug 13 2006 Thomas Dickey
 - added patch for 9.5k
 
Index: vile.1
Prereq:  1.31 
--- vile-9.5k+/vile.1	2006-05-21 00:30:59.000000000 +0000
+++ vile-9.5l/vile.1	2006-11-06 01:18:30.000000000 +0000
@@ -1,10 +1,10 @@
 .\" obligatory man page for vile
-.\" $Header: /usr/build/vile/vile/RCS/vile.1,v 1.31 2006/05/21 00:30:59 pgf Exp $
+.\" $Header: /usr/build/vile/vile/RCS/vile.1,v 1.36 2006/11/06 01:18:30 tom Exp $
 .TH VILE 1
 .SH NAME
 vile, xvile \- \fBVI L\fRike \fBE\fRmacs
 .SH SYNOPSIS
-.B "vile [-hIiRVv] [-s\fIpattern\fB] [+\fI/pattern\fB] [-t\fItag\fB] [-g\fINNN\fB] [-kcryptkey] [+\fINNN\fB] [@\fIcmdfile\fB] [\fIfilename\fB]..."
+.B "vile [@\fIcmdfile\fB] [+\fIcommand\fB] [-hIiRVv] [-g\fINNN\fB] [-k\fIcryptkey\fB] [-s\fIpattern\fB] [-t\fItag\fB] [\fIfilename\fB]..."
 .SH DESCRIPTION
 .I vile
 is a text editor.  This man page is fairly terse.  More information can
@@ -33,26 +33,78 @@
 .I vile
 tries to do for vi users.
 .SH OPTIONS
-.IP "+\fINNN\fR and -g\fINNN\fR"
-.I vile
-will begin the session on the first file at the specified line number.
-.IP "+/\fIpattern\fR or -s \fIpattern\fR"
-In the first file,
+Vile accumulates most options into two temporary buffers \fI[vileinit]\fP
+and \fI[vileopts]\fP.
+The former is executed before reading the first file into a buffer.
+The latter is executed after reading the first file into a buffer.
+Each is removed after executing (unless an error is detected).
+.
+.SS COMMON OPTIONS
+.
+.IP "-c\fIcommand\fR"
+.I vile
+will begin the session on the first file invoking the given command.
+Legal commands include many ex-style commands, vile-commands, etc.,
+subject to shell quoting.
+This option is used most often with a line number or search pattern.
+For example
+.sp
+.RS 10
+.nf
+vile -c123 filename
+vile -c/pattern filename
+.fi
+.RE
+.IP
+They correspond to ex-style commands on the given file:
+.sp
+.RS 10
+.nf
+:123
+:/pattern
+.fi
+.RE
+.IP
+These are more verbose equivalents:
+.sp
+.RS 10
+.nf
+vile -c'123 goto-line' filename
+vile -c'search-forward /pattern/' filename
+.fi
+.RE
+.IP
+You can use more than one command, e.g.,
+.sp
+.RS 10
+vile -c'123' -c'10*goto-col' filename
+.RE
+.IP
+to put the cursor on column 10 of line 123.
+The "*" (or ":") separates the repeat count (used by \fIgoto-col\fP) from the
+line- or range-specification used by line-oriented commands.
+.
+.IP @\fIcmdfile\fR
 .I vile
-will execute an initial search for the given pattern.
-.IP "-t \fItag\fR"
-.br
+will run the specified file as its startup
+file, and will bypass any normal startup file (i.e.
+.IR .vilerc )
+or environment variable (i.e.
+.IR $VILEINIT ).
+This is added to \fI[vileinit]\fP.
+.IP -D
+tells \fIvile\fP to trace the results of macro execution into the hidden buffer
+"[Trace]".
+.IP "-e | -E"
+Invokes
 .I vile
-will edit the correct file and move the cursor to the location of the tag.
-This requires a tagsfile created with the
-.IR ctags (1)
-command.  The option -T is equivalent, and can be used when X11 option
-parsing eats the -t.
+in "noview" mode \- changes are permitted to any buffer while
+in this mode (see "-v").
 .IP -h
 Invokes
 .I vile
 on the helpfile.
-.IP -I\ -i
+.IP "-i | -I"
 Tells
 .I vile
 to use
@@ -63,9 +115,12 @@
 .I vile
 will make a short one that sources
 .I vileinit.rc
-.IP "-k cryptkey | -K cryptkey"
+This is added to \fI[vileinit]\fP.
+.IP "-k \fIcryptkey\fP | -K \fIcryptkey\fP"
 Specifies an encryption/decryption key.
 See below for further discussion.
+This option applies only locally to the buffers named on the command-line,
+and is not added to \fI[vileopts]\fP, since that is executed too late.
 .IP -R
 Invokes
 .I vile
@@ -76,34 +131,55 @@
 is invoked as
 .IR view ,
 or if "readonly" mode is set in the startup file.)
+.IP "-s \fIpattern\fR | -S \fIpattern\fR"
+In the first file,
+.I vile
+will execute an initial search for the given pattern.
+This is not the same as "-c/\fIpattern\fP",
+since that positions the cursor to
+the line matching the pattern.
+This option positions the cursor within the line.
+.IP "-t \fItag\fR"
+.br
+.I vile
+will edit the correct file and move the cursor to the location of the tag.
+This requires a tagsfile created with the
+.IR ctags (1)
+command.  The option -T is equivalent, and can be used when X11 option
+parsing eats the -t.
 .IP -v
 Invokes
 .I vile
 in "view" mode \- no changes are permitted to any buffer while
-in this mode.
-.IP -D
-tells vile to trace the results of macro execution into the hidden buffer
-"[Trace]".
+in this mode (see "-e").
 .IP -V
 .I vile
 will report its version number.
-.IP @\fIcmdfile\fR
-.I vile
-will run the specified file as its startup
-file, and will bypass any normal startup file (i.e.
-.IR .vilerc )
-or environment variable (i.e.
-.IR $VILEINIT ).
-.IP "-25 -43 -50"
+.IP "-25 -43 -50 -60"
 On PC systems you may be able to set the initial screen resolution from the
+command line.
+.IP "-80 -132"
+On VMS systems you may be able to set the initial screen resolution from the
 command line.  See
 .I vile.hlp
 for details.
+.SS X11 OPTIONS
 .PP
 .IR xvile -specific
 command-line options are detailed in the help file (see "Standard X command
 line arguments").  The standard ones (e.g. -display, -fn, -geometry, -name,
 etc.) are all supported.
+.SS OBSOLETE OPTIONS
+vile recognizes some options which duplicate the functionality of the
+POSIX "-c" option:
+.IP "+\fIcommand\fR"
+This has the same effect as "-c\fIcommand\fP".
+.IP "-g \fINNN\fP | -G \fINNN\fP"
+This has the same effect as "-c\fINNN\fP".
+.I vile
+will begin the session on the first file jumping to the given line number
+\fINNN\fP.
+.
 .SH "INVOCATION"
 vile will edit the files specified on the command line.  If no files
 are specified, and standard input is not connected to a terminal, then
@@ -208,9 +284,9 @@
 interface with GNU's gpg package.
 .SH "ENVIRONMENT VARIABLES"
 .TP
-.B
-VILEINIT
+.B VILEINIT
 Editor initialization commands in lieu of a startup file.
+These are copied into \fI[vileinit]\fP, and executed.
 .TP
 .B VILE_HELP_FILE
 Override the name of the help file, normally ``vile.hlp''.
Index: vile.hlp
Prereq:  1.612 
--- vile-9.5k+/vile.hlp	2006-05-21 00:31:14.000000000 +0000
+++ vile-9.5l/vile.hlp	2006-11-01 21:21:16.000000000 +0000
@@ -1600,6 +1600,42 @@
 		For more information, see the section describing the ":map"
 		command, below.  (U)
 
+	modeline Controls whether a vi-like modeline feature is enabled.
+		This is a different term than the emacs-like modeline which
+		acts as a status-line for each window.  When enabled, vile
+		scans the given number of lines from top and bottom of the
+		buffer when it is first loaded into memory.  It looks for
+		lines containing one of these special markers after whitespace:
+
+			"vi:"
+			"vile:"
+
+		or (depending on the configuration):
+
+			"xvile:"
+			"winvile:"
+
+		After that, either a "set" command terminated by a colon, e.g.,
+
+			vile:set txtmode:
+
+		or one or more mode assignments, treating colons as a
+		whitespace separator, e.g, these are equivalent,
+
+			vile:ts=4 nu
+			vile:ts=4:nu
+
+		The modelines at the top of the buffer are processed first
+		(working forward from the top), then the ones at the bottom
+		(working backward from the end).  If the buffer is small
+		enough, the available modelines could overlap; but the program
+		interprets each line at most once.
+
+		This is a buffer mode, enabling its use in majormodes.  (B)
+
+	modelines Controls the number of lines from each end of the buffer
+		to scan for vi-like mode lines.  Defaults to 5 (B)
+
 	overlap-matches Modifies the highlighting shown by visual-matches to
 		control whether overlapping matches are shown.  For some
 		conditions, setting this to false will present a more natural
@@ -5387,17 +5423,12 @@
 	a "set sres=" line in your vile.rc, or if you use a command line
 	option to change it.  Command line options consist of a dash
 	followed by one of the following selectors (these are the same
-	values that can be assigned to "sres"):
-	    "default",
-	    "2",     "25",    "80x25",
-	    "4",     "43",    "80x43",
-	    "5",     "50",    "80x50",
-	    "80x14", "80x28",
-	    "40x12", "40x21", "40x25", "40x28", "40x50",
-
-	[ Currently, under DOS, not all modes may work, as a result of
-	  the screen library being used... (in version 5.5).  More may
-	  work under OS/2. ]
+	values that can be assigned to "sres").  These values are supported
+	by the DOS (borland.c) terminal driver:
+	    "2",     "25",
+	    "4",     "43",
+	    "5",     "50",
+	    "6",     "60"
 
 	If you shell out in 50 line mode, make sure you are in 50 line mode
 	before you exit the dos shell, otherwise you end up with a 50 line
@@ -6231,4 +6262,4 @@
 
 Copyright 1995-2005,2006 by Paul Fox, Thomas Dickey, and Kevin Buettner
 --------------------------------------------------------------------
- $Header: /usr/build/vile/vile/RCS/vile.hlp,v 1.612 2006/05/21 00:31:14 pgf Exp $
+ $Header: /usr/build/vile/vile/RCS/vile.hlp,v 1.616 2006/11/01 21:21:16 tom Exp $
Index: window.c
Prereq:  1.106 
--- vile-9.5k+/window.c	2005-01-19 01:56:03.000000000 +0000
+++ vile-9.5l/window.c	2006-11-02 01:49:42.000000000 +0000
@@ -2,7 +2,7 @@
  * Window management. Some of the functions are internal, and some are
  * attached to keys that the user actually types.
  *
- * $Header: /usr/build/vile/vile/RCS/window.c,v 1.106 2005/01/19 01:56:03 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/window.c,v 1.107 2006/11/02 01:49:42 tom Exp $
  *
  */
 
@@ -204,8 +204,7 @@
     int row;
     int s;
 
-    if (!f)
-	n = 1;
+    n = need_a_count(f, n, 1);
 
     if (clexec || isnamedcmd) {
 	static char cbuf[20];
@@ -271,8 +270,7 @@
 int
 mvdnwind(int f, int n)
 {
-    if (!f)
-	n = 1;
+    n = need_a_count(f, n, 1);
     return (mvupwind(TRUE, -n));
 }
 
@@ -292,8 +290,7 @@
 
     lp = curwp->w_line.l;
 
-    if (!f)
-	n = 1;
+    n = need_a_count(f, n, 1);
 
     if (n < 0)
 	curwp->w_flag |= WFKILLS;
Index: word.c
Prereq:  1.80 
--- vile-9.5k+/word.c	2006-04-19 22:40:54.000000000 +0000
+++ vile-9.5l/word.c	2006-11-02 01:50:12.000000000 +0000
@@ -3,7 +3,7 @@
  * paragraph at a time.  There are all sorts of word mode commands.  If I
  * do any sentence mode commands, they are likely to be put in this file.
  *
- * $Header: /usr/build/vile/vile/RCS/word.c,v 1.80 2006/04/19 22:40:54 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/word.c,v 1.81 2006/11/02 01:50:12 tom Exp $
  *
  */
 
@@ -167,9 +167,10 @@
 forwviendw(int f, int n)
 {
     int s = FALSE;
-    if (!f)
-	n = 1;
-    else if (n <= 0)
+
+    n = need_a_count(f, n, 1);
+
+    if (n <= 0)
 	return (FALSE);
     if (forwchar(TRUE, 1) == FALSE)
 	return (FALSE);
@@ -199,9 +200,10 @@
 forwendw(int f, int n)
 {
     int s = FALSE;
-    if (!f)
-	n = 1;
-    else if (n <= 0)
+
+    n = need_a_count(f, n, 1);
+
+    if (n <= 0)
 	return (FALSE);
     if (forwchar(TRUE, 1) == FALSE)
 	return (FALSE);
Index: wordmov.c
Prereq:  1.22 
--- vile-9.5k+/wordmov.c	2004-04-11 23:22:31.000000000 +0000
+++ vile-9.5l/wordmov.c	2006-11-06 21:00:51.000000000 +0000
@@ -3,9 +3,9 @@
  *	in the punctuated vi sense, and in the whitespace/darkspace
  *	sense.  The transition is reported _after_ it has occurred.  You
  *	need to back up to get to the char. before the transition.
- *	Written for vile: Copyright (c) 1990, 1995-1999 by Paul Fox
+ *	Written for vile.  Copyright (c) 1990, 1995-1999 by Paul Fox
  *
- * $Header: /usr/build/vile/vile/RCS/wordmov.c,v 1.22 2004/04/11 23:22:31 tom Exp $
+ * $Header: /usr/build/vile/vile/RCS/wordmov.c,v 1.23 2006/11/06 21:00:51 tom Exp $
  *
  */