Skip to content

Commit

Permalink
Add ^K search modifier, clean up makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwsw committed Jan 24, 1996
1 parent df6f74d commit 2a2099f
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 38 deletions.
26 changes: 13 additions & 13 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ${OBJ}: less.h defines.h funcs.h
filename.${O}: filename.c
${CC} -c -DHELPFILE=\"${datadir}/less.hlp\" -I. ${CPPFLAGS} ${CFLAGS} ${srcdir}/filename.c

install: all less.hlp less.nro installdirs
install: all ${srcdir}/less.hlp ${srcdir}/less.nro ${srcdir}/lesskey.nro installdirs
${INSTALL_PROGRAM} less ${bindir}/${binprefix}less
${INSTALL_PROGRAM} lesskey ${bindir}/${binprefix}lesskey
${INSTALL_DATA} ${srcdir}/less.hlp ${datadir}/less.hlp
Expand Down Expand Up @@ -132,22 +132,22 @@ realclean: distclean

REPLACE_VERSION = \
@REL=`sed -e '/char version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q ${srcdir}/version.c`; \
echo "Stuffing version number into $@"; \
echo "Stuffing version number $$REL into $@"; \
sed -e "s/@@VERSION@@/$$REL/" >$@

README: README.VER version.c
${REPLACE_VERSION} README.VER
NEWS: NEWS.VER version.c
${REPLACE_VERSION} NEWS.VER
less.nro: less.nro.VER version.c
${REPLACE_VERSION} less.nro.VER
lesskey.nro: lesskey.nro.VER version.c
${srcdir}/README: ${srcdir}/README.VER ${srcdir}/version.c
${REPLACE_VERSION} ${srcdir}/README.VER
${srcdir}/NEWS: ${srcdir}/NEWS.VER ${srcdir}/version.c
${REPLACE_VERSION} ${srcdir}/NEWS.VER
${srcdir}/less.nro: ${srcdir}/less.nro.VER ${srcdir}/version.c
${REPLACE_VERSION} ${srcdir}/less.nro.VER
${srcdir}/lesskey.nro: ${srcdir}/lesskey.nro.VER ${srcdir}/version.c
${REPLACE_VERSION} lesskey.nro.VER

less.man: less.nro
mkman less.nro >less.man
lesskey.man: lesskey.nro
mkman lesskey.nro >lesskey.man
${srcdir}/less.man: ${srcdir}/less.nro
mkman ${srcdir}/less.nro >${srcdir}/less.man
${srcdir}/lesskey.man: ${srcdir}/lesskey.nro
mkman ${srcdir}/lesskey.nro >${srcdir}/lesskey.man


dist: ${DISTFILES}
Expand Down
18 changes: 17 additions & 1 deletion NEWS.VER
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
Major changes between "less" versions 290 and @@VERSION@@

Major changes between "less" versions 291 and @@VERSION@@

* Command line at bottom of screen now scrolls, so it can be longer
than the screen width.

* New modifier for search commands: ^K means highlight the matches
currently on-screen, but don't move to the first match.

* Alternate modifiers for search commands: ^N is same as !,
^F is same as @, and ^E is same as *.


======================================================================


Major changes between "less" versions 290 and 291

* Less environment variables can be specified in lesskey files.

Expand Down
23 changes: 12 additions & 11 deletions command.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,18 @@ mca_search()
cmd_putstr("@");

if (search_type & SRCH_NO_MOVE)
{
cmd_putstr("@");
cmd_putstr("@");
}
cmd_putstr("#");

if (search_type & SRCH_PAST_EOF)
cmd_putstr("*");

if (search_type & SRCH_NOMATCH)
cmd_putstr("!");

if (search_type &
(SRCH_FIRST_FILE | SRCH_NO_MOVE | SRCH_PAST_EOF | SRCH_NOMATCH))
cmd_putstr(" ");

if (search_type & SRCH_FORW)
cmd_putstr("/");
else
Expand Down Expand Up @@ -350,18 +351,18 @@ mca_char(c)
flag = 0;
switch (c)
{
case CONTROL('N'): /* NOT match */
case '!':
flag = SRCH_NOMATCH;
break;
case CONTROL('F'): /* FIRST file */
case '@':
if (search_type & SRCH_FIRST_FILE)
{
/* "@@" */
search_type &= ~SRCH_FIRST_FILE;
flag = SRCH_NO_MOVE;
} else
flag = SRCH_FIRST_FILE;
flag = SRCH_FIRST_FILE;
break;
case CONTROL('K'): /* KEEP position */
flag = SRCH_NO_MOVE;
break;
case CONTROL('E'): /* ignore END of file */
case '*':
flag = SRCH_PAST_EOF;
break;
Expand Down
3 changes: 2 additions & 1 deletion less.hlp.old
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
Search patterns may be modified by one or more of:
! search for NON-matching lines.
* search multiple files.
@ start search at first file (for /) or last file (for ?).
^ start search at first file (for /) or last file (for ?).
@ highlight matches, but don't move to first match.
---------------------------------------------------
g < ESC-< * Go to first line in file (or line _N).
G > ESC-> * Go to last line in file (or line _N).
Expand Down
25 changes: 14 additions & 11 deletions less.nro.VER
Original file line number Diff line number Diff line change
Expand Up @@ -186,21 +186,21 @@ Certain characters are special
if entered at the beginning of the pattern;
they modify the type of search rather than become part of the pattern:
.RS
.IP !
.IP "^N or !"
Search for lines which do NOT match the pattern.
.IP *
.IP "^E or *"
Search multiple files.
That is, if the search reaches the end of the current file
That is, if the search reaches the END of the current file
without finding a match,
the search continues in the next file in the command line list.
.IP @
Begin the search at the first line of the first file
.IP "^F or @"
Begin the search at the first line of the FIRST file
in the command line list,
regardless of what is currently displayed on the screen
or the settings of the -a or -j options.
.IP @@
.IP "^K"
Highlight any text which matches the pattern on the current screen,
but don't move to the first match.
but don't move to the first match (KEEP current position).
.RE
.PP
.IP ?pattern
Expand All @@ -209,18 +209,21 @@ The search starts at the line immediately before the top line displayed.
.sp
Certain characters are special as in the / command:
.RS
.IP !
.IP "^N or !"
Search for lines which do NOT match the pattern.
.IP *
.IP "^E or *"
Search multiple files.
That is, if the search reaches the beginning of the current file
without finding a match,
the search continues in the previous file in the command line list.
.IP @
.IP "^F or @"
Begin the search at the last line of the last file
in the command line list,
regardless of what is currently displayed on the screen
or the settings of the -a or -j options.
.IP "^K"
Highlight any text which matches the pattern on the current screen,
but don't move to the first match.
.RE
.PP
.IP "ESC-/pattern"
Expand Down Expand Up @@ -1235,7 +1238,7 @@ more text than the matching string may be highlighted.


.SH COPYRIGHT
Copyright (c) 1984,1985,1989,1994,1995 Mark Nudelman
Copyright (c) 1984,1985,1989,1994,1995,1996 Mark Nudelman
.br
Comments to: [email protected]

4 changes: 3 additions & 1 deletion version.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,9 @@ v295 1/20/96 Fix search on squished file; add /@@.
v296 1/23/96 Allow cmdbuf larger than screen width.
v297 1/24/96 Don't call termcap if tgetent fails;
add #defines for buffers.
v298 1/24/96 Change @@ to ^K.
Add alternate search modifiers ^N, ^F, ^E.
*/

char version[] = "297";
char version[] = "298";

0 comments on commit 2a2099f

Please sign in to comment.