diff -r -U2 --entire less-232/NEWS less-237/NEWS --- less-232/NEWS Fri Sep 23 17:22:12 1994 +++ less-237/NEWS Fri Sep 30 15:02:07 1994 @@ -1,4 +1,4 @@ - Major changes between "less" versions 170 and 232 + Major changes between "less" versions 170 and 237 * By popular demand, text which matches the current search pattern diff -r -U2 --entire less-232/README less-237/README --- less-232/README Fri Sep 23 17:23:08 1994 +++ less-237/README Fri Sep 30 15:03:06 1994 @@ -1,4 +1,4 @@ ======================================================================= -=== NOTE: THIS IS A BETA DISTRIBUTION OF less (version 232) === +=== NOTE: THIS IS A DISTRIBUTION OF less (version 237) === === PLEASE REPORT ANY PROBLEMS TO THE AUTHOR AT markn@3do.com. === ======================================================================= diff -r -U2 --entire less-232/acconfig.h less-237/acconfig.h --- less-232/acconfig.h Fri Sep 23 13:53:04 1994 +++ less-237/acconfig.h Fri Sep 30 14:40:31 1994 @@ -67,2 +67,5 @@ /* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */ #undef HAVE_TERMIOS_FUNCS + +/* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower */ +#undef HAVE_UPPER_LOWER diff -r -U2 --entire less-232/configure less-237/configure --- less-232/configure Fri Sep 23 17:49:56 1994 +++ less-237/configure Fri Sep 30 14:40:48 1994 @@ -488,4 +488,5 @@ +TERMLIBS= ac_save_LIBS="${LIBS}" LIBS="${LIBS} -lcurses" @@ -506,5 +507,5 @@ LIBS="${ac_save_LIBS}" if test -n "${ac_have_lib}"; then - :; LIBS="$LIBS -lcurses" + :; TERMLIBS="$TERMLIBS -lcurses" else :; @@ -529,5 +530,5 @@ LIBS="${ac_save_LIBS}" if test -n "${ac_have_lib}"; then - :; LIBS="$LIBS -ltermcap" + :; TERMLIBS="$TERMLIBS -ltermcap" else :; @@ -535,7 +536,7 @@ ac_save_LIBS="${LIBS}" -LIBS="${LIBS} -lgen" +LIBS="${LIBS} -ltermlib" ac_have_lib="" -test -n "$silent" || echo "checking for -lgen" +test -n "$silent" || echo "checking for -ltermlib" cat > conftest.${ac_ext} < conftest.${ac_ext} < conftest.${ac_ext} < conftest.${ac_ext} < conftest.${ac_ext} < +#endif +int main() { return 0; } +int t() { static int x; x = isupper(x); x = tolower(x); x = toupper(x);; return 0; } +EOF +if eval $ac_compile; then + rm -rf conftest* + +{ +test -n "$verbose" && \ +echo " defining HAVE_UPPER_LOWER" +echo "#define" HAVE_UPPER_LOWER "1" >> confdefs.h +DEFS="$DEFS -DHAVE_UPPER_LOWER=1" +ac_sed_defs="${ac_sed_defs}\${ac_dA}HAVE_UPPER_LOWER\${ac_dB}HAVE_UPPER_LOWER\${ac_dC}1\${ac_dD} +\${ac_uA}HAVE_UPPER_LOWER\${ac_uB}HAVE_UPPER_LOWER\${ac_uC}1\${ac_uD} +\${ac_eA}HAVE_UPPER_LOWER\${ac_eB}HAVE_UPPER_LOWER\${ac_eC}1\${ac_eD} " } diff -r -U2 --entire less-232/configure.in less-237/configure.in --- less-232/configure.in Fri Sep 23 13:51:01 1994 +++ less-237/configure.in Fri Sep 30 14:37:21 1994 @@ -9,17 +9,31 @@ dnl Checks for libraries. -dnl Prefer BSD termcap library to SysV curses library. -AC_HAVE_LIBRARY(curses, [LIBS="$LIBS -lcurses"]) -AC_HAVE_LIBRARY(termcap, [LIBS="$LIBS -ltermcap"]) -dnl ??? AC_HAVE_LIBRARY(termlib, [LIBS="$LIBS -ltermlib"]) -dnl Regular expressions (regcmp) are in -lgen or -lucb on Solaris 2. +TERMLIBS= +AC_HAVE_LIBRARY(curses, [TERMLIBS="$TERMLIBS -lcurses"]) +AC_HAVE_LIBRARY(termcap, [TERMLIBS="$TERMLIBS -ltermcap"]) +AC_HAVE_LIBRARY(termlib, [have_termlib=yes], [have_termlib=no]) +dnl Regular expressions (regcmp) are in -lgen on Solaris 2, +dnl and in -lintl on SCO Unix. AC_HAVE_LIBRARY(gen, [LIBS="$LIBS -lgen"]) -AC_HAVE_LIBRARY(ucb, [LIBS="$LIBS -lucb"]) AC_HAVE_LIBRARY(intl, [LIBS="$LIBS -lintl"]) dnl ??? AC_HAVE_LIBRARY(gnuregex, [LIBS="$LIBS -lgnuregex"]) +dnl Solaris has curses & termcap, but they don't work without libucb +dnl which is broken, so we use termlib. +AC_CHECKING(termlib) +SAVE_LIBS=$LIBS +LIBS="$LIBS $TERMLIBS" +AC_COMPILE_CHECK(, , [tgetent(0); tgetflag(0); tgetnum(0); tgetstr(0);], + [termok=yes], [termok=no]) +if test $termok = no; then + LIBS="$SAVE_LIBS" + if test $have_termlib = yes; then + LIBS="$LIBS -ltermlib" + fi +fi + dnl Checks for header files. AC_STDC_HEADERS -AC_HAVE_HEADERS(errno.h fcntl.h stdio.h termcap.h termio.h termios.h time.h unistd.h values.h sys/ioctl.h sys/stream.h sys/ptem.h) +AC_HAVE_HEADERS(ctype.h errno.h fcntl.h stdio.h termcap.h termio.h termios.h time.h unistd.h values.h sys/ioctl.h sys/stream.h sys/ptem.h) dnl Checks for identifiers. @@ -32,5 +46,5 @@ dnl Checks for functions and external variables. AC_RETSIGTYPE -AC_HAVE_FUNCS(_setjmp system sigsetmask memcpy) +AC_HAVE_FUNCS(_setjmp system sigsetmask memcpy strchr) dnl Some systems have termios.h but not the corresponding functions. AC_FUNC_CHECK(tcgetattr, AC_DEFINE(HAVE_TERMIOS_FUNCS)) @@ -53,4 +67,9 @@ #include ], [setlocale(LC_CTYPE,""); isprint(0); iscntrl(0);], [AC_DEFINE(HAVE_LOCALE)]) +AC_COMPILE_CHECK(ctype, [ +#if HAVE_CTYPE_H +#include +#endif], [static int x; x = isupper(x); x = tolower(x); x = toupper(x);], + [AC_DEFINE(HAVE_UPPER_LOWER)]) have_ospeed=no diff -r -U2 --entire less-232/defines.h.in less-237/defines.h.in --- less-232/defines.h.in Fri Sep 23 13:53:13 1994 +++ less-237/defines.h.in Fri Sep 30 14:40:42 1994 @@ -174,4 +174,7 @@ #undef HAVE_TERMIOS_FUNCS +/* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower */ +#undef HAVE_UPPER_LOWER + /* Define if you have _setjmp. */ #undef HAVE__SETJMP @@ -183,6 +186,12 @@ #undef HAVE_SIGSETMASK +/* Define if you have strchr. */ +#undef HAVE_STRCHR + /* Define if you have system. */ #undef HAVE_SYSTEM + +/* Define if you have the header file. */ +#undef HAVE_CTYPE_H /* Define if you have the header file. */ diff -r -U2 --entire less-232/doscreen.c less-237/doscreen.c --- less-232/doscreen.c Wed Aug 24 02:57:23 1994 +++ less-237/doscreen.c Mon Sep 26 17:10:22 1994 @@ -152,4 +152,9 @@ } + public void +get_editkeys() +{ +} + /* * Get terminal capabilities via termcap. diff -r -U2 --entire less-232/less.h less-237/less.h --- less-232/less.h Fri Aug 26 00:59:10 1994 +++ less-237/less.h Fri Sep 30 14:50:52 1994 @@ -59,4 +59,7 @@ #include #endif +#if HAVE_CTYPE_H +#include +#endif #if STDC_HEADERS #include @@ -69,4 +72,11 @@ VOID_POINTER calloc(); void free(); +#endif + +#if !HAVE_UPPER_LOWER +#define isupper(c) ((c) >= 'A' && (c) <= 'Z') +#define islower(c) ((c) >= 'a' && (c) <= 'z') +#define toupper(c) ((c) - 'a' + 'A') +#define tolower(c) ((c) - 'A' + 'a') #endif diff -r -U2 --entire less-232/less.man less-237/less.man --- less-232/less.man Tue Sep 13 00:54:39 1994 +++ less-237/less.man Fri Sep 30 13:18:58 1994 @@ -1363,15 +1363,15 @@ If a line longer than the screen width is split (folded), and a search matches text which straddles the split, the - matching text will not be highlighted (although it will - still be found by the search). - - If a search is done using the ! operator for text NOT match- - ing a pattern, the strings which do match the pattern are - highlighted. + matching text will not be highlighted. In certain cases, + patterns beginning with a ^ may not be highlighted + correctly. If a search is done using the ! operator for + text NOT matching a pattern, the strings which do match the + pattern are highlighted. In all cases, even if the + highlighting is incorrect, the text will nevertheless be + found correctly by the search. COPYRIGHT Copyright (c) 1984,1985,1989,1994 Mark Nudelman - diff -r -U2 --entire less-232/less.nro less-237/less.nro --- less-232/less.nro Tue Sep 13 00:48:42 1994 +++ less-237/less.nro Fri Sep 30 13:17:58 1994 @@ -1139,9 +1139,11 @@ If a line longer than the screen width is split (folded), and a search matches text which straddles the split, -the matching text will not be highlighted (although it will still -be found by the search). -.PP +the matching text will not be highlighted. +In certain cases, patterns beginning with a ^ may not be +highlighted correctly. If a search is done using the ! operator for text NOT matching a pattern, the strings which do match the pattern are highlighted. +In all cases, even if the highlighting is incorrect, +the text will nevertheless be found correctly by the search. .SH COPYRIGHT diff -r -U2 --entire less-232/lesskey.c less-237/lesskey.c --- less-232/lesskey.c Tue Sep 13 00:56:02 1994 +++ less-237/lesskey.c Thu Sep 29 15:36:25 1994 @@ -281,7 +281,8 @@ ++p; for (i = 0; p[i] != '\n' && p[i] != '\0'; i++) - ; + if (p[i] == '#' && (i == 0 || p[i-1] != '\\')) + break; p[i] = '\0'; - if (*p == '#' || *p == '\0') + if (*p == '\0') continue; @@ -331,5 +332,5 @@ ++p; for (j = 0; p[j] != ' ' && p[j] != '\t' && - p[j] != '#' && p[j] != '\0'; j++) + p[j] != '\0'; j++) ; p[j] = '\0'; diff -r -U2 --entire less-232/lesskey.man less-237/lesskey.man --- less-232/lesskey.man Tue Sep 13 00:57:24 1994 +++ less-237/lesskey.man Fri Sep 30 13:08:31 1994 @@ -22,12 +22,12 @@ The input file consists of lines of the form: - string action [extra-string] + _s_t_r_i_n_g _a_c_t_i_o_n [extra-string] Whitespace is any sequence of one or more spaces and/or - tabs. The "string" is the command key(s) which invoke the - action. The string may be a single command key, or a - sequence of up to 15 keys. The "action" is the name of the + tabs. The _s_t_r_i_n_g is the command key(s) which invoke the + action. The _s_t_r_i_n_g may be a single command key, or a + sequence of up to 15 keys. The _a_c_t_i_o_n is the name of the less action, from the list below. The characters in the - "string" may appear literally, or be prefixed by a carat to + _s_t_r_i_n_g may appear literally, or be prefixed by a carat to indicate a control key. A backslash followed by one to three octal digits may be used to specify a character by its @@ -50,5 +50,5 @@ :set\ nonu toggle-option +N - See also the ":ta" command in the example below. + See also the ":t" command in the example below. @@ -89,5 +89,4 @@ u back-scroll ^U back-scroll - ' back-scroll \40 forw-screen f forw-screen @@ -115,13 +114,14 @@ [ forw-bracket [] ] back-bracket [] - \e^F forw-bracket - \e^B back-bracket + \e^F forw-bracket + \e^B back-bracket G goto-end \e> goto-end > goto-end - P goto-end = status ^G status :f status + / forw-search + ? back-search @@ -138,6 +138,4 @@ - / forw-search - ? back-search \e/ forw-search * \e? back-search * @@ -174,5 +172,9 @@ Commands specified by _l_e_s_s_k_e_y take precedence over the default commands. A default command key may be disabled by - including it in the key file with the action "invalid". + including it in the key file with the action "invalid". A + key may be defined to do nothing by using the action "noac- + tion". This is similar to "invalid", but _l_e_s_s will give an + error beep for an "invalid" command, but not for a "noac- + tion" command. @@ -181,13 +183,11 @@ -COPYRIGHT - Copyright (c) 1984,1985,1989,1994 Mark Nudelman - - - - - +WARNINGS + If you already have a $HOME/.less file, running lesskey will + overwrite it. +COPYRIGHT + Copyright (c) 1984,1985,1989,1994 Mark Nudelman diff -r -U2 --entire less-232/lesskey.nro less-237/lesskey.nro --- less-232/lesskey.nro Tue Sep 13 00:56:49 1994 +++ less-237/lesskey.nro Fri Sep 30 13:07:54 1994 @@ -16,11 +16,11 @@ The input file consists of lines of the form: .sp - string action [extra-string] + \fIstring\fP \fIaction\fP [extra-string] .sp Whitespace is any sequence of one or more spaces and/or tabs. -The "string" is the command key(s) which invoke the action. -The string may be a single command key, or a sequence of up to 15 keys. -The "action" is the name of the less action, from the list below. -The characters in the "string" may appear literally, or be +The \fIstring\fP is the command key(s) which invoke the action. +The \fIstring\fP may be a single command key, or a sequence of up to 15 keys. +The \fIaction\fP is the name of the less action, from the list below. +The characters in the \fIstring\fP may appear literally, or be prefixed by a carat to indicate a control key. A backslash followed by one to three octal digits may be used to @@ -49,5 +49,5 @@ .fi .sp -See also the ":ta" command in the example below. +See also the ":t" command in the example below. .SH EXAMPLE @@ -74,5 +74,4 @@ u back-scroll ^U back-scroll - ' back-scroll \e40 forw-screen f forw-screen @@ -100,10 +99,9 @@ [ forw-bracket [] ] back-bracket [] - \ee^F forw-bracket - \ee^B back-bracket + \ee^F forw-bracket + \ee^B back-bracket G goto-end \ee> goto-end > goto-end - P goto-end = status ^G status @@ -149,7 +147,15 @@ A default command key may be disabled by including it in the key file with the action "invalid". +A key may be defined to do nothing by using the action "noaction". +This is similar to "invalid", but +.I less +will give an error beep for an "invalid" command, +but not for a "noaction" command. .SH "SEE ALSO" less(1) + +.SH "WARNINGS" +If you already have a $HOME/.less file, running lesskey will overwrite it. .SH COPYRIGHT diff -r -U2 --entire less-232/opttbl.c less-237/opttbl.c --- less-232/opttbl.c Wed Aug 24 02:56:06 1994 +++ less-237/opttbl.c Fri Sep 30 14:36:29 1994 @@ -33,6 +33,4 @@ #include "option.h" -#define toupper(c) ((c)-'a'+'A') - /* * Variables controlled by command line options. diff -r -U2 --entire less-232/position.c less-237/position.c --- less-232/position.c Thu Aug 25 15:20:55 1994 +++ less-237/position.c Mon Sep 26 18:18:40 1994 @@ -66,5 +66,5 @@ break; case MIDDLE: - where = sc_height / 2; + where = (sc_height - 1) / 2; } return (table[where]); diff -r -U2 --entire less-232/search.c less-237/search.c --- less-232/search.c Thu Sep 22 15:45:40 1994 +++ less-237/search.c Fri Sep 30 14:35:34 1994 @@ -106,7 +106,7 @@ for (src = osrc, dst = odst; *src != '\0'; src++, dst++) { - if ((ops & CVT_TO_LC) && *src >= 'A' && *src <= 'Z') + if ((ops & CVT_TO_LC) && isupper(*src)) /* Convert uppercase to lowercase. */ - *dst = *src + 'a' - 'A'; + *dst = tolower(*src); else if ((ops & CVT_BS) && *src == '\b' && dst > odst) /* Delete BS and preceding char. */ @@ -129,5 +129,5 @@ for (p = s; *p != '\0'; p++) - if (*p >= 'A' && *p <= 'Z') + if (isupper(*p)) return (1); return (0); @@ -645,2 +645,21 @@ } #endif + +#if !HAVE_STRCHR +/* + * strchr is used by regexp.c. + */ + char * +strchr(s, c) + char *s; + int c; +{ + for ( ; *s != '\0'; s++) + if (*s == c) + return (s); + if (c == '\0') + return (s); + return (NULL); +} +#endif + diff -r -U2 --entire less-232/signal.c less-237/signal.c --- less-232/signal.c Wed Sep 21 17:10:27 1994 +++ less-237/signal.c Mon Sep 26 17:10:39 1994 @@ -213,6 +213,5 @@ old_width = sc_width; old_height = sc_height; - scrsize(); - pos_init(); + get_term(); if (sc_width != old_width || sc_height != old_height) { diff -r -U2 --entire less-232/version.c less-237/version.c --- less-232/version.c Fri Sep 23 13:53:57 1994 +++ less-237/version.c Fri Sep 30 14:37:51 1994 @@ -419,5 +419,16 @@ * v232: Deal with weird systems that have 9/23/94 * termios.h but not tcgetattr(). + * Posted to prep.ai.mit.edu + * ----------------------------------------------------------------- + * v233: Use get_term() instead of pos_init() in 9/26/94 + * psignals to re-get lower_left termcap. + * (Thanks to John Malecki) + * v234: Make MIDDLE closer to middle of screen. 9/26/94 + * v235: Use local strchr if system doesn't have. 9/27/94 + * v236: Don't use libucb; use libterm if 9/28/94 + * libtermcap & libcurses doesn't work. + * (Fix for Solaris; thanks to Frank Kaefer) + * v237: Use system isupper() etc if provided. 9/30/94 */ -char version[] = "@(#) less version 232"; +char version[] = "@(#) less version 237";