Index: vendor/less/dist/contrib/less/NEWS =================================================================== --- vendor/less/dist/contrib/less/NEWS (revision 172596) +++ vendor/less/dist/contrib/less/NEWS (revision 172597) @@ -1,697 +1,700 @@ NEWS about less ====================================================================== For the latest news about less, see the "less" Web page: http://www.greenwoodsoftware.com/less You can also download the latest version of less from there. To report bugs, suggestions or comments, send email to bug-less@gnu.org or markn@greenwoodsoftware.com. ====================================================================== - Major changes between "less" versions 406 and 408 + Major changes between "less" versions 406 and 409 * Support CSI escape sequences, like SGR escape sequences. * Fix bug which caused screen to fail to repaint when window is resized. * Fix bug in using -i and -I flags with non-ASCII text. * Fix configure bug on systems which don't support langinfo.h. +* Fix crash when searching text containing certain invalid UTF-8 sequences. + ====================================================================== Major changes between "less" versions 394 and 406 * Allow decimal point in number for % (percent) command. * Allow decimal point in number for -j option (fraction of screen height). * Make n command fetch previous pattern from history file on first search. * Don't rewrite history file if it has not changed. * Don't move to bottom of screen on first page. * Don't output extraneous newlines, so copy & pasting lines from the output works better. * The -c option has been made identical with the -C option. * Allow "/dev/null" as synomym for "-" in LESSHISTFILE to indicate that no history file should be used. * Search can now find text which follows a null byte, if the PCRE library is used, or if no-regex searching (ctrl-R) is used. * Better compatibility with POSIX more specification. * Make -f work for directories. * Make "t" cmd traverse tags in the correct order. * Allow a few binary characters in the input file before warning that the file is binary. * Don't warn that file is binary if it merely contains ANSI color sequences and -R is in effect. * Update Unicode character tables. * Support DESTDIR in Makefile. * Fix bug when filename contains certain shell metacharacters such as "$". * Fix bug when resizing the window while waiting for input from a pipe. * Fix configure bugs. ====================================================================== Major changes between "less" versions 382 and 394 * Add history file to save search and shell command history between invocations of less. * Improve behavior of history list for search and shell commands. * Add -K (or --quit-on-intr) option to make less exit immediately on ctrl-C. * Improve handling of UTF-8 files and commands, including better line wrapping and handling double-width chars. * Added LESSUTFBINFMT environment variable to control display of non-printable characters in a UTF-8 file. * Add --with-secure option to configure, to make it easier to build a secure version of less. * Show search matches in the status column even if search highlights are disabled via the -G option or the ESC-u command. * Improve performance when the file contains very long lines. * Add "windows" charset. * Add man page for lessecho. * Add support for erase2 character, treated same as erase. * Use ASCII lowercase/uppercase logic when operating on the command line. * Update makefile for Borland C++ 5.5.1. * Fix bug in calculating number of pages for %D prompt. * Fix bug in handling tag file error. * Fix obscure bug if input file is deleted while viewing help. * Fix bug handling filenames which include square brackets. * Fix possible buffer overflow in "global" tag search. * Fix possible buffer overflow in usage of LESSOPEN and LESSCLOSE. * Fix buffer overflow in reverse search. ====================================================================== Major changes between "less" versions 381 and 382 * Removed some old copyrighted code. This probably breaks OS/9 support. ====================================================================== Major changes between "less" versions 378 and 381 * New -L option to disable LESSOPEN processing. * Further support for large (64 bit) file addressing. Large file support is now set up by the configure script. * Use autoconf 2.54. Replace configure.in, acconfig.h, defines.h.top with configure.ac. * Overstriking underscore with underscore is now bold or underlined depending on context. * Use only 7 spaces for line numbers in -N mode, if possible. * Fix some bugs in handling overstriking in UTF-8 files. * Fix some nroff issues in the man page. ====================================================================== Major changes between "less" versions 376 and 378 * Bug fixes: Default buffer space is now 64K as documented. Search highlighting works properly when used with -R. Windows version works properly when input file contains carriage returns. Clean up some compiler warnings. ====================================================================== Major changes between "less" versions 358 and 376 * -x option can now specify multiple variable-width tab stops. * -X option no longer disables keypad initialization. New option --no-keypad disables keypad initialization. * New commands t and T step through multiple tag matches. Added support for "global(1)" tags (see http://www.gnu.org/software/global/global.html). * New prompt style set by option -Pw defines the message printed while waiting for data in the F command. * System-wide lesskey file now defaults to sysless in etc directory instead of .sysless in bin directory. Use "configure --sysconfdir=..." to change it. (For backwards compatibility, .sysless in bin is still recognized.) * Pressing RightArrow or LeftArrow while entering a number now shifts the display N columns rather than editing the number itself. * Status column (enabled with -J) now shows search results. * Windows version sets window title. * Default LESSCHARSET for MS-DOS versions is now "dos". * Searching works better with ANSI (SGR) escape sequences. ANSI color escape sequences are now supported in the MS-DOS (DJGPP) version. * Improved performance in reading very large pipes. * Eliminated some dependencies on file offets being 32 bits. * Fixed problems when viewing files with very long lines. * Fixed overstriking in UTF-8 mode, and overstriking tabs. * Improved horizontal shifting of text using -R option with ANSI color. * Improved handling of filenames containing shell metacharacters. * Some fixes for EBCDIC systems. * Some fixes for OS/2 systems. ====================================================================== Major changes between "less" versions 354 and 358 * Add -J (--status-column) option to display a status column. * Add -# (--shift) option to set default horizontal shift distance. Default horizontal shift distance is now one-half screen width. * Horizontal shifting does not shift line numbers if -N is in effect. * Horizontal shifting acts as though -S were set, to avoid confusion. ====================================================================== Major changes between "less" versions 352 and 354 * Allow space after numeric-valued command line options. * Fix problem with configuring terminal libraries on some systems. * Add support for PCRE regular expression library. * Add --with-regex option to configure to allow manually selecting a regular expression library. * Fix bug compiling with SECURE = 1. ====================================================================== Major changes between "less" versions 346 and 352 * Enable UTF-8 if "UTF-8" appears in locale-related environment variables. * Add --with-editor option to configure script. * The -M prompt and = message now show the top and bottom line number. * Fix bug in running the editor on a file whose name contains quotes, etc. * Fix bug in horizontal scrolling of long lines. * Fix bug in doing :d on a file which contains marks. * Fix bug causing cleared lines to sometimes be filled with standout, bold, underline, etc. on certain terminals. * Fixes for MS-DOS (DJGPP) version. ====================================================================== Major changes between "less" versions 340 and 346 * The UTF-8 character set is now supported. * The default character set is now latin1 rather than ascii. * New option -R (--RAW-CONTROL-CHARS) is like -r but handles long (wrapped) lines correctly, as long as the input contains only normal text and ANSI color escape sequences. * New option -F (--quit-if-one-screen) quits if the text fits on the first screen. * The -w option now highlights the target line of a g or p command. * A system-wide lesskey file is supported (LESSKEY_SYSTEM). * New escape for prompt strings: %c is replaced by column number. * New escape for prompt strings: %P is replaced by percentage into file, based on line number rather than byte offset. * HOME and END keys now jump to beginning of file or end of file. ====================================================================== Major changes between "less" versions 337 and 340 * Command line options for less may now be given in either the old single-letter form, or a new long name form (--option-name). See the less man page or "less --help" for the list of long option names. * Command line options for lesskey may now be given in a new long name form. See the lesskey man page for the list of long option names. * New command -- toggles an option using the long option name. * New command __ queries an option using the long option name. * The old -- command is renamed as -!. * If a ^P is entered between the dash and the option letter of the - command, the message describing the new setting is suppressed. * Lesskey files may now contain \k escape sequences to represent the "special" keys (arrows, PAGE-UP/PAGE-DOWN, HOME, END, INSERT, DELETE). * New command :d removes the current file from the list of files. * New option -~ (like -w before version 335) suppresses tildes after end-of-file. * Less is now released under the GNU General Public License. ====================================================================== Major changes between "less" versions 335 and 337 * Fixed bugs in "make install". ====================================================================== Major changes between "less" versions 332 and 335 * The old -w flag (suppress tildes after end-of-file) has been removed. * New -w flag highlights the first new line after a forward-screen. * New -W flag highlights the first new line after any forward movement. * Window resize works even if LINES and/or COLUMNS environment variables are incorrect. * New percent escapes for prompt strings: %d is replaced by the page number, and %D is replaced by the number of pages in the file. * Added charsets "iso8859" and "ebcdic". * In Windows version, uses HOMEDRIVE and HOMEPATH if HOME is not defined. * Fixed some bugs causing incorrect display on DOS/Windows. ====================================================================== Major changes between "less" versions 330 and 332 * Filenames from the command line are entered into the command history, so UPARROW/DOWNARROW can be used to retrieve them from the :e command. * Now works correctly on Windows when using a scrolling terminal window (buffer larger than display window). * On Windows, now restores the console screen on exit. Use -X to get the old behavior. * Fixed bug on Windows when CAPS-LOCK or NUM-LOCK is pressed. * Fixed bug on Windows when piping output of an interactive program. * Fixed bug in tags file processing when tags file has DOS-style line terminators (CR/LF). * Fixed compilation problem on OS/2. ====================================================================== Major changes between "less" versions 321 and 330 * Now supports filenames containing spaces (in double quotes). New option -" can be used to change the quoting characters. * In filename completion, a slash is appended to a directory name. If the environment variable LESSSEPARATOR is set, the value of that variable, rather than a slash, is appended. * LeftArrow and RightArrow are same as ESC-[ and ESC-]. * Added commands ESC-( and ESC-), same as ESC-[ and ESC-]. * A "quit" command defined in a lesskey file may now have an "extra" string, which is used to return an exit code from less when it quits. * New environment variables LESSMETACHARS and LESSMETAESCAPE provide more control over how less interfaces to the shell. * Ported to Microsoft Visual C compiler for Windows. * Ported to DJGPP compiler for MS-DOS. * Bug fixes. ====================================================================== Major changes between "less" versions 291 and 321 * Command line at bottom of screen now scrolls, so it can be longer than the screen width. * New commands ESC-] and ESC-[ scroll the display horizontally. * New command ESC-SPACE scrolls forward a full screen, even if it hits end-of-file. * Alternate modifiers for search commands: ^N is same as !, ^F is same as @, and ^E is same as *. * New modifier for search commands: ^K means highlight the matches currently on-screen, but don't move to the first match. * New modifier for search commands: ^R means don't use regular expressions in the search. * Environment variable LESSKEY gives name of default lesskey file. * Environment variable LESSSECURE will force less to run in "secure" mode. * Command line argument "--" signals that the rest of the arguments are files (not option flags). * Help file (less.hlp) is no longer installed. Help text is now embedded in the less executable itself. * Added -Ph to change the prompt for the help text. Added -Ps to change the default short prompt (same as plain -P). * Ported to the Borland C compiler for MS-DOS. * Ported to Windows 95 & Windows NT. * Ported to OS-9. * Ported to GNU Hurd. ====================================================================== Major changes between "less" versions 290 and 291 * Less environment variables can be specified in lesskey files. * Fixed MS-DOS build. ====================================================================== Major changes between "less" versions 278 and 290 * Accepts GNU-style options "--help" and "--version". * OS/2 version looks for less.ini in $HOME before $INIT and $PATH. * Bug fixes ====================================================================== Major changes between "less" versions 252 and 278 * A LESSOPEN preprocessor may now pipe the converted file data to less, rather than writing it to a temporary file. * Search pattern highlighting has been fixed. It now highlights reliably, even if a string is split across two screen lines, contains TABs, etc. * The -F flag (which suppress search highlighting) has been changed to -G. A new flag, -g, changes search highlighting to highlight only the string found by the last search command, instead of all strings which match the last search command. * New flag -I acts like -i, but ignores case even if the search pattern contains uppercase letters. * Less now checks for the environment variable VISUAL before EDITOR. * Ported to OS/2. ====================================================================== Major changes between "less" versions 237 and 252 * Changes in line-editing keys: The literal key is now ^V or ^A rather than \ (backslash). Filename completion commands (TAB and ^L) are disabled when typing a search pattern. * Line-editing command keys can be redefined using lesskey. * Lesskey with no input file defaults to $HOME/.lesskey rather than standard input. * New option -V displays version number of less. * New option -V displays version number of lesskey. * Help file less.hlp is now installed by default in /usr/local/share rather than /usr/local/lib. ====================================================================== Major changes between "less" versions 170 and 237 * By popular demand, text which matches the current search pattern is highlighted. New -F flag disables this feature. * Henry Spencer's regexp.c is now included, for systems which do not have a regular expression library. regexp.c is Copyright (c) 1986 by University of Toronto. * New line-editing keys, including command history (arrow keys) and filename completion (TAB). * Input preprocessor allows modification of input files (e.g. uncompress) via LESSOPEN/LESSCLOSE environment variables. * New -X flag disables sending termcap "ti" and "te" (initialize and deinitialize) strings to the terminal. * Changing -i from within less now correctly affects a subsequent repeated search. * Searching for underlined or overstruck text now works when the -u flag is in effect, rather than the -i flag. * Use setlocale (LANG and LC_CTYPE environment variables) to determine the character set if LESSCHARSET/LESSCHARDEF are not set. * The default format for displaying binary characters is now standout (reverse video) rather than blinking. This can still be changed by setting the LESSBINFMT environment variable. * Use autoconf installation technology. * Ported to MS-DOS. ******************************** Things that may surprise you ******************************** * When you enter text at the bottom of the screen (search string, filename, etc.), some keys act different than previously. Specifically, \ (backslash), ESC, TAB, BACKTAB, and control-L now have line editing functions. * Some previous unofficial versions of less were able to display compressed files. The new LESSOPEN/LESSCLOSE feature now provides this functionality in a different way. * Some previous unofficial versions of less provided a -Z flag to set the number of lines of text to retain between full screen scrolls. The -z-n flag (that is, -z with a negative number) provides this functionality. ====================================================================== Major changes between "less" versions 123 and 170 * New option -j allows target lines to be positioned anywhere on screen. * New option -S truncates displayed line at the screen width, rather than wrapping onto the next line. * New option -y limits amount of forward scroll. * New option -T specifies a "tags" file. * Non-printable, non-control characters are displayed in octal. Such characters, as well as control characters, are displayed in blinking mode. * New command -+ sets an option to its default. * New command -- sets an option to the opposite of its default. * Lesskey file may have a string appended to a key's action, which acts as though typed in after the command. * New commands ESC-^F and ESC-^B match arbitrary types of brackets. * New command F monitors a growing file (like "tail -f"). * New command | pipes a section of the input file into a shell command. * New command :x directly jumps to a file in the command line list. * Search commands have been enhanced and reorganized: n Repeat search, same direction. N Repeat search, opposite direction. ESC-/ Search forward thru file boundaries ESC-? Search backward thru file boundaries ESC-n Repeat search thru file boundaries, same direction. ESC-N Repeat search thru file boundaries, opposite direction. Special character * causes search to search thru file boundaries. Special character @ causes search to begin at start/end of file list. * Examining a new file adds it to the command line list. A list of files, or an expression which matches more than one file, may be examined; all of them are added to the command line list. * Environment variables LESSCHARSET and LESSCHARDEF can define a non-ASCII character set. * Partial support for MSDOS, including options -R for repainting screen on quit, -v/-V to select video mode, and -W to change window size. ====================================================================== Major changes between "less" versions 97 and 123 * New option (-N) causes line numbers to be displayed in the text of the file (like vi "set nu"). * New option (-?) prints help message immediately. * New option (-r) displays "raw" control characters, without mapping them to ^X notation. * New option (-f) forces less to open non-regular files (directories, etc). * New option (-k) can be used to specify lesskey files by name. * New option (-y) can be used to set a forward scroll limit (like -h sets a backward scroll limit). * File marks (set by the m command) are now preserved when a new file is edited. The ' command can thus be used to switch files. * New command ESC-/ searches all files (on the command line) for a pattern. * New command ESC-n repeats previous search, spanning files. * The N command has been changed to repeat the previous search in the reverse direction. The old N command is still available via :n. * New command ESC-N repeats previous search in the reverse direction and spanning files. * 8 bit characters are now supported. A new option (-g) can be used to strip off the eighth bit (the previous behavior). * Options which take a following string (like -t) may now optionally have a space between the option letter and the string. * Six new commands { } ( ) [ and ] can be used to match brackets of specific types, similar to vi % command. * New commands z and w move forward/backward one window and simultaneously set the window size. * Prompt string expansion now has %L for line number of the last line in the file, and %E for the name of the editor. Also, % escapes which refer to a line (b=bottom, t=top, etc.) can use j for the jump target line. * New environment variable LESSEDIT can be used to tailor the command string passed to the editor by the v command. * Examining a file which was previously examined will return to the same position in the file. * A "%" is expanded to the current filename and a "#" to the previous filename, in both shell commands and the E command. (Previously % worked only in shell commands and # worked only in the E command.) * New command ":ta" is equivalent to "-t". * New command "s" is equivalent to "-l". * The - command may be followed by "+X" to revert to the default for option X, or "-X" to get the opposite of the default. * Lesskey files may now include characters after the action as extra input to be parsed after the action; for example: "toggle-option X" to toggle a specific option X. + Index: vendor/less/dist/contrib/less/README =================================================================== --- vendor/less/dist/contrib/less/README (revision 172596) +++ vendor/less/dist/contrib/less/README (revision 172597) @@ -1,238 +1,238 @@ - Less, version 408 + Less, version 409 - This is the distribution of less, version 408, released 01 Oct 2007. + This is the distribution of less, version 409, released 12 Oct 2007. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or modify it under the terms of either: 1. The GNU General Public License, as published by the Free Software Foundation; either version 2, or (at your option) any later version. A copy of this license is in the file COPYING. or 2. The Less License, in the file LICENSE. Please report any problems to bug-less@gnu.org or markn@greenwoodsoftware.com. See http://www.greenwoodsoftware.com/less for the latest info. You may also contact the author at: Mark Nudelman Greenwood Software PO Box 2402 El Granada, CA 94018 USA ========================================================================= This is the distribution of "less", a paginator similar to "more" or "pg". The formatted manual page is in less.man. The manual page nroff source is in less.nro. Major changes made since the last posted version are in NEWS. ======================================================================= INSTALLATION (Unix systems only): 1. Move the distributed source to its own directory and unpack it, if you have not already done so. 2. Type "sh configure". This will generate a Makefile and a defines.h. Warning: if you have a GNU sed, make sure it is version 2.05 or later. The file INSTALL describes the usage of the configure program in general. In addition, these options to configure are supported: --with-editor=program Specifies the default editor program used by the "v" command. The default is "vi". --with-regex=lib Specifies the regular expression library used by less for pattern matching. The default is "auto", which means the configure program finds a regular expression library automatically. Other values are: posix Use the POSIX-compatible regcomp. pcre Use the PCRE library. regcmp Use the regcmp library. re_comp Use the re_comp library. regcomp Use the V8-compatible regcomp. regcomp-local Use Henry Spencer's V8-compatible regcomp (source is supplied with less). --with-secure Builds a "secure" version of less, with some features disabled to prevent users from viewing other files, accessing shell commands, etc. 3. It is a good idea to look over the generated Makefile and defines.h and make sure they look ok. If you know of any peculiarities of your system that configure might not have detected, you may fix the Makefile now. Take particular notice of the list of "terminal" libraries in the LIBS definition in the Makefile; these may need to be edited. The terminal libraries will be some subset of -lncurses -lcurses -ltermcap -ltermlib If you wish, you may edit defines.h to remove some optional features. If you choose not to include some features in your version, you may wish to edit the manual page "less.nro" and the help page "less.hlp" to remove the descriptions of the features which you are removing. If you edit less.hlp, you should run "make -f Makefile.aut help.c". 4. Type "make" and watch the fun. 5. If the make succeeds, it will generate the programs "less", "lesskey" and "lessecho" in your current directory. Test the generated programs. 6. When satisfied that it works, if you wish to install it in a public place, type "make install". The default install destinations are: Executables (less, lesskey, lessecho) in /usr/local/bin Documentation (less.nro, lesskey.nro) in /usr/local/man/man1 If you want to install any of these files elsewhere, define bindir and/or mandir to the appropriate directories. If you have any problems building or running "less", suggestions, complaints, etc., you may mail to the author at markn@greenwoodsoftware.com. Note to hackers: comments noting possible improvements are enclosed in double curly brackets {{ like this }}. ======================================================================= INSTALLATION (MS-DOS systems only, with Microsoft C, Borland C, or DJGPP) 1. Move the distributed source to its own directory. Depending on your compiler, you may need to convert the source to have CR-LF rather than LF as line terminators. 2. If you are using Microsoft C, rename MAKEFILE.DSU to MAKEFILE. If you are using Borland C, rename MAKEFILE.DSB to MAKEFILE. If you are using DJGPP, rename MAKEFILE.DSG to MAKEFILE. 3. Look at MAKEFILE to make sure that the definitions for CC and LIBDIR are correct. CC should be the name of your C compiler and LIBDIR should be the directory where the C libraries reside (for Microsoft C only). If these definitions need to be changed, you can either modify the definitions directly in MAKEFILE, or set your environment variables CC and/or LIBDIR to override the definitions in MAKEFILE. 4. If you wish, you may edit DEFINES.DS to remove some optional features. If you choose not to include some features in your version, you may wish to edit the manual page LESS.MAN and the help page HELP.C to remove the descriptions of the features which you are removing. 5. Run your "make" program and watch the fun. If your "make" requires a flag to import environment variables, you should use that flag. If your compiler runs out of memory, try running "make -n >cmds.bat" and then run cmds.bat. 6. If the make succeeds, it will generate the programs "LESS.EXE" and "LESSKEY.EXE" in your current directory. Test the generated programs. 7. When satisfied that it works, you may wish to install LESS.EXE and LESSKEY.EXE in a directory which is included in your PATH. ======================================================================= INSTALLATION (Windows-95, Windows-98 and Windows-NT systems only, with Borland C or Microsoft Visual C++) 1. Move the distributed source to its own directory. 2. If you are using Borland C, rename Makefile.wnb to Makefile. If you are using Microsoft Visual C++, rename Makefile.wnm to Makefile. 3. Check the Makefile to make sure the definitions look ok. 4. If you wish, you may edit defines.wn to remove some optional features. If you choose not to include some features in your version, you may wish to edit the manual page less.man and the help page help.c to remove the descriptions of the features which you are removing. 5. Type "make" and watch the fun. 6. If the make succeeds, it will generate the programs "less.exe" and "lesskey.exe" in your current directory. Test the generated programs. 7. When satisfied that it works, if you wish to install it in a public place, type "make install". See step 6 of the Unix installation instructions for details on how to change the default installation directories. ======================================================================= INSTALLATION (OS/2 systems only, with EMX C) 1. Move the distributed source to its own directory. 2. Rename Makefile.o2e to Makefile. 3. Check the Makefile to make sure the definitions look ok. 4. If you wish, you may edit defines.o2 to remove some optional features. If you choose not to include some features in your version, you may wish to edit the manual page less.man and the help page help.c to remove the descriptions of the features which you are removing. 5. Type "make" and watch the fun. 6. If the make succeeds, it will generate the programs "less.exe" and "lesskey.exe" in your current directory. Test the generated programs. 7. Make sure you have the emx runtime installed. You need the emx DLLs emx.dll and emxlibcs.dll and also the termcap database, termcap.dat. Make sure you have termcap.dat either in the default location or somewhere in a directory listed in the PATH or INIT environment variables. 8. When satisfied that it works, you may wish to install less.exe, lesskey.exe and scrsize.exe in a directory which is included in your PATH. scrsize.exe is required only if you use a terminal emulator such as xterm or rxvt. ======================================================================= INSTALLATION (OS-9 systems only, with Microware C or Ultra C) 1. Move the distributed source to its own directory. 2. If you are using Microware C, rename Makefile.o9c to Makefile. If you are using Ultra C, rename Makefile.o9u to Makefile. 3. Check the Makefile to make sure the definitions look ok. 4. If you wish, you may edit defines.o9 to remove some optional features. If you choose not to include some features in your version, you may wish to edit the manual page less.man and the help page help.c to remove the descriptions of the features which you are removing. 5. Type "dmake" and watch the fun. The standard OS-9 "make" will probably not work. If you don't have dmake, you can get a copy from os9archive.rtsi.com. 6. If the make succeeds, it will generate the programs "less" and "lesskey" in your current directory. Test the generated programs. 7. When satisfied that it works, if you wish to install it in a public place, type "dmake install". See step 6 of the Unix installation instructions for details on how to change the default installation directories. ======================================================================= ACKNOWLEDGMENTS: Some versions of the less distribution are packaged using Info-ZIP's compression utility. Info-ZIP's software is free and can be obtained as source code or executables from various anonymous-ftp sites, including ftp.uu.net:/pub/archiving/zip. Index: vendor/less/dist/contrib/less/charset.c =================================================================== --- vendor/less/dist/contrib/less/charset.c (revision 172596) +++ vendor/less/dist/contrib/less/charset.c (revision 172597) @@ -1,1165 +1,1167 @@ /* * Copyright (C) 1984-2007 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. * * For more information about less, or for information on how to * contact the author, see the README file. */ /* * Functions to define the character set * and do things specific to the character set. */ #include "less.h" #if HAVE_LOCALE #include #include #include #endif #include "charset.h" public int utf_mode = 0; /* * Predefined character sets, * selected by the LESSCHARSET environment variable. */ struct charset { char *name; int *p_flag; char *desc; } charsets[] = { { "ascii", NULL, "8bcccbcc18b95.b" }, { "utf-8", &utf_mode, "8bcccbcc18b95.b126.bb" }, { "iso8859", NULL, "8bcccbcc18b95.33b." }, { "latin3", NULL, "8bcccbcc18b95.33b5.b8.b15.b4.b12.b18.b12.b." }, { "arabic", NULL, "8bcccbcc18b95.33b.3b.7b2.13b.3b.b26.5b19.b" }, { "greek", NULL, "8bcccbcc18b95.33b4.2b4.b3.b35.b44.b" }, { "greek2005", NULL, "8bcccbcc18b95.33b14.b35.b44.b" }, { "hebrew", NULL, "8bcccbcc18b95.33b.b29.32b28.2b2.b" }, { "koi8-r", NULL, "8bcccbcc18b95.b." }, { "KOI8-T", NULL, "8bcccbcc18b95.b8.b6.b8.b.b.5b7.3b4.b4.b3.b.b.3b." }, { "georgianps", NULL, "8bcccbcc18b95.3b11.4b12.2b." }, { "tcvn", NULL, "b..b...bcccbccbbb7.8b95.b48.5b." }, { "TIS-620", NULL, "8bcccbcc18b95.b.4b.11b7.8b." }, { "next", NULL, "8bcccbcc18b95.bb125.bb" }, { "dos", NULL, "8bcccbcc12bc5b95.b." }, { "windows-1251", NULL, "8bcccbcc12bc5b95.b24.b." }, { "windows-1252", NULL, "8bcccbcc12bc5b95.b.b11.b.2b12.b." }, { "windows-1255", NULL, "8bcccbcc12bc5b95.b.b8.b.5b9.b.4b." }, { "ebcdic", NULL, "5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b." }, { "IBM-1047", NULL, "4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc191.b" }, { NULL, NULL, NULL } }; /* * Support "locale charmap"/nl_langinfo(CODESET) values, as well as others. */ struct cs_alias { char *name; char *oname; } cs_aliases[] = { { "UTF-8", "utf-8" }, { "ANSI_X3.4-1968", "ascii" }, { "US-ASCII", "ascii" }, { "latin1", "iso8859" }, { "ISO-8859-1", "iso8859" }, { "latin9", "iso8859" }, { "ISO-8859-15", "iso8859" }, { "latin2", "iso8859" }, { "ISO-8859-2", "iso8859" }, { "ISO-8859-3", "latin3" }, { "latin4", "iso8859" }, { "ISO-8859-4", "iso8859" }, { "cyrillic", "iso8859" }, { "ISO-8859-5", "iso8859" }, { "ISO-8859-6", "arabic" }, { "ISO-8859-7", "greek" }, { "IBM9005", "greek2005" }, { "ISO-8859-8", "hebrew" }, { "latin5", "iso8859" }, { "ISO-8859-9", "iso8859" }, { "latin6", "iso8859" }, { "ISO-8859-10", "iso8859" }, { "latin7", "iso8859" }, { "ISO-8859-13", "iso8859" }, { "latin8", "iso8859" }, { "ISO-8859-14", "iso8859" }, { "latin10", "iso8859" }, { "ISO-8859-16", "iso8859" }, { "IBM437", "dos" }, { "EBCDIC-US", "ebcdic" }, { "IBM1047", "IBM-1047" }, { "KOI8-R", "koi8-r" }, { "KOI8-U", "koi8-r" }, { "GEORGIAN-PS", "georgianps" }, { "TCVN5712-1", "tcvn" }, { "NEXTSTEP", "next" }, { "windows", "windows-1252" }, /* backward compatibility */ { "CP1251", "windows-1251" }, { "CP1252", "windows-1252" }, { "CP1255", "windows-1255" }, { NULL, NULL } }; #define IS_BINARY_CHAR 01 #define IS_CONTROL_CHAR 02 static char chardef[256]; static char *binfmt = NULL; static char *utfbinfmt = NULL; public int binattr = AT_STANDOUT; /* * Define a charset, given a description string. * The string consists of 256 letters, * one for each character in the charset. * If the string is shorter than 256 letters, missing letters * are taken to be identical to the last one. * A decimal number followed by a letter is taken to be a * repetition of the letter. * * Each letter is one of: * . normal character * b binary character * c control character */ static void ichardef(s) char *s; { register char *cp; register int n; register char v; n = 0; v = 0; cp = chardef; while (*s != '\0') { switch (*s++) { case '.': v = 0; break; case 'c': v = IS_CONTROL_CHAR; break; case 'b': v = IS_BINARY_CHAR|IS_CONTROL_CHAR; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = (10 * n) + (s[-1] - '0'); continue; default: error("invalid chardef", NULL_PARG); quit(QUIT_ERROR); /*NOTREACHED*/ } do { if (cp >= chardef + sizeof(chardef)) { error("chardef longer than 256", NULL_PARG); quit(QUIT_ERROR); /*NOTREACHED*/ } *cp++ = v; } while (--n > 0); n = 0; } while (cp < chardef + sizeof(chardef)) *cp++ = v; } /* * Define a charset, given a charset name. * The valid charset names are listed in the "charsets" array. */ static int icharset(name, no_error) register char *name; int no_error; { register struct charset *p; register struct cs_alias *a; if (name == NULL || *name == '\0') return (0); /* First see if the name is an alias. */ for (a = cs_aliases; a->name != NULL; a++) { if (strcmp(name, a->name) == 0) { name = a->oname; break; } } for (p = charsets; p->name != NULL; p++) { if (strcmp(name, p->name) == 0) { ichardef(p->desc); if (p->p_flag != NULL) *(p->p_flag) = 1; return (1); } } if (!no_error) { error("invalid charset name", NULL_PARG); quit(QUIT_ERROR); } return (0); } #if HAVE_LOCALE /* * Define a charset, given a locale name. */ static void ilocale() { register int c; for (c = 0; c < (int) sizeof(chardef); c++) { if (isprint(c)) chardef[c] = 0; else if (iscntrl(c)) chardef[c] = IS_CONTROL_CHAR; else chardef[c] = IS_BINARY_CHAR|IS_CONTROL_CHAR; } } #endif /* * Define the printing format for control (or binary utf) chars. */ static void setbinfmt(s, fmtvarptr, default_fmt) char *s; char **fmtvarptr; char *default_fmt; { if (s && utf_mode) { /* It would be too hard to account for width otherwise. */ char *t = s; while (*t) { if (*t < ' ' || *t > '~') { s = default_fmt; goto attr; } t++; } } /* %n is evil */ if (s == NULL || *s == '\0' || (*s == '*' && (s[1] == '\0' || s[2] == '\0' || strchr(s + 2, 'n'))) || (*s != '*' && strchr(s, 'n'))) s = default_fmt; /* * Select the attributes if it starts with "*". */ attr: if (*s == '*') { switch (s[1]) { case 'd': binattr = AT_BOLD; break; case 'k': binattr = AT_BLINK; break; case 's': binattr = AT_STANDOUT; break; case 'u': binattr = AT_UNDERLINE; break; default: binattr = AT_NORMAL; break; } s += 2; } *fmtvarptr = s; } /* * */ static void set_charset() { char *s; /* * See if environment variable LESSCHARSET is defined. */ s = lgetenv("LESSCHARSET"); if (icharset(s, 0)) return; /* * LESSCHARSET is not defined: try LESSCHARDEF. */ s = lgetenv("LESSCHARDEF"); if (s != NULL && *s != '\0') { ichardef(s); return; } #if HAVE_LOCALE #ifdef CODESET /* * Try using the codeset name as the charset name. */ s = nl_langinfo(CODESET); if (icharset(s, 1)) return; #endif #endif #if HAVE_STRSTR /* * Check whether LC_ALL, LC_CTYPE or LANG look like UTF-8 is used. */ if ((s = lgetenv("LC_ALL")) != NULL || (s = lgetenv("LC_CTYPE")) != NULL || (s = lgetenv("LANG")) != NULL) { if ( strstr(s, "UTF-8") != NULL || strstr(s, "utf-8") != NULL || strstr(s, "UTF8") != NULL || strstr(s, "utf8") != NULL) if (icharset("utf-8", 1)) return; } #endif #if HAVE_LOCALE /* * Get character definitions from locale functions, * rather than from predefined charset entry. */ ilocale(); #if MSDOS_COMPILER /* * Default to "dos". */ (void) icharset("dos", 1); #else /* * Default to "latin1". */ (void) icharset("latin1", 1); #endif #endif } /* * Initialize charset data structures. */ public void init_charset() { char *s; #if HAVE_LOCALE setlocale(LC_ALL, ""); #endif set_charset(); s = lgetenv("LESSBINFMT"); setbinfmt(s, &binfmt, "*s<%02X>"); s = lgetenv("LESSUTFBINFMT"); setbinfmt(s, &utfbinfmt, ""); } /* * Is a given character a "binary" character? */ public int binary_char(c) unsigned char c; { c &= 0377; return (chardef[c] & IS_BINARY_CHAR); } /* * Is a given character a "control" character? */ public int control_char(c) int c; { c &= 0377; return (chardef[c] & IS_CONTROL_CHAR); } /* * Return the printable form of a character. * For example, in the "ascii" charset '\3' is printed as "^C". */ public char * prchar(c) int c; { /* {{ This buffer can be overrun if LESSBINFMT is a long string. }} */ static char buf[32]; c &= 0377; if ((c < 128 || !utf_mode) && !control_char(c)) SNPRINTF1(buf, sizeof(buf), "%c", c); else if (c == ESC) strcpy(buf, "ESC"); #if IS_EBCDIC_HOST else if (!binary_char(c) && c < 64) SNPRINTF1(buf, sizeof(buf), "^%c", /* * This array roughly inverts CONTROL() #defined in less.h, * and should be kept in sync with CONTROL() and IBM-1047. */ "@ABC.I.?...KLMNO" "PQRS.JH.XY.." "\\]^_" "......W[.....EFG" "..V....D....TU.Z"[c]); #else else if (c < 128 && !control_char(c ^ 0100)) SNPRINTF1(buf, sizeof(buf), "^%c", c ^ 0100); #endif else SNPRINTF1(buf, sizeof(buf), binfmt, c); return (buf); } /* * Return the printable form of a UTF-8 character. */ public char * prutfchar(ch) LWCHAR ch; { static char buf[32]; if (ch == ESC) strcpy(buf, "ESC"); else if (ch < 128 && control_char(ch)) { if (!control_char(ch ^ 0100)) SNPRINTF1(buf, sizeof(buf), "^%c", ((char) ch) ^ 0100); else SNPRINTF1(buf, sizeof(buf), binfmt, (char) ch); } else if (is_ubin_char(ch)) SNPRINTF1(buf, sizeof(buf), utfbinfmt, ch); else { int len; if (ch >= 0x80000000) { len = 3; ch = 0xFFFD; } else { len = (ch < 0x80) ? 1 : (ch < 0x800) ? 2 : (ch < 0x10000) ? 3 : (ch < 0x200000) ? 4 : (ch < 0x4000000) ? 5 : 6; } buf[len] = '\0'; if (len == 1) *buf = (char) ch; else { *buf = ((1 << len) - 1) << (8 - len); while (--len > 0) { buf[len] = (char) (0x80 | (ch & 0x3F)); ch >>= 6; } *buf |= ch; } } return (buf); } /* * Get the length of a UTF-8 character in bytes. */ public int utf_len(ch) char ch; { if ((ch & 0x80) == 0) return 1; if ((ch & 0xE0) == 0xC0) return 2; if ((ch & 0xF0) == 0xE0) return 3; if ((ch & 0xF8) == 0xF0) return 4; if ((ch & 0xFC) == 0xF8) return 5; if ((ch & 0xFE) == 0xFC) return 6; /* Invalid UTF-8 encoding. */ return 1; } /* * Is a UTF-8 character well-formed? */ public int is_utf8_well_formed(s) unsigned char *s; { int i; int len; if (IS_UTF8_INVALID(s[0])) return (0); len = utf_len((char) s[0]); if (len == 1) return (1); if (len == 2) { if (s[0] < 0xC2) return (0); } else { unsigned char mask; mask = (~((1 << (8-len)) - 1)) & 0xFF; if (s[0] == mask && (s[1] & mask) == 0x80) return (0); } for (i = 1; i < len; i++) if (!IS_UTF8_TRAIL(s[i])) return (0); return (1); } /* * Get the value of a UTF-8 character. */ public LWCHAR get_wchar(p) char *p; { switch (utf_len(p[0])) { case 1: default: /* 0xxxxxxx */ return (LWCHAR) (p[0] & 0xFF); case 2: /* 110xxxxx 10xxxxxx */ return (LWCHAR) ( ((p[0] & 0x1F) << 6) | (p[1] & 0x3F)); case 3: /* 1110xxxx 10xxxxxx 10xxxxxx */ return (LWCHAR) ( ((p[0] & 0x0F) << 12) | ((p[1] & 0x3F) << 6) | (p[2] & 0x3F)); case 4: /* 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ return (LWCHAR) ( ((p[0] & 0x07) << 18) | ((p[1] & 0x3F) << 12) | ((p[2] & 0x3F) << 6) | (p[3] & 0x3F)); case 5: /* 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */ return (LWCHAR) ( ((p[0] & 0x03) << 24) | ((p[1] & 0x3F) << 18) | ((p[2] & 0x3F) << 12) | ((p[3] & 0x3F) << 6) | (p[4] & 0x3F)); case 6: /* 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */ return (LWCHAR) ( ((p[0] & 0x01) << 30) | ((p[1] & 0x3F) << 24) | ((p[2] & 0x3F) << 18) | ((p[3] & 0x3F) << 12) | ((p[4] & 0x3F) << 6) | (p[5] & 0x3F)); } } /* * Store a character into a UTF-8 string. */ public void put_wchar(pp, ch) char **pp; LWCHAR ch; { if (!utf_mode || ch < 0x80) { /* 0xxxxxxx */ *(*pp)++ = (char) ch; } else if (ch < 0x800) { /* 110xxxxx 10xxxxxx */ *(*pp)++ = (char) (0xC0 | ((ch >> 6) & 0x1F)); *(*pp)++ = (char) (0x80 | (ch & 0x3F)); } else if (ch < 0x10000) { /* 1110xxxx 10xxxxxx 10xxxxxx */ *(*pp)++ = (char) (0xE0 | ((ch >> 12) & 0x0F)); *(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F)); *(*pp)++ = (char) (0x80 | (ch & 0x3F)); } else if (ch < 0x200000) { /* 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ *(*pp)++ = (char) (0xF0 | ((ch >> 18) & 0x07)); *(*pp)++ = (char) (0x80 | ((ch >> 12) & 0x3F)); *(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F)); *(*pp)++ = (char) (0x80 | (ch & 0x3F)); } else if (ch < 0x4000000) { /* 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */ *(*pp)++ = (char) (0xF0 | ((ch >> 24) & 0x03)); *(*pp)++ = (char) (0x80 | ((ch >> 18) & 0x3F)); *(*pp)++ = (char) (0x80 | ((ch >> 12) & 0x3F)); *(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F)); *(*pp)++ = (char) (0x80 | (ch & 0x3F)); } else { /* 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */ *(*pp)++ = (char) (0xF0 | ((ch >> 30) & 0x01)); *(*pp)++ = (char) (0x80 | ((ch >> 24) & 0x3F)); *(*pp)++ = (char) (0x80 | ((ch >> 18) & 0x3F)); *(*pp)++ = (char) (0x80 | ((ch >> 12) & 0x3F)); *(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F)); *(*pp)++ = (char) (0x80 | (ch & 0x3F)); } } /* * Step forward or backward one character in a string. */ public LWCHAR step_char(pp, dir, limit) char **pp; signed int dir; char *limit; { LWCHAR ch; + int len; char *p = *pp; if (!utf_mode) { /* It's easy if chars are one byte. */ if (dir > 0) ch = (LWCHAR) ((p < limit) ? *p++ : 0); else ch = (LWCHAR) ((p > limit) ? *--p : 0); } else if (dir > 0) { - if (p + utf_len(*p) > limit) + len = utf_len(*p); + if (p + len > limit) + { ch = 0; - else + p = limit; + } else { ch = get_wchar(p); - p++; - while (IS_UTF8_TRAIL(*p)) - p++; + p += len; } } else { while (p > limit && IS_UTF8_TRAIL(p[-1])) p--; if (p > limit) ch = get_wchar(--p); else ch = 0; } *pp = p; return ch; } /* * Unicode characters data */ struct wchar_range { LWCHAR first, last; }; /* * Characters with general category values * Mn: Mark, Nonspacing * Me: Mark, Enclosing * Last synched with * * dated 2005-11-30T00:58:48Z */ static struct wchar_range comp_table[] = { { 0x0300, 0x036F} /* Mn */, { 0x0483, 0x0486} /* Mn */, { 0x0488, 0x0489} /* Me */, { 0x0591, 0x05BD} /* Mn */, { 0x05BF, 0x05BF} /* Mn */, { 0x05C1, 0x05C2} /* Mn */, { 0x05C4, 0x05C5} /* Mn */, { 0x05C7, 0x05C7} /* Mn */, { 0x0610, 0x0615} /* Mn */, { 0x064B, 0x065E} /* Mn */, { 0x0670, 0x0670} /* Mn */, { 0x06D6, 0x06DC} /* Mn */, { 0x06DE, 0x06DE} /* Me */, { 0x06DF, 0x06E4} /* Mn */, { 0x06E7, 0x06E8} /* Mn */, { 0x06EA, 0x06ED} /* Mn */, { 0x0711, 0x0711} /* Mn */, { 0x0730, 0x074A} /* Mn */, { 0x07A6, 0x07B0} /* Mn */, { 0x07EB, 0x07F3} /* Mn */, { 0x0901, 0x0902} /* Mn */, { 0x093C, 0x093C} /* Mn */, { 0x0941, 0x0948} /* Mn */, { 0x094D, 0x094D} /* Mn */, { 0x0951, 0x0954} /* Mn */, { 0x0962, 0x0963} /* Mn */, { 0x0981, 0x0981} /* Mn */, { 0x09BC, 0x09BC} /* Mn */, { 0x09C1, 0x09C4} /* Mn */, { 0x09CD, 0x09CD} /* Mn */, { 0x09E2, 0x09E3} /* Mn */, { 0x0A01, 0x0A02} /* Mn */, { 0x0A3C, 0x0A3C} /* Mn */, { 0x0A41, 0x0A42} /* Mn */, { 0x0A47, 0x0A48} /* Mn */, { 0x0A4B, 0x0A4D} /* Mn */, { 0x0A70, 0x0A71} /* Mn */, { 0x0A81, 0x0A82} /* Mn */, { 0x0ABC, 0x0ABC} /* Mn */, { 0x0AC1, 0x0AC5} /* Mn */, { 0x0AC7, 0x0AC8} /* Mn */, { 0x0ACD, 0x0ACD} /* Mn */, { 0x0AE2, 0x0AE3} /* Mn */, { 0x0B01, 0x0B01} /* Mn */, { 0x0B3C, 0x0B3C} /* Mn */, { 0x0B3F, 0x0B3F} /* Mn */, { 0x0B41, 0x0B43} /* Mn */, { 0x0B4D, 0x0B4D} /* Mn */, { 0x0B56, 0x0B56} /* Mn */, { 0x0B82, 0x0B82} /* Mn */, { 0x0BC0, 0x0BC0} /* Mn */, { 0x0BCD, 0x0BCD} /* Mn */, { 0x0C3E, 0x0C40} /* Mn */, { 0x0C46, 0x0C48} /* Mn */, { 0x0C4A, 0x0C4D} /* Mn */, { 0x0C55, 0x0C56} /* Mn */, { 0x0CBC, 0x0CBC} /* Mn */, { 0x0CBF, 0x0CBF} /* Mn */, { 0x0CC6, 0x0CC6} /* Mn */, { 0x0CCC, 0x0CCD} /* Mn */, { 0x0CE2, 0x0CE3} /* Mn */, { 0x0D41, 0x0D43} /* Mn */, { 0x0D4D, 0x0D4D} /* Mn */, { 0x0DCA, 0x0DCA} /* Mn */, { 0x0DD2, 0x0DD4} /* Mn */, { 0x0DD6, 0x0DD6} /* Mn */, { 0x0E31, 0x0E31} /* Mn */, { 0x0E34, 0x0E3A} /* Mn */, { 0x0E47, 0x0E4E} /* Mn */, { 0x0EB1, 0x0EB1} /* Mn */, { 0x0EB4, 0x0EB9} /* Mn */, { 0x0EBB, 0x0EBC} /* Mn */, { 0x0EC8, 0x0ECD} /* Mn */, { 0x0F18, 0x0F19} /* Mn */, { 0x0F35, 0x0F35} /* Mn */, { 0x0F37, 0x0F37} /* Mn */, { 0x0F39, 0x0F39} /* Mn */, { 0x0F71, 0x0F7E} /* Mn */, { 0x0F80, 0x0F84} /* Mn */, { 0x0F86, 0x0F87} /* Mn */, { 0x0F90, 0x0F97} /* Mn */, { 0x0F99, 0x0FBC} /* Mn */, { 0x0FC6, 0x0FC6} /* Mn */, { 0x102D, 0x1030} /* Mn */, { 0x1032, 0x1032} /* Mn */, { 0x1036, 0x1037} /* Mn */, { 0x1039, 0x1039} /* Mn */, { 0x1058, 0x1059} /* Mn */, { 0x135F, 0x135F} /* Mn */, { 0x1712, 0x1714} /* Mn */, { 0x1732, 0x1734} /* Mn */, { 0x1752, 0x1753} /* Mn */, { 0x1772, 0x1773} /* Mn */, { 0x17B7, 0x17BD} /* Mn */, { 0x17C6, 0x17C6} /* Mn */, { 0x17C9, 0x17D3} /* Mn */, { 0x17DD, 0x17DD} /* Mn */, { 0x180B, 0x180D} /* Mn */, { 0x18A9, 0x18A9} /* Mn */, { 0x1920, 0x1922} /* Mn */, { 0x1927, 0x1928} /* Mn */, { 0x1932, 0x1932} /* Mn */, { 0x1939, 0x193B} /* Mn */, { 0x1A17, 0x1A18} /* Mn */, { 0x1B00, 0x1B03} /* Mn */, { 0x1B34, 0x1B34} /* Mn */, { 0x1B36, 0x1B3A} /* Mn */, { 0x1B3C, 0x1B3C} /* Mn */, { 0x1B42, 0x1B42} /* Mn */, { 0x1B6B, 0x1B73} /* Mn */, { 0x1DC0, 0x1DCA} /* Mn */, { 0x1DFE, 0x1DFF} /* Mn */, { 0x20D0, 0x20DC} /* Mn */, { 0x20DD, 0x20E0} /* Me */, { 0x20E1, 0x20E1} /* Mn */, { 0x20E2, 0x20E4} /* Me */, { 0x20E5, 0x20EF} /* Mn */, { 0x302A, 0x302F} /* Mn */, { 0x3099, 0x309A} /* Mn */, { 0xA806, 0xA806} /* Mn */, { 0xA80B, 0xA80B} /* Mn */, { 0xA825, 0xA826} /* Mn */, { 0xFB1E, 0xFB1E} /* Mn */, { 0xFE00, 0xFE0F} /* Mn */, { 0xFE20, 0xFE23} /* Mn */, { 0x10A01, 0x10A03} /* Mn */, { 0x10A05, 0x10A06} /* Mn */, { 0x10A0C, 0x10A0F} /* Mn */, { 0x10A38, 0x10A3A} /* Mn */, { 0x10A3F, 0x10A3F} /* Mn */, { 0x1D167, 0x1D169} /* Mn */, { 0x1D17B, 0x1D182} /* Mn */, { 0x1D185, 0x1D18B} /* Mn */, { 0x1D1AA, 0x1D1AD} /* Mn */, { 0x1D242, 0x1D244} /* Mn */, { 0xE0100, 0xE01EF} /* Mn */, }; /* * Special pairs, not ranges. */ static struct wchar_range comb_table[] = { {0x0644,0x0622}, {0x0644,0x0623}, {0x0644,0x0625}, {0x0644,0x0627}, }; /* * Characters with general category values * Cc: Other, Control * Cf: Other, Format * Cs: Other, Surrogate * Co: Other, Private Use * Cn: Other, Not Assigned * Zl: Separator, Line * Zp: Separator, Paragraph * Last synched with * * dated 2005-11-30T00:58:48Z */ static struct wchar_range ubin_table[] = { { 0x0000, 0x001F} /* Cc */, { 0x007F, 0x009F} /* Cc */, #if 0 { 0x00AD, 0x00AD} /* Cf */, #endif { 0x0370, 0x0373} /* Cn */, { 0x0376, 0x0379} /* Cn */, { 0x037F, 0x0383} /* Cn */, { 0x038B, 0x038B} /* Cn */, { 0x038D, 0x038D} /* Cn */, { 0x03A2, 0x03A2} /* Cn */, { 0x03CF, 0x03CF} /* Cn */, { 0x0487, 0x0487} /* Cn */, { 0x0514, 0x0530} /* Cn */, { 0x0557, 0x0558} /* Cn */, { 0x0560, 0x0560} /* Cn */, { 0x0588, 0x0588} /* Cn */, { 0x058B, 0x0590} /* Cn */, { 0x05C8, 0x05CF} /* Cn */, { 0x05EB, 0x05EF} /* Cn */, { 0x05F5, 0x05FF} /* Cn */, #if 0 { 0x0600, 0x0603} /* Cf */, #endif { 0x0604, 0x060A} /* Cn */, { 0x0616, 0x061A} /* Cn */, { 0x061C, 0x061D} /* Cn */, { 0x0620, 0x0620} /* Cn */, { 0x063B, 0x063F} /* Cn */, { 0x065F, 0x065F} /* Cn */, #if 0 { 0x06DD, 0x06DD} /* Cf */, #endif { 0x070E, 0x070E} /* Cn */, #if 0 { 0x070F, 0x070F} /* Cf */, #endif { 0x074B, 0x074C} /* Cn */, { 0x076E, 0x077F} /* Cn */, { 0x07B2, 0x07BF} /* Cn */, { 0x07FB, 0x0900} /* Cn */, { 0x093A, 0x093B} /* Cn */, { 0x094E, 0x094F} /* Cn */, { 0x0955, 0x0957} /* Cn */, { 0x0971, 0x097A} /* Cn */, { 0x0980, 0x0980} /* Cn */, { 0x0984, 0x0984} /* Cn */, { 0x098D, 0x098E} /* Cn */, { 0x0991, 0x0992} /* Cn */, { 0x09A9, 0x09A9} /* Cn */, { 0x09B1, 0x09B1} /* Cn */, { 0x09B3, 0x09B5} /* Cn */, { 0x09BA, 0x09BB} /* Cn */, { 0x09C5, 0x09C6} /* Cn */, { 0x09C9, 0x09CA} /* Cn */, { 0x09CF, 0x09D6} /* Cn */, { 0x09D8, 0x09DB} /* Cn */, { 0x09DE, 0x09DE} /* Cn */, { 0x09E4, 0x09E5} /* Cn */, { 0x09FB, 0x0A00} /* Cn */, { 0x0A04, 0x0A04} /* Cn */, { 0x0A0B, 0x0A0E} /* Cn */, { 0x0A11, 0x0A12} /* Cn */, { 0x0A29, 0x0A29} /* Cn */, { 0x0A31, 0x0A31} /* Cn */, { 0x0A34, 0x0A34} /* Cn */, { 0x0A37, 0x0A37} /* Cn */, { 0x0A3A, 0x0A3B} /* Cn */, { 0x0A3D, 0x0A3D} /* Cn */, { 0x0A43, 0x0A46} /* Cn */, { 0x0A49, 0x0A4A} /* Cn */, { 0x0A4E, 0x0A58} /* Cn */, { 0x0A5D, 0x0A5D} /* Cn */, { 0x0A5F, 0x0A65} /* Cn */, { 0x0A75, 0x0A80} /* Cn */, { 0x0A84, 0x0A84} /* Cn */, { 0x0A8E, 0x0A8E} /* Cn */, { 0x0A92, 0x0A92} /* Cn */, { 0x0AA9, 0x0AA9} /* Cn */, { 0x0AB1, 0x0AB1} /* Cn */, { 0x0AB4, 0x0AB4} /* Cn */, { 0x0ABA, 0x0ABB} /* Cn */, { 0x0AC6, 0x0AC6} /* Cn */, { 0x0ACA, 0x0ACA} /* Cn */, { 0x0ACE, 0x0ACF} /* Cn */, { 0x0AD1, 0x0ADF} /* Cn */, { 0x0AE4, 0x0AE5} /* Cn */, { 0x0AF0, 0x0AF0} /* Cn */, { 0x0AF2, 0x0B00} /* Cn */, { 0x0B04, 0x0B04} /* Cn */, { 0x0B0D, 0x0B0E} /* Cn */, { 0x0B11, 0x0B12} /* Cn */, { 0x0B29, 0x0B29} /* Cn */, { 0x0B31, 0x0B31} /* Cn */, { 0x0B34, 0x0B34} /* Cn */, { 0x0B3A, 0x0B3B} /* Cn */, { 0x0B44, 0x0B46} /* Cn */, { 0x0B49, 0x0B4A} /* Cn */, { 0x0B4E, 0x0B55} /* Cn */, { 0x0B58, 0x0B5B} /* Cn */, { 0x0B5E, 0x0B5E} /* Cn */, { 0x0B62, 0x0B65} /* Cn */, { 0x0B72, 0x0B81} /* Cn */, { 0x0B84, 0x0B84} /* Cn */, { 0x0B8B, 0x0B8D} /* Cn */, { 0x0B91, 0x0B91} /* Cn */, { 0x0B96, 0x0B98} /* Cn */, { 0x0B9B, 0x0B9B} /* Cn */, { 0x0B9D, 0x0B9D} /* Cn */, { 0x0BA0, 0x0BA2} /* Cn */, { 0x0BA5, 0x0BA7} /* Cn */, { 0x0BAB, 0x0BAD} /* Cn */, { 0x0BBA, 0x0BBD} /* Cn */, { 0x0BC3, 0x0BC5} /* Cn */, { 0x0BC9, 0x0BC9} /* Cn */, { 0x0BCE, 0x0BD6} /* Cn */, { 0x0BD8, 0x0BE5} /* Cn */, { 0x0BFB, 0x0C00} /* Cn */, { 0x0C04, 0x0C04} /* Cn */, { 0x0C0D, 0x0C0D} /* Cn */, { 0x0C11, 0x0C11} /* Cn */, { 0x0C29, 0x0C29} /* Cn */, { 0x0C34, 0x0C34} /* Cn */, { 0x0C3A, 0x0C3D} /* Cn */, { 0x0C45, 0x0C45} /* Cn */, { 0x0C49, 0x0C49} /* Cn */, { 0x0C4E, 0x0C54} /* Cn */, { 0x0C57, 0x0C5F} /* Cn */, { 0x0C62, 0x0C65} /* Cn */, { 0x0C70, 0x0C81} /* Cn */, { 0x0C84, 0x0C84} /* Cn */, { 0x0C8D, 0x0C8D} /* Cn */, { 0x0C91, 0x0C91} /* Cn */, { 0x0CA9, 0x0CA9} /* Cn */, { 0x0CB4, 0x0CB4} /* Cn */, { 0x0CBA, 0x0CBB} /* Cn */, { 0x0CC5, 0x0CC5} /* Cn */, { 0x0CC9, 0x0CC9} /* Cn */, { 0x0CCE, 0x0CD4} /* Cn */, { 0x0CD7, 0x0CDD} /* Cn */, { 0x0CDF, 0x0CDF} /* Cn */, { 0x0CE4, 0x0CE5} /* Cn */, { 0x0CF0, 0x0CF0} /* Cn */, { 0x0CF3, 0x0D01} /* Cn */, { 0x0D04, 0x0D04} /* Cn */, { 0x0D0D, 0x0D0D} /* Cn */, { 0x0D11, 0x0D11} /* Cn */, { 0x0D29, 0x0D29} /* Cn */, { 0x0D3A, 0x0D3D} /* Cn */, { 0x0D44, 0x0D45} /* Cn */, { 0x0D49, 0x0D49} /* Cn */, { 0x0D4E, 0x0D56} /* Cn */, { 0x0D58, 0x0D5F} /* Cn */, { 0x0D62, 0x0D65} /* Cn */, { 0x0D70, 0x0D81} /* Cn */, { 0x0D84, 0x0D84} /* Cn */, { 0x0D97, 0x0D99} /* Cn */, { 0x0DB2, 0x0DB2} /* Cn */, { 0x0DBC, 0x0DBC} /* Cn */, { 0x0DBE, 0x0DBF} /* Cn */, { 0x0DC7, 0x0DC9} /* Cn */, { 0x0DCB, 0x0DCE} /* Cn */, { 0x0DD5, 0x0DD5} /* Cn */, { 0x0DD7, 0x0DD7} /* Cn */, { 0x0DE0, 0x0DF1} /* Cn */, { 0x0DF5, 0x0E00} /* Cn */, { 0x0E3B, 0x0E3E} /* Cn */, { 0x0E5C, 0x0E80} /* Cn */, { 0x0E83, 0x0E83} /* Cn */, { 0x0E85, 0x0E86} /* Cn */, { 0x0E89, 0x0E89} /* Cn */, { 0x0E8B, 0x0E8C} /* Cn */, { 0x0E8E, 0x0E93} /* Cn */, { 0x0E98, 0x0E98} /* Cn */, { 0x0EA0, 0x0EA0} /* Cn */, { 0x0EA4, 0x0EA4} /* Cn */, { 0x0EA6, 0x0EA6} /* Cn */, { 0x0EA8, 0x0EA9} /* Cn */, { 0x0EAC, 0x0EAC} /* Cn */, { 0x0EBA, 0x0EBA} /* Cn */, { 0x0EBE, 0x0EBF} /* Cn */, { 0x0EC5, 0x0EC5} /* Cn */, { 0x0EC7, 0x0EC7} /* Cn */, { 0x0ECE, 0x0ECF} /* Cn */, { 0x0EDA, 0x0EDB} /* Cn */, { 0x0EDE, 0x0EFF} /* Cn */, { 0x0F48, 0x0F48} /* Cn */, { 0x0F6B, 0x0F70} /* Cn */, { 0x0F8C, 0x0F8F} /* Cn */, { 0x0F98, 0x0F98} /* Cn */, { 0x0FBD, 0x0FBD} /* Cn */, { 0x0FCD, 0x0FCE} /* Cn */, { 0x0FD2, 0x0FFF} /* Cn */, { 0x1022, 0x1022} /* Cn */, { 0x1028, 0x1028} /* Cn */, { 0x102B, 0x102B} /* Cn */, { 0x1033, 0x1035} /* Cn */, { 0x103A, 0x103F} /* Cn */, { 0x105A, 0x109F} /* Cn */, { 0x10C6, 0x10CF} /* Cn */, { 0x10FD, 0x10FF} /* Cn */, { 0x115A, 0x115E} /* Cn */, { 0x11A3, 0x11A7} /* Cn */, { 0x11FA, 0x11FF} /* Cn */, { 0x1249, 0x1249} /* Cn */, { 0x124E, 0x124F} /* Cn */, { 0x1257, 0x1257} /* Cn */, { 0x1259, 0x1259} /* Cn */, { 0x125E, 0x125F} /* Cn */, { 0x1289, 0x1289} /* Cn */, { 0x128E, 0x128F} /* Cn */, { 0x12B1, 0x12B1} /* Cn */, { 0x12B6, 0x12B7} /* Cn */, { 0x12BF, 0x12BF} /* Cn */, { 0x12C1, 0x12C1} /* Cn */, { 0x12C6, 0x12C7} /* Cn */, { 0x12D7, 0x12D7} /* Cn */, { 0x1311, 0x1311} /* Cn */, { 0x1316, 0x1317} /* Cn */, { 0x135B, 0x135E} /* Cn */, { 0x137D, 0x137F} /* Cn */, { 0x139A, 0x139F} /* Cn */, { 0x13F5, 0x1400} /* Cn */, { 0x1677, 0x167F} /* Cn */, { 0x169D, 0x169F} /* Cn */, { 0x16F1, 0x16FF} /* Cn */, { 0x170D, 0x170D} /* Cn */, { 0x1715, 0x171F} /* Cn */, { 0x1737, 0x173F} /* Cn */, { 0x1754, 0x175F} /* Cn */, { 0x176D, 0x176D} /* Cn */, { 0x1771, 0x1771} /* Cn */, { 0x1774, 0x177F} /* Cn */, #if 0 { 0x17B4, 0x17B5} /* Cf */, #endif { 0x17DE, 0x17DF} /* Cn */, { 0x17EA, 0x17EF} /* Cn */, { 0x17FA, 0x17FF} /* Cn */, { 0x180F, 0x180F} /* Cn */, { 0x181A, 0x181F} /* Cn */, { 0x1878, 0x187F} /* Cn */, { 0x18AA, 0x18FF} /* Cn */, { 0x191D, 0x191F} /* Cn */, { 0x192C, 0x192F} /* Cn */, { 0x193C, 0x193F} /* Cn */, { 0x1941, 0x1943} /* Cn */, { 0x196E, 0x196F} /* Cn */, { 0x1975, 0x197F} /* Cn */, { 0x19AA, 0x19AF} /* Cn */, { 0x19CA, 0x19CF} /* Cn */, { 0x19DA, 0x19DD} /* Cn */, { 0x1A1C, 0x1A1D} /* Cn */, { 0x1A20, 0x1AFF} /* Cn */, { 0x1B4C, 0x1B4F} /* Cn */, { 0x1B7D, 0x1CFF} /* Cn */, { 0x1DCB, 0x1DFD} /* Cn */, { 0x1E9C, 0x1E9F} /* Cn */, { 0x1EFA, 0x1EFF} /* Cn */, { 0x1F16, 0x1F17} /* Cn */, { 0x1F1E, 0x1F1F} /* Cn */, { 0x1F46, 0x1F47} /* Cn */, { 0x1F4E, 0x1F4F} /* Cn */, { 0x1F58, 0x1F58} /* Cn */, { 0x1F5A, 0x1F5A} /* Cn */, { 0x1F5C, 0x1F5C} /* Cn */, { 0x1F5E, 0x1F5E} /* Cn */, { 0x1F7E, 0x1F7F} /* Cn */, { 0x1FB5, 0x1FB5} /* Cn */, { 0x1FC5, 0x1FC5} /* Cn */, { 0x1FD4, 0x1FD5} /* Cn */, { 0x1FDC, 0x1FDC} /* Cn */, { 0x1FF0, 0x1FF1} /* Cn */, { 0x1FF5, 0x1FF5} /* Cn */, { 0x1FFF, 0x1FFF} /* Cn */, { 0x200B, 0x200F} /* Cf */, { 0x2028, 0x2028} /* Zl */, { 0x2029, 0x2029} /* Zp */, { 0x202A, 0x202E} /* Cf */, { 0x2060, 0x2063} /* Cf */, { 0x2064, 0x2069} /* Cn */, { 0x206A, 0x206F} /* Cf */, { 0x2072, 0x2073} /* Cn */, { 0x208F, 0x208F} /* Cn */, { 0x2095, 0x209F} /* Cn */, { 0x20B6, 0x20CF} /* Cn */, { 0x20F0, 0x20FF} /* Cn */, { 0x214F, 0x2152} /* Cn */, { 0x2185, 0x218F} /* Cn */, { 0x23E8, 0x23FF} /* Cn */, { 0x2427, 0x243F} /* Cn */, { 0x244B, 0x245F} /* Cn */, { 0x269D, 0x269F} /* Cn */, { 0x26B3, 0x2700} /* Cn */, { 0x2705, 0x2705} /* Cn */, { 0x270A, 0x270B} /* Cn */, { 0x2728, 0x2728} /* Cn */, { 0x274C, 0x274C} /* Cn */, { 0x274E, 0x274E} /* Cn */, { 0x2753, 0x2755} /* Cn */, { 0x2757, 0x2757} /* Cn */, { 0x275F, 0x2760} /* Cn */, { 0x2795, 0x2797} /* Cn */, { 0x27B0, 0x27B0} /* Cn */, { 0x27BF, 0x27BF} /* Cn */, { 0x27CB, 0x27CF} /* Cn */, { 0x27EC, 0x27EF} /* Cn */, { 0x2B1B, 0x2B1F} /* Cn */, { 0x2B24, 0x2BFF} /* Cn */, { 0x2C2F, 0x2C2F} /* Cn */, { 0x2C5F, 0x2C5F} /* Cn */, { 0x2C6D, 0x2C73} /* Cn */, { 0x2C78, 0x2C7F} /* Cn */, { 0x2CEB, 0x2CF8} /* Cn */, { 0x2D26, 0x2D2F} /* Cn */, { 0x2D66, 0x2D6E} /* Cn */, { 0x2D70, 0x2D7F} /* Cn */, { 0x2D97, 0x2D9F} /* Cn */, { 0x2DA7, 0x2DA7} /* Cn */, { 0x2DAF, 0x2DAF} /* Cn */, { 0x2DB7, 0x2DB7} /* Cn */, { 0x2DBF, 0x2DBF} /* Cn */, { 0x2DC7, 0x2DC7} /* Cn */, { 0x2DCF, 0x2DCF} /* Cn */, { 0x2DD7, 0x2DD7} /* Cn */, { 0x2DDF, 0x2DFF} /* Cn */, { 0x2E18, 0x2E1B} /* Cn */, { 0x2E1E, 0x2E7F} /* Cn */, { 0x2E9A, 0x2E9A} /* Cn */, { 0x2EF4, 0x2EFF} /* Cn */, { 0x2FD6, 0x2FEF} /* Cn */, { 0x2FFC, 0x2FFF} /* Cn */, { 0x3040, 0x3040} /* Cn */, { 0x3097, 0x3098} /* Cn */, { 0x3100, 0x3104} /* Cn */, { 0x312D, 0x3130} /* Cn */, { 0x318F, 0x318F} /* Cn */, { 0x31B8, 0x31BF} /* Cn */, { 0x31D0, 0x31EF} /* Cn */, { 0x321F, 0x321F} /* Cn */, { 0x3244, 0x324F} /* Cn */, { 0x32FF, 0x32FF} /* Cn */, { 0x4DB6, 0x4DBF} /* Cn */, { 0x9FBC, 0x9FFF} /* Cn */, { 0xA48D, 0xA48F} /* Cn */, { 0xA4C7, 0xA6FF} /* Cn */, { 0xA71B, 0xA71F} /* Cn */, { 0xA722, 0xA7FF} /* Cn */, { 0xA82C, 0xA83F} /* Cn */, { 0xA878, 0xABFF} /* Cn */, { 0xD7A4, 0xD7FF} /* Cn */, { 0xD800, 0xDFFF} /* Cs */, { 0xE000, 0xF8FF} /* Co */, { 0xFA2E, 0xFA2F} /* Cn */, { 0xFA6B, 0xFA6F} /* Cn */, { 0xFADA, 0xFAFF} /* Cn */, { 0xFB07, 0xFB12} /* Cn */, { 0xFB18, 0xFB1C} /* Cn */, { 0xFB37, 0xFB37} /* Cn */, { 0xFB3D, 0xFB3D} /* Cn */, { 0xFB3F, 0xFB3F} /* Cn */, { 0xFB42, 0xFB42} /* Cn */, { 0xFB45, 0xFB45} /* Cn */, { 0xFBB2, 0xFBD2} /* Cn */, { 0xFD40, 0xFD4F} /* Cn */, { 0xFD90, 0xFD91} /* Cn */, { 0xFDC8, 0xFDEF} /* Cn */, { 0xFDFE, 0xFDFF} /* Cn */, { 0xFE1A, 0xFE1F} /* Cn */, { 0xFE24, 0xFE2F} /* Cn */, { 0xFE53, 0xFE53} /* Cn */, { 0xFE67, 0xFE67} /* Cn */, { 0xFE6C, 0xFE6F} /* Cn */, { 0xFE75, 0xFE75} /* Cn */, { 0xFEFD, 0xFEFE} /* Cn */, { 0xFEFF, 0xFEFF} /* Cf */, { 0xFF00, 0xFF00} /* Cn */, { 0xFFBF, 0xFFC1} /* Cn */, { 0xFFC8, 0xFFC9} /* Cn */, { 0xFFD0, 0xFFD1} /* Cn */, { 0xFFD8, 0xFFD9} /* Cn */, { 0xFFDD, 0xFFDF} /* Cn */, { 0xFFE7, 0xFFE7} /* Cn */, { 0xFFEF, 0xFFF8} /* Cn */, { 0xFFF9, 0xFFFB} /* Cf */, { 0xFFFE, 0xFFFF} /* Cn */, { 0x1000C, 0x1000C} /* Cn */, { 0x10027, 0x10027} /* Cn */, { 0x1003B, 0x1003B} /* Cn */, { 0x1003E, 0x1003E} /* Cn */, { 0x1004E, 0x1004F} /* Cn */, { 0x1005E, 0x1007F} /* Cn */, { 0x100FB, 0x100FF} /* Cn */, { 0x10103, 0x10106} /* Cn */, { 0x10134, 0x10136} /* Cn */, { 0x1018B, 0x102FF} /* Cn */, { 0x1031F, 0x1031F} /* Cn */, { 0x10324, 0x1032F} /* Cn */, { 0x1034B, 0x1037F} /* Cn */, { 0x1039E, 0x1039E} /* Cn */, { 0x103C4, 0x103C7} /* Cn */, { 0x103D6, 0x103FF} /* Cn */, { 0x1049E, 0x1049F} /* Cn */, { 0x104AA, 0x107FF} /* Cn */, { 0x10806, 0x10807} /* Cn */, { 0x10809, 0x10809} /* Cn */, { 0x10836, 0x10836} /* Cn */, { 0x10839, 0x1083B} /* Cn */, { 0x1083D, 0x1083E} /* Cn */, { 0x10840, 0x108FF} /* Cn */, { 0x1091A, 0x1091E} /* Cn */, { 0x10920, 0x109FF} /* Cn */, { 0x10A04, 0x10A04} /* Cn */, { 0x10A07, 0x10A0B} /* Cn */, { 0x10A14, 0x10A14} /* Cn */, { 0x10A18, 0x10A18} /* Cn */, { 0x10A34, 0x10A37} /* Cn */, { 0x10A3B, 0x10A3E} /* Cn */, { 0x10A48, 0x10A4F} /* Cn */, { 0x10A59, 0x11FFF} /* Cn */, { 0x1236F, 0x123FF} /* Cn */, { 0x12463, 0x1246F} /* Cn */, { 0x12474, 0x1CFFF} /* Cn */, { 0x1D0F6, 0x1D0FF} /* Cn */, { 0x1D127, 0x1D129} /* Cn */, { 0x1D173, 0x1D17A} /* Cf */, { 0x1D1DE, 0x1D1FF} /* Cn */, { 0x1D246, 0x1D2FF} /* Cn */, { 0x1D357, 0x1D35F} /* Cn */, { 0x1D372, 0x1D3FF} /* Cn */, { 0x1D455, 0x1D455} /* Cn */, { 0x1D49D, 0x1D49D} /* Cn */, { 0x1D4A0, 0x1D4A1} /* Cn */, { 0x1D4A3, 0x1D4A4} /* Cn */, { 0x1D4A7, 0x1D4A8} /* Cn */, { 0x1D4AD, 0x1D4AD} /* Cn */, { 0x1D4BA, 0x1D4BA} /* Cn */, { 0x1D4BC, 0x1D4BC} /* Cn */, { 0x1D4C4, 0x1D4C4} /* Cn */, { 0x1D506, 0x1D506} /* Cn */, { 0x1D50B, 0x1D50C} /* Cn */, { 0x1D515, 0x1D515} /* Cn */, { 0x1D51D, 0x1D51D} /* Cn */, { 0x1D53A, 0x1D53A} /* Cn */, { 0x1D53F, 0x1D53F} /* Cn */, { 0x1D545, 0x1D545} /* Cn */, { 0x1D547, 0x1D549} /* Cn */, { 0x1D551, 0x1D551} /* Cn */, { 0x1D6A6, 0x1D6A7} /* Cn */, { 0x1D7CC, 0x1D7CD} /* Cn */, { 0x1D800, 0x1FFFF} /* Cn */, { 0x2A6D7, 0x2F7FF} /* Cn */, { 0x2FA1E, 0xE0000} /* Cn */, { 0xE0001, 0xE0001} /* Cf */, { 0xE0002, 0xE001F} /* Cn */, { 0xE0020, 0xE007F} /* Cf */, { 0xE0080, 0xE00FF} /* Cn */, { 0xE01F0, 0xEFFFF} /* Cn */, { 0xF0000, 0xFFFFD} /* Co */, { 0xFFFFE, 0xFFFFF} /* Cn */, {0x100000,0x10FFFD} /* Co */, {0x10FFFE,0x10FFFF} /* Cn */, {0x110000,0x7FFFFFFF} /* ISO 10646?? */ }; /* * Double width characters * W: East Asian Wide * F: East Asian Full-width * Unassigned code points may be included when they allow ranges to be merged. * Last synched with * * dated 2005-11-08T01:32:56Z */ static struct wchar_range wide_table[] = { { 0x1100, 0x115F} /* W */, { 0x2329, 0x232A} /* W */, { 0x2E80, 0x2FFB} /* W */, { 0x3000, 0x3000} /* F */, { 0x3001, 0x303E} /* W */, { 0x3041, 0x4DB5} /* W */, { 0x4E00, 0x9FBB} /* W */, { 0xA000, 0xA4C6} /* W */, { 0xAC00, 0xD7A3} /* W */, { 0xF900, 0xFAD9} /* W */, { 0xFE10, 0xFE19} /* W */, { 0xFE30, 0xFE6B} /* W */, { 0xFF01, 0xFF60} /* F */, { 0xFFE0, 0xFFE6} /* F */, { 0x20000, 0x2FFFD} /* W */, { 0x30000, 0x3FFFD} /* W */, }; static int is_in_table(ch, table, tsize) LWCHAR ch; struct wchar_range table[]; int tsize; { int hi; int lo; /* Binary search in the table. */ if (ch < table[0].first) return 0; lo = 0; hi = tsize - 1; while (lo <= hi) { int mid = (lo + hi) / 2; if (ch > table[mid].last) lo = mid + 1; else if (ch < table[mid].first) hi = mid - 1; else return 1; } return 0; } /* * Is a character a UTF-8 composing character? * If a composing character follows any char, the two combine into one glyph. */ public int is_composing_char(ch) LWCHAR ch; { return is_in_table(ch, comp_table, (sizeof(comp_table) / sizeof(*comp_table))); } /* * Should this UTF-8 character be treated as binary? */ public int is_ubin_char(ch) LWCHAR ch; { return is_in_table(ch, ubin_table, (sizeof(ubin_table) / sizeof(*ubin_table))); } /* * Is this a double width UTF-8 character? */ public int is_wide_char(ch) LWCHAR ch; { return is_in_table(ch, wide_table, (sizeof(wide_table) / sizeof(*wide_table))); } /* * Is a character a UTF-8 combining character? * A combining char acts like an ordinary char, but if it follows * a specific char (not any char), the two combine into one glyph. */ public int is_combining_char(ch1, ch2) LWCHAR ch1; LWCHAR ch2; { /* The table is small; use linear search. */ int i; for (i = 0; i < sizeof(comb_table)/sizeof(*comb_table); i++) { if (ch1 == comb_table[i].first && ch2 == comb_table[i].last) return 1; } return 0; } Index: vendor/less/dist/contrib/less/less.man =================================================================== --- vendor/less/dist/contrib/less/less.man (revision 172596) +++ vendor/less/dist/contrib/less/less.man (revision 172597) @@ -1,1547 +1,1547 @@ LESS(1) LESS(1) NAME less - opposite of more SYNOPSIS less -? less --help less -V less --version less [-[+]aBcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX~] [-b space] [-h lines] [-j line] [-k keyfile] [-{oO} logfile] [-p pattern] [-P prompt] [-t tag] [-T tagsfile] [-x tab,...] [-y lines] [-[z] lines] [-# shift] [+[+]cmd] [--] [filename]... (See the OPTIONS section for alternate option syntax with long option names.) DESCRIPTION Less is a program similar to more (1), but which allows backward move- ment in the file as well as forward movement. Also, less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like vi (1). Less uses termcap (or terminfo on some systems), so it can run on a variety of terminals. There is even limited support for hardcopy terminals. (On a hardcopy terminal, lines which should be printed at the top of the screen are prefixed with a caret.) Commands are based on both more and vi. Commands may be preceded by a decimal number, called N in the descriptions below. The number is used by some commands, as indicated. COMMANDS In the following descriptions, ^X means control-X. ESC stands for the ESCAPE key; for example ESC-v means the two character sequence "ESCAPE", then "v". h or H Help: display a summary of these commands. If you forget all the other commands, remember this one. SPACE or ^V or f or ^F Scroll forward N lines, default one window (see option -z below). If N is more than the screen size, only the final screenful is displayed. Warning: some systems use ^V as a spe- cial literalization character. z Like SPACE, but if N is specified, it becomes the new window size. ESC-SPACE Like SPACE, but scrolls a full screenful, even if it reaches end-of-file in the process. RETURN or ^N or e or ^E or j or ^J Scroll forward N lines, default 1. The entire N lines are dis- played, even if N is more than the screen size. d or ^D Scroll forward N lines, default one half of the screen size. If N is specified, it becomes the new default for subsequent d and u commands. b or ^B or ESC-v Scroll backward N lines, default one window (see option -z below). If N is more than the screen size, only the final screenful is displayed. w Like ESC-v, but if N is specified, it becomes the new window size. y or ^Y or ^P or k or ^K Scroll backward N lines, default 1. The entire N lines are dis- played, even if N is more than the screen size. Warning: some systems use ^Y as a special job control character. u or ^U Scroll backward N lines, default one half of the screen size. If N is specified, it becomes the new default for subsequent d and u commands. ESC-) or RIGHTARROW Scroll horizontally right N characters, default half the screen width (see the -# option). If a number N is specified, it becomes the default for future RIGHTARROW and LEFTARROW com- mands. While the text is scrolled, it acts as though the -S option (chop lines) were in effect. ESC-( or LEFTARROW Scroll horizontally left N characters, default half the screen width (see the -# option). If a number N is specified, it becomes the default for future RIGHTARROW and LEFTARROW com- mands. r or ^R or ^L Repaint the screen. R Repaint the screen, discarding any buffered input. Useful if the file is changing while it is being viewed. F Scroll forward, and keep trying to read when the end of file is reached. Normally this command would be used when already at the end of the file. It is a way to monitor the tail of a file which is growing while it is being viewed. (The behavior is similar to the "tail -f" command.) g or < or ESC-< Go to line N in the file, default 1 (beginning of file). (Warn- ing: this may be slow if N is large.) G or > or ESC-> Go to line N in the file, default the end of the file. (Warn- ing: this may be slow if N is large, or if N is not specified and standard input, rather than a file, is being read.) p or % Go to a position N percent into the file. N should be between 0 and 100, and may contain a decimal point. P Go to the line containing byte offset N in the file. { If a left curly bracket appears in the top line displayed on the screen, the { command will go to the matching right curly bracket. The matching right curly bracket is positioned on the bottom line of the screen. If there is more than one left curly bracket on the top line, a number N may be used to specify the N-th bracket on the line. } If a right curly bracket appears in the bottom line displayed on the screen, the } command will go to the matching left curly bracket. The matching left curly bracket is positioned on the top line of the screen. If there is more than one right curly bracket on the top line, a number N may be used to specify the N-th bracket on the line. ( Like {, but applies to parentheses rather than curly brackets. ) Like }, but applies to parentheses rather than curly brackets. [ Like {, but applies to square brackets rather than curly brack- ets. ] Like }, but applies to square brackets rather than curly brack- ets. ESC-^F Followed by two characters, acts like {, but uses the two char- acters as open and close brackets, respectively. For example, "ESC ^F < >" could be used to go forward to the > which matches the < in the top displayed line. ESC-^B Followed by two characters, acts like }, but uses the two char- acters as open and close brackets, respectively. For example, "ESC ^B < >" could be used to go backward to the < which matches the > in the bottom displayed line. m Followed by any lowercase letter, marks the current position with that letter. ' (Single quote.) Followed by any lowercase letter, returns to the position which was previously marked with that letter. Fol- lowed by another single quote, returns to the position at which the last "large" movement command was executed. Followed by a ^ or $, jumps to the beginning or end of the file respectively. Marks are preserved when a new file is examined, so the ' com- mand can be used to switch between input files. ^X^X Same as single quote. /pattern Search forward in the file for the N-th line containing the pat- tern. N defaults to 1. The pattern is a regular expression, as recognized by the regular expression library supplied by your system. The search starts at the second line displayed (but see the -a and -j options, which change this). 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: ^N or ! Search for lines which do NOT match the pattern. ^E or * Search multiple files. 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. ^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. ^K Highlight any text which matches the pattern on the cur- rent screen, but don't move to the first match (KEEP current position). ^R Don't interpret regular expression metacharacters; that is, do a simple textual comparison. ?pattern Search backward in the file for the N-th line containing the pattern. The search starts at the line immediately before the top line displayed. Certain characters are special as in the / command: ^N or ! Search for lines which do NOT match the pattern. ^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. ^F or @ Begin the search at the last line of the last file in the command line list, regardless of what is currently dis- played on the screen or the settings of the -a or -j options. ^K As in forward searches. ^R As in forward searches. ESC-/pattern Same as "/*". ESC-?pattern Same as "?*". n Repeat previous search, for N-th line containing the last pat- tern. If the previous search was modified by ^N, the search is made for the N-th line NOT containing the pattern. If the pre- vious search was modified by ^E, the search continues in the next (or previous) file if not satisfied in the current file. If the previous search was modified by ^R, the search is done without using regular expressions. There is no effect if the previous search was modified by ^F or ^K. N Repeat previous search, but in the reverse direction. ESC-n Repeat previous search, but crossing file boundaries. The effect is as if the previous search were modified by *. ESC-N Repeat previous search, but in the reverse direction and cross- ing file boundaries. ESC-u Undo search highlighting. Turn off highlighting of strings matching the current search pattern. If highlighting is already off because of a previous ESC-u command, turn highlighting back on. Any search command will also turn highlighting back on. (Highlighting can also be disabled by toggling the -G option; in that case search commands do not turn highlighting back on.) :e [filename] Examine a new file. If the filename is missing, the "current" file (see the :n and :p commands below) from the list of files in the command line is re-examined. A percent sign (%) in the filename is replaced by the name of the current file. A pound sign (#) is replaced by the name of the previously examined file. However, two consecutive percent signs are simply replaced with a single percent sign. This allows you to enter a filename that contains a percent sign in the name. Similarly, two consecutive pound signs are replaced with a single pound sign. The filename is inserted into the command line list of files so that it can be seen by subsequent :n and :p commands. If the filename consists of several files, they are all inserted into the list of files and the first one is examined. If the filename contains one or more spaces, the entire filename should be enclosed in double quotes (also see the -" option). ^X^V or E Same as :e. Warning: some systems use ^V as a special literal- ization character. On such systems, you may not be able to use ^V. :n Examine the next file (from the list of files given in the com- mand line). If a number N is specified, the N-th next file is examined. :p Examine the previous file in the command line list. If a number N is specified, the N-th previous file is examined. :x Examine the first file in the command line list. If a number N is specified, the N-th file in the list is examined. :d Remove the current file from the list of files. t Go to the next tag, if there were more than one matches for the current tag. See the -t option for more details about tags. T Go to the previous tag, if there were more than one matches for the current tag. = or ^G or :f Prints some information about the file being viewed, including its name and the line number and byte offset of the bottom line being displayed. If possible, it also prints the length of the file, the number of lines in the file and the percent of the file above the last displayed line. - Followed by one of the command line option letters (see OPTIONS below), this will change the setting of that option and print a message describing the new setting. If a ^P (CONTROL-P) is entered immediately after the dash, the setting of the option is changed but no message is printed. If the option letter has a numeric value (such as -b or -h), or a string value (such as -P or -t), a new value may be entered after the option letter. If no new value is entered, a message describing the current set- ting is printed and nothing is changed. -- Like the - command, but takes a long option name (see OPTIONS below) rather than a single option letter. You must press RETURN after typing the option name. A ^P immediately after the second dash suppresses printing of a message describing the new setting, as in the - command. -+ Followed by one of the command line option letters this will reset the option to its default setting and print a message describing the new setting. (The "-+X" command does the same thing as "-+X" on the command line.) This does not work for string-valued options. --+ Like the -+ command, but takes a long option name rather than a single option letter. -! Followed by one of the command line option letters, this will reset the option to the "opposite" of its default setting and print a message describing the new setting. This does not work for numeric or string-valued options. --! Like the -! command, but takes a long option name rather than a single option letter. _ (Underscore.) Followed by one of the command line option let- ters, this will print a message describing the current setting of that option. The setting of the option is not changed. __ (Double underscore.) Like the _ (underscore) command, but takes a long option name rather than a single option letter. You must press RETURN after typing the option name. +cmd Causes the specified cmd to be executed each time a new file is examined. For example, +G causes less to initially display each file starting at the end rather than the beginning. V Prints the version number of less being run. q or Q or :q or :Q or ZZ Exits less. The following four commands may or may not be valid, depending on your particular installation. v Invokes an editor to edit the current file being viewed. The editor is taken from the environment variable VISUAL if defined, or EDITOR if VISUAL is not defined, or defaults to "vi" if nei- ther VISUAL nor EDITOR is defined. See also the discussion of LESSEDIT under the section on PROMPTS below. ! shell-command Invokes a shell to run the shell-command given. A percent sign (%) in the command is replaced by the name of the current file. A pound sign (#) is replaced by the name of the previously exam- ined file. "!!" repeats the last shell command. "!" with no shell command simply invokes a shell. On Unix systems, the shell is taken from the environment variable SHELL, or defaults to "sh". On MS-DOS and OS/2 systems, the shell is the normal command processor. | shell-command represents any mark letter. Pipes a section of the input file to the given shell command. The section of the file to be piped is between the first line on the current screen and the position marked by the letter. may also be ^ or $ to indi- cate beginning or end of file respectively. If is . or new- line, the current screen is piped. s filename Save the input to a file. This only works if the input is a pipe, not an ordinary file. OPTIONS Command line options are described below. Most options may be changed while less is running, via the "-" command. Most options may be given in one of two forms: either a dash followed by a single letter, or two dashes followed by a long option name. A long option name may be abbreviated as long as the abbreviation is unambiguous. For example, --quit-at-eof may be abbreviated --quit, but not --qui, since both --quit-at-eof and --quiet begin with --qui. Some long option names are in uppercase, such as --QUIT-AT-EOF, as distinct from --quit-at-eof. Such option names need only have their first let- ter capitalized; the remainder of the name may be in either case. For example, --Quit-at-eof is equivalent to --QUIT-AT-EOF. Options are also taken from the environment variable "LESS". For exam- ple, to avoid typing "less -options ..." each time less is invoked, you might tell csh: setenv LESS "-options" or if you use sh: LESS="-options"; export LESS On MS-DOS, you don't need the quotes, but you should replace any per- cent signs in the options string by double percent signs. The environment variable is parsed before the command line, so command line options override the LESS environment variable. If an option appears in the LESS variable, it can be reset to its default value on the command line by beginning the command line option with "-+". For options like -P or -D which take a following string, a dollar sign ($) must be used to signal the end of the string. For example, to set two -D options on MS-DOS, you must have a dollar sign between them, like this: LESS="-Dn9.1$-Ds4.1" -? or --help This option displays a summary of the commands accepted by less (the same as the h command). (Depending on how your shell interprets the question mark, it may be necessary to quote the question mark, thus: "-\?".) -a or --search-skip-screen Causes searches to start after the last line displayed on the screen, thus skipping all lines displayed on the screen. By default, searches start at the second line on the screen (or after the last found line; see the -j option). -bn or --buffers=n Specifies the amount of buffer space less will use for each file, in units of kilobytes (1024 bytes). By default 64K of buffer space is used for each file (unless the file is a pipe; see the -B option). The -b option specifies instead that n kilobytes of buffer space should be used for each file. If n is -1, buffer space is unlimited; that is, the entire file is read into memory. -B or --auto-buffers By default, when data is read from a pipe, buffers are allocated automatically as needed. If a large amount of data is read from the pipe, this can cause a large amount of memory to be allo- cated. The -B option disables this automatic allocation of buffers for pipes, so that only 64K (or the amount of space specified by the -b option) is used for the pipe. Warning: use of -B can result in erroneous display, since only the most recently viewed part of the file is kept in memory; any earlier data is lost. -c or --clear-screen Causes full screen repaints to be painted from the top line down. By default, full screen repaints are done by scrolling from the bottom of the screen. -C or --CLEAR-SCREEN Same as -c, for compatibility with older versions of less. -d or --dumb The -d option suppresses the error message normally displayed if the terminal is dumb; that is, lacks some important capability, such as the ability to clear the screen or scroll backward. The -d option does not otherwise change the behavior of less on a dumb terminal. -Dxcolor or --color=xcolor [MS-DOS only] Sets the color of the text displayed. x is a sin- gle character which selects the type of text whose color is being set: n=normal, s=standout, d=bold, u=underlined, k=blink. color is a pair of numbers separated by a period. The first number selects the foreground color and the second selects the background color of the text. A single number N is the same as N.0. -e or --quit-at-eof Causes less to automatically exit the second time it reaches end-of-file. By default, the only way to exit less is via the "q" command. -E or --QUIT-AT-EOF Causes less to automatically exit the first time it reaches end- of-file. -f or --force Forces non-regular files to be opened. (A non-regular file is a directory or a device special file.) Also suppresses the warn- ing message when a binary file is opened. By default, less will refuse to open non-regular files. Note that some operating sys- tems will not allow directories to be read, even if -f is set. -F or --quit-if-one-screen Causes less to automatically exit if the entire file can be dis- played on the first screen. -g or --hilite-search Normally, less will highlight ALL strings which match the last search command. The -g option changes this behavior to high- light only the particular string which was found by the last search command. This can cause less to run somewhat faster than the default. -G or --HILITE-SEARCH The -G option suppresses all highlighting of strings found by search commands. -hn or --max-back-scroll=n Specifies a maximum number of lines to scroll backward. If it is necessary to scroll backward more than n lines, the screen is repainted in a forward direction instead. (If the terminal does not have the ability to scroll backward, -h0 is implied.) -i or --ignore-case Causes searches to ignore case; that is, uppercase and lowercase are considered identical. This option is ignored if any upper- case letters appear in the search pattern; in other words, if a pattern contains uppercase letters, then that search does not ignore case. -I or --IGNORE-CASE Like -i, but searches ignore case even if the pattern contains uppercase letters. -jn or --jump-target=n Specifies a line on the screen where the "target" line is to be positioned. A target line is the object of a text search, tag search, jump to a line number, jump to a file percentage, or jump to a marked position. The screen line may be specified by a number: the top line on the screen is 1, the next is 2, and so on. The number may be negative to specify a line relative to the bottom of the screen: the bottom line on the screen is -1, the second to the bottom is -2, and so on. Alternately, the screen line may be specified as a fraction of the height of the screen, starting with a decimal point: .5 is in the middle of the screen, .3 is three tenths down from the first line, and so on. If the line is specified as a fraction, the actual line number is recalculated if the terminal window is resized, so that the target line remains at the specified fraction of the screen height. If the -j option is used, searches begin at the line immediately after the target line. For example, if "-j4" is used, the target line is the fourth line on the screen, so searches begin at the fifth line on the screen. -J or --status-column Displays a status column at the left edge of the screen. The status column shows the lines that matched the current search. The status column is also used if the -w or -W option is in effect. -kfilename or --lesskey-file=filename Causes less to open and interpret the named file as a lesskey (1) file. Multiple -k options may be specified. If the LESSKEY or LESSKEY_SYSTEM environment variable is set, or if a lesskey file is found in a standard place (see KEY BINDINGS), it is also used as a lesskey file. -K or --quit-on-intr Causes less to exit immediately when an interrupt character (usually ^C) is typed. Normally, an interrupt character causes less to stop whatever it is doing and return to its command prompt. -L or --no-lessopen Ignore the LESSOPEN environment variable (see the INPUT PREPRO- CESSOR section below). This option can be set from within less, but it will apply only to files opened subsequently, not to the file which is currently open. -m or --long-prompt Causes less to prompt verbosely (like more), with the percent into the file. By default, less prompts with a colon. -M or --LONG-PROMPT Causes less to prompt even more verbosely than more. -n or --line-numbers Suppresses line numbers. The default (to use line numbers) may cause less to run more slowly in some cases, especially with a very large input file. Suppressing line numbers with the -n option will avoid this problem. Using line numbers means: the line number will be displayed in the verbose prompt and in the = command, and the v command will pass the current line number to the editor (see also the discussion of LESSEDIT in PROMPTS below). -N or --LINE-NUMBERS Causes a line number to be displayed at the beginning of each line in the display. -ofilename or --log-file=filename Causes less to copy its input to the named file as it is being viewed. This applies only when the input file is a pipe, not an ordinary file. If the file already exists, less will ask for confirmation before overwriting it. -Ofilename or --LOG-FILE=filename The -O option is like -o, but it will overwrite an existing file without asking for confirmation. If no log file has been specified, the -o and -O options can be used from within less to specify a log file. Without a file name, they will simply report the name of the log file. The "s" command is equivalent to specifying -o from within less. -ppattern or --pattern=pattern The -p option on the command line is equivalent to specifying +/pattern; that is, it tells less to start at the first occur- rence of pattern in the file. -Pprompt or --prompt=prompt Provides a way to tailor the three prompt styles to your own preference. This option would normally be put in the LESS envi- ronment variable, rather than being typed in with each less com- mand. Such an option must either be the last option in the LESS variable, or be terminated by a dollar sign. -Ps followed by a string changes the default (short) prompt to that string. -Pm changes the medium (-m) prompt. -PM changes the long (-M) prompt. -Ph changes the prompt for the help screen. -P= changes the message printed by the = command. -Pw changes the message printed while waiting for data (in the F command). All prompt strings consist of a sequence of letters and special escape sequences. See the section on PROMPTS for more details. -q or --quiet or --silent Causes moderately "quiet" operation: the terminal bell is not rung if an attempt is made to scroll past the end of the file or before the beginning of the file. If the terminal has a "visual bell", it is used instead. The bell will be rung on certain other errors, such as typing an invalid character. The default is to ring the terminal bell in all such cases. -Q or --QUIET or --SILENT Causes totally "quiet" operation: the terminal bell is never rung. -r or --raw-control-chars Causes "raw" control characters to be displayed. The default is to display control characters using the caret notation; for example, a control-A (octal 001) is displayed as "^A". Warning: when the -r option is used, less cannot keep track of the actual appearance of the screen (since this depends on how the screen responds to each type of control character). Thus, various dis- play problems may result, such as long lines being split in the wrong place. -R or --RAW-CONTROL-CHARS Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained cor- rectly in most cases. ANSI "color" escape sequences are sequences of the form: ESC [ ... m where the "..." is zero or more color specification characters For the purpose of keeping track of screen appearance, ANSI color escape sequences are assumed to not move the cursor. You can make less think that characters other than "m" can end ANSI color escape sequences by setting the environment variable LESSANSIENDCHARS to the list of characters which can end a color escape sequence. And you can make less think that characters other than the standard ones may appear between the ESC and the m by setting the environment variable LESSANSIMIDCHARS to the list of characters which can appear. -s or --squeeze-blank-lines Causes consecutive blank lines to be squeezed into a single blank line. This is useful when viewing nroff output. -S or --chop-long-lines Causes lines longer than the screen width to be chopped rather than folded. That is, the portion of a long line that does not fit in the screen width is not shown. The default is to fold long lines; that is, display the remainder on the next line. -ttag or --tag=tag The -t option, followed immediately by a TAG, will edit the file containing that tag. For this to work, tag information must be available; for example, there may be a file in the current directory called "tags", which was previously built by ctags (1) or an equivalent command. If the environment variable LESSGLOB- ALTAGS is set, it is taken to be the name of a command compati- ble with global (1), and that command is executed to find the tag. (See http://www.gnu.org/software/global/global.html). The -t option may also be specified from within less (using the - command) as a way of examining a new file. The command ":t" is equivalent to specifying -t from within less. -Ttagsfile or --tag-file=tagsfile Specifies a tags file to be used instead of "tags". -u or --underline-special Causes backspaces and carriage returns to be treated as print- able characters; that is, they are sent to the terminal when they appear in the input. -U or --UNDERLINE-SPECIAL Causes backspaces, tabs and carriage returns to be treated as control characters; that is, they are handled as specified by the -r option. By default, if neither -u nor -U is given, backspaces which appear adjacent to an underscore character are treated spe- cially: the underlined text is displayed using the terminal's hardware underlining capability. Also, backspaces which appear between two identical characters are treated specially: the overstruck text is printed using the terminal's hardware bold- face capability. Other backspaces are deleted, along with the preceding character. Carriage returns immediately followed by a newline are deleted. other carriage returns are handled as specified by the -r option. Text which is overstruck or under- lined can be searched for if neither -u nor -U is in effect. -V or --version Displays the version number of less. -w or --hilite-unread Temporarily highlights the first "new" line after a forward movement of a full page. The first "new" line is the line imme- diately following the line previously at the bottom of the screen. Also highlights the target line after a g or p command. The highlight is removed at the next command which causes move- ment. The entire line is highlighted, unless the -J option is in effect, in which case only the status column is highlighted. -W or --HILITE-UNREAD Like -w, but temporarily highlights the first new line after any forward movement command larger than one line. -xn,... or --tabs=n,... Sets tab stops. If only one n is specified, tab stops are set at multiples of n. If multiple values separated by commas are specified, tab stops are set at those positions, and then continue with the same spacing as the last two. For example, -x9,17 will set tabs at positions 9, 17, 25, 33, etc. The default for n is 8. -X or --no-init Disables sending the termcap initialization and deinitialization strings to the terminal. This is sometimes desirable if the deinitialization string does something unnecessary, like clear- ing the screen. --no-keypad Disables sending the keypad initialization and deinitialization strings to the terminal. This is sometimes useful if the keypad strings make the numeric keypad behave in an undesirable manner. -yn or --max-forw-scroll=n Specifies a maximum number of lines to scroll forward. If it is necessary to scroll forward more than n lines, the screen is repainted instead. The -c or -C option may be used to repaint from the top of the screen if desired. By default, any forward movement causes scrolling. -[z]n or --window=n Changes the default scrolling window size to n lines. The default is one screenful. The z and w commands can also be used to change the window size. The "z" may be omitted for compati- bility with some versions of more. If the number n is negative, it indicates n lines less than the current screen size. For example, if the screen is 24 lines, -z-4 sets the scrolling win- dow to 20 lines. If the screen is resized to 40 lines, the scrolling window automatically changes to 36 lines. -"cc or --quotes=cc Changes the filename quoting character. This may be necessary if you are trying to name a file which contains both spaces and quote characters. Followed by a single character, this changes the quote character to that character. Filenames containing a space should then be surrounded by that character rather than by double quotes. Followed by two characters, changes the open quote to the first character, and the close quote to the second character. Filenames containing a space should then be preceded by the open quote character and followed by the close quote character. Note that even after the quote characters are changed, this option remains -" (a dash followed by a double quote). -~ or --tilde Normally lines after end of file are displayed as a single tilde (~). This option causes lines after end of file to be displayed as blank lines. -# or --shift Specifies the default number of positions to scroll horizontally in the RIGHTARROW and LEFTARROW commands. If the number speci- fied is zero, it sets the default number of positions to one half of the screen width. -- A command line argument of "--" marks the end of option argu- ments. Any arguments following this are interpreted as file- names. This can be useful when viewing a file whose name begins with a "-" or "+". + If a command line option begins with +, the remainder of that option is taken to be an initial command to less. For example, +G tells less to start at the end of the file rather than the beginning, and +/xyz tells it to start at the first occurrence of "xyz" in the file. As a special case, + acts like +g; that is, it starts the display at the specified line number (however, see the caveat under the "g" command above). If the option starts with ++, the initial command applies to every file being viewed, not just the first one. The + command described previously may also be used to set (or change) an ini- tial command for every file. LINE EDITING When entering command line at the bottom of the screen (for example, a filename for the :e command, or the pattern for a search command), cer- tain keys can be used to manipulate the command line. Most commands have an alternate form in [ brackets ] which can be used if a key does not exist on a particular keyboard. (The bracketed forms do not work in the MS-DOS version.) Any of these special keys may be entered lit- erally by preceding it with the "literal" character, either ^V or ^A. A backslash itself may also be entered literally by entering two back- slashes. LEFTARROW [ ESC-h ] Move the cursor one space to the left. RIGHTARROW [ ESC-l ] Move the cursor one space to the right. ^LEFTARROW [ ESC-b or ESC-LEFTARROW ] (That is, CONTROL and LEFTARROW simultaneously.) Move the cur- sor one word to the left. ^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ] (That is, CONTROL and RIGHTARROW simultaneously.) Move the cur- sor one word to the right. HOME [ ESC-0 ] Move the cursor to the beginning of the line. END [ ESC-$ ] Move the cursor to the end of the line. BACKSPACE Delete the character to the left of the cursor, or cancel the command if the command line is empty. DELETE or [ ESC-x ] Delete the character under the cursor. ^BACKSPACE [ ESC-BACKSPACE ] (That is, CONTROL and BACKSPACE simultaneously.) Delete the word to the left of the cursor. ^DELETE [ ESC-X or ESC-DELETE ] (That is, CONTROL and DELETE simultaneously.) Delete the word under the cursor. UPARROW [ ESC-k ] Retrieve the previous command line. DOWNARROW [ ESC-j ] Retrieve the next command line. TAB Complete the partial filename to the left of the cursor. If it matches more than one filename, the first match is entered into the command line. Repeated TABs will cycle thru the other matching filenames. If the completed filename is a directory, a "/" is appended to the filename. (On MS-DOS systems, a "\" is appended.) The environment variable LESSSEPARATOR can be used to specify a different character to append to a directory name. BACKTAB [ ESC-TAB ] Like, TAB, but cycles in the reverse direction thru the matching filenames. ^L Complete the partial filename to the left of the cursor. If it matches more than one filename, all matches are entered into the command line (if they fit). ^U (Unix and OS/2) or ESC (MS-DOS) Delete the entire command line, or cancel the command if the command line is empty. If you have changed your line-kill char- acter in Unix to something other than ^U, that character is used instead of ^U. KEY BINDINGS You may define your own less commands by using the program lesskey (1) to create a lesskey file. This file specifies a set of command keys and an action associated with each key. You may also use lesskey to change the line-editing keys (see LINE EDITING), and to set environment variables. If the environment variable LESSKEY is set, less uses that as the name of the lesskey file. Otherwise, less looks in a standard place for the lesskey file: On Unix systems, less looks for a lesskey file called "$HOME/.less". On MS-DOS and Windows systems, less looks for a lesskey file called "$HOME/_less", and if it is not found there, then looks for a lesskey file called "_less" in any directory specified in the PATH environment variable. On OS/2 systems, less looks for a lesskey file called "$HOME/less.ini", and if it is not found, then looks for a lesskey file called "less.ini" in any directory specified in the INIT environment variable, and if it not found there, then looks for a lesskey file called "less.ini" in any directory specified in the PATH environment variable. See the lesskey manual page for more details. A system-wide lesskey file may also be set up to provide key bindings. If a key is defined in both a local lesskey file and in the system-wide file, key bindings in the local file take precedence over those in the system-wide file. If the environment variable LESSKEY_SYSTEM is set, less uses that as the name of the system-wide lesskey file. Otherwise, less looks in a standard place for the system-wide lesskey file: On Unix systems, the system-wide lesskey file is /usr/local/etc/sysless. (However, if less was built with a different sysconf directory than /usr/local/etc, that directory is where the sysless file is found.) On MS-DOS and Windows systems, the system-wide lesskey file is c:\_sys- less. On OS/2 systems, the system-wide lesskey file is c:\sysless.ini. INPUT PREPROCESSOR You may define an "input preprocessor" for less. Before less opens a file, it first gives your input preprocessor a chance to modify the way the contents of the file are displayed. An input preprocessor is sim- ply an executable program (or shell script), which writes the contents of the file to a different file, called the replacement file. The con- tents of the replacement file are then displayed in place of the con- tents of the original file. However, it will appear to the user as if the original file is opened; that is, less will display the original filename as the name of the current file. An input preprocessor receives one command line argument, the original filename, as entered by the user. It should create the replacement file, and when finished, print the name of the replacement file to its standard output. If the input preprocessor does not output a replace- ment filename, less uses the original file, as normal. The input pre- processor is not called when viewing standard input. To set up an input preprocessor, set the LESSOPEN environment variable to a command line which will invoke your input preprocessor. This command line should include one occurrence of the string "%s", which will be replaced by the filename when the input preprocessor command is invoked. When less closes a file opened in such a way, it will call another pro- gram, called the input postprocessor, which may perform any desired clean-up action (such as deleting the replacement file created by LESSOPEN). This program receives two command line arguments, the orig- inal filename as entered by the user, and the name of the replacement file. To set up an input postprocessor, set the LESSCLOSE environment variable to a command line which will invoke your input postprocessor. It may include two occurrences of the string "%s"; the first is replaced with the original name of the file and the second with the name of the replacement file, which was output by LESSOPEN. For example, on many Unix systems, these two scripts will allow you to keep files in compressed format, but still let less view them directly: lessopen.sh: #! /bin/sh case "$1" in *.Z) uncompress - if [ -s /tmp/less.$$ ]; then echo /tmp/less.$$ else rm -f /tmp/less.$$ fi ;; esac lessclose.sh: #! /bin/sh rm $2 To use these scripts, put them both where they can be executed and set LESSOPEN="lessopen.sh %s", and LESSCLOSE="lessclose.sh %s %s". More complex LESSOPEN and LESSCLOSE scripts may be written to accept other types of compressed files, and so on. It is also possible to set up an input preprocessor to pipe the file data directly to less, rather than putting the data into a replacement file. This avoids the need to decompress the entire file before start- ing to view it. An input preprocessor that works this way is called an input pipe. An input pipe, instead of writing the name of a replace- ment file on its standard output, writes the entire contents of the replacement file on its standard output. If the input pipe does not write any characters on its standard output, then there is no replace- ment file and less uses the original file, as normal. To use an input pipe, make the first character in the LESSOPEN environment variable a vertical bar (|) to signify that the input preprocessor is an input pipe. For example, on many Unix systems, this script will work like the pre- vious example scripts: lesspipe.sh: #! /bin/sh case "$1" in *.Z) uncompress -c $1 2>/dev/null ;; esac To use this script, put it where it can be executed and set LESSOPEN="|lesspipe.sh %s". When an input pipe is used, a LESSCLOSE postprocessor can be used, but it is usually not necessary since there is no replacement file to clean up. In this case, the replacement file name passed to the LESSCLOSE postprocessor is "-". NATIONAL CHARACTER SETS There are three types of characters in the input file: normal characters can be displayed directly to the screen. control characters should not be displayed directly, but are expected to be found in ordinary text files (such as backspace and tab). binary characters should not be displayed directly and are not expected to be found in text files. A "character set" is simply a description of which characters are to be considered normal, control, and binary. The LESSCHARSET environment variable may be used to select a character set. Possible values for LESSCHARSET are: ascii BS, TAB, NL, CR, and formfeed are control characters, all chars with values between 32 and 126 are normal, and all others are binary. iso8859 Selects an ISO 8859 character set. This is the same as ASCII, except characters between 160 and 255 are treated as normal characters. latin1 Same as iso8859. latin9 Same as iso8859. dos Selects a character set appropriate for MS-DOS. ebcdic Selects an EBCDIC character set. IBM-1047 Selects an EBCDIC character set used by OS/390 Unix Services. This is the EBCDIC analogue of latin1. You get similar results by setting either LESSCHARSET=IBM-1047 or LC_CTYPE=en_US in your environment. koi8-r Selects a Russian character set. next Selects a character set appropriate for NeXT computers. utf-8 Selects the UTF-8 encoding of the ISO 10646 character set. UTF-8 is special in that it supports multi-byte characters in the input file. It is the only character set that supports multi-byte characters. windows Selects a character set appropriate for Microsoft Windows (cp 1251). In special cases, it may be desired to tailor less to use a character set other than the ones definable by LESSCHARSET. In this case, the environment variable LESSCHARDEF can be used to define a character set. It should be set to a string where each character in the string repre- sents one character in the character set. The character "." is used for a normal character, "c" for control, and "b" for binary. A decimal number may be used for repetition. For example, "bccc4b." would mean character 0 is binary, 1, 2 and 3 are control, 4, 5, 6 and 7 are binary, and 8 is normal. All characters after the last are taken to be the same as the last, so characters 9 through 255 would be normal. (This is an example, and does not necessarily represent any real char- acter set.) This table shows the value of LESSCHARDEF which is equivalent to each of the possible values for LESSCHARSET: ascii 8bcccbcc18b95.b dos 8bcccbcc12bc5b95.b. ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b 9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b. IBM-1047 4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc 191.b iso8859 8bcccbcc18b95.33b. koi8-r 8bcccbcc18b95.b128. latin1 8bcccbcc18b95.33b. next 8bcccbcc18b95.bb125.bb If neither LESSCHARSET nor LESSCHARDEF is set, but any of the strings "UTF-8", "UTF8", "utf-8" or "utf8" is found in the LC_ALL, LC_TYPE or LANG environment variables, then the default character set is utf-8. If that string is not found, but your system supports the setlocale interface, less will use setlocale to determine the character set. setlocale is controlled by setting the LANG or LC_CTYPE environment variables. Finally, if the setlocale interface is also not available, the default character set is latin1. Control and binary characters are displayed in standout (reverse video). Each such character is displayed in caret notation if possible (e.g. ^A for control-A). Caret notation is used only if inverting the 0100 bit results in a normal printable character. Otherwise, the char- acter is displayed as a hex number in angle brackets. This format can be changed by setting the LESSBINFMT environment variable. LESSBINFMT may begin with a "*" and one character to select the display attribute: "*k" is blinking, "*d" is bold, "*u" is underlined, "*s" is standout, and "*n" is normal. If LESSBINFMT does not begin with a "*", normal attribute is assumed. The remainder of LESSBINFMT is a string which may include one printf-style escape sequence (a % followed by x, X, o, d, etc.). For example, if LESSBINFMT is "*u[%x]", binary characters are displayed in underlined hexadecimal surrounded by brackets. The default if no LESSBINFMT is specified is "*s<%X>". The default if no LESSBINFMT is specified is "*s<%02X>". Warning: the result of expand- ing the character via LESSBINFMT must be less than 31 characters. When the character set is utf-8, the LESSUTFBINFMT environment variable acts similarly to LESSBINFMT but it applies to Unicode code points that were successfully decoded but are unsuitable for display (e.g., unas- signed code points). Its default value is "". Note that LESSUTFBINFMT and LESSBINFMT share their display attribute setting ("*x") so specifying one will affect both; LESSUTFBINFMT is read after LESSBINFMT so its setting, if any, will have priority. Problematic octets in a UTF-8 file (octets of a truncated sequence, octets of a complete but non-shortest form sequence, illegal octets, and stray trailing octets) are displayed individually using LESSBINFMT so as to facilitate diagnostic of how the UTF-8 file is ill-formed. PROMPTS The -P option allows you to tailor the prompt to your preference. The string given to the -P option replaces the specified prompt string. Certain characters in the string are interpreted specially. The prompt mechanism is rather complicated to provide flexibility, but the ordi- nary user need not understand the details of constructing personalized prompt strings. A percent sign followed by a single character is expanded according to what the following character is: %bX Replaced by the byte offset into the current input file. The b is followed by a single character (shown as X above) which spec- ifies the line whose byte offset is to be used. If the charac- ter is a "t", the byte offset of the top line in the display is used, an "m" means use the middle line, a "b" means use the bot- tom line, a "B" means use the line just after the bottom line, and a "j" means use the "target" line, as specified by the -j option. %B Replaced by the size of the current input file. %c Replaced by the column number of the text appearing in the first column of the screen. %dX Replaced by the page number of a line in the input file. The line to be used is determined by the X, as with the %b option. %D Replaced by the number of pages in the input file, or equiva- lently, the page number of the last line in the input file. %E Replaced by the name of the editor (from the VISUAL environment variable, or the EDITOR environment variable if VISUAL is not defined). See the discussion of the LESSEDIT feature below. %f Replaced by the name of the current input file. %i Replaced by the index of the current file in the list of input files. %lX Replaced by the line number of a line in the input file. The line to be used is determined by the X, as with the %b option. %L Replaced by the line number of the last line in the input file. %m Replaced by the total number of input files. %pX Replaced by the percent into the current input file, based on byte offsets. The line used is determined by the X as with the %b option. %PX Replaced by the percent into the current input file, based on line numbers. The line used is determined by the X as with the %b option. %s Same as %B. %t Causes any trailing spaces to be removed. Usually used at the end of the string, but may appear anywhere. %x Replaced by the name of the next input file in the list. If any item is unknown (for example, the file size if input is a pipe), a question mark is printed instead. The format of the prompt string can be changed depending on certain conditions. A question mark followed by a single character acts like an "IF": depending on the following character, a condition is evalu- ated. If the condition is true, any characters following the question mark and condition character, up to a period, are included in the prompt. If the condition is false, such characters are not included. A colon appearing between the question mark and the period can be used to establish an "ELSE": any characters between the colon and the period are included in the string if and only if the IF condition is false. Condition characters (which follow a question mark) may be: ?a True if any characters have been included in the prompt so far. ?bX True if the byte offset of the specified line is known. ?B True if the size of current input file is known. ?c True if the text is horizontally shifted (%c is not zero). ?dX True if the page number of the specified line is known. ?e True if at end-of-file. ?f True if there is an input filename (that is, if input is not a pipe). ?lX True if the line number of the specified line is known. ?L True if the line number of the last line in the file is known. ?m True if there is more than one input file. ?n True if this is the first prompt in a new input file. ?pX True if the percent into the current input file, based on byte offsets, of the specified line is known. ?PX True if the percent into the current input file, based on line numbers, of the specified line is known. ?s Same as "?B". ?x True if there is a next input file (that is, if the current input file is not the last one). Any characters other than the special ones (question mark, colon, period, percent, and backslash) become literally part of the prompt. Any of the special characters may be included in the prompt literally by preceding it with a backslash. Some examples: ?f%f:Standard input. This prompt prints the filename, if known; otherwise the string "Stan- dard input". ?f%f .?ltLine %lt:?pt%pt\%:?btByte %bt:-... This prompt would print the filename, if known. The filename is fol- lowed by the line number, if known, otherwise the percent if known, otherwise the byte offset if known. Otherwise, a dash is printed. Notice how each question mark has a matching period, and how the % after the %pt is included literally by escaping it with a backslash. ?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x..%t This prints the filename if this is the first prompt in a file, fol- lowed by the "file N of N" message if there is more than one input file. Then, if we are at end-of-file, the string "(END)" is printed followed by the name of the next file, if there is one. Finally, any trailing spaces are truncated. This is the default prompt. For refer- ence, here are the defaults for the other two prompts (-m and -M respectively). Each is broken into two lines here for readability only. ?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x.: ?pB%pB\%:byte %bB?s/%s...%t ?f%f .?n?m(file %i of %m) ..?ltlines %lt-%lb?L/%L. : byte %bB?s/%s. .?e(END) ?x- Next\: %x.:?pB%pB\%..%t And here is the default message produced by the = command: ?f%f .?m(file %i of %m) .?ltlines %lt-%lb?L/%L. . byte %bB?s/%s. ?e(END) :?pB%pB\%..%t The prompt expansion features are also used for another purpose: if an environment variable LESSEDIT is defined, it is used as the command to be executed when the v command is invoked. The LESSEDIT string is expanded in the same way as the prompt strings. The default value for LESSEDIT is: %E ?lm+%lm. %f Note that this expands to the editor name, followed by a + and the line number, followed by the file name. If your editor does not accept the "+linenumber" syntax, or has other differences in invocation syntax, the LESSEDIT variable can be changed to modify this default. SECURITY When the environment variable LESSSECURE is set to 1, less runs in a "secure" mode. This means these features are disabled: ! the shell command | the pipe command :e the examine command. v the editing command s -o log files -k use of lesskey files -t use of tags files metacharacters in filenames, such as * filename completion (TAB, ^L) Less can also be compiled to be permanently in "secure" mode. COMPATIBILITY WITH MORE If the environment variable LESS_IS_MORE is set to 1, or if the program is invoked via a file link named "more", less behaves (mostly) in con- formance with the POSIX "more" command specification. In this mode, less behaves differently in these ways: The -e option works differently. If the -e option is not set, less behaves as if the -E option were set. If the -e option is set, less behaves as if the -e and -F options were set. The -m option works differently. If the -m option is not set, the medium prompt is used, and it is prefixed with the string "--More--". If the -m option is set, the short prompt is used. The -n option acts like the -z option. The normal behavior of the -n option is unavailable in this mode. The parameter to the -p option is taken to be a less command rather than a search pattern. The LESS environment variable is ignored, and the MORE environment variable is used in its place. ENVIRONMENT VARIABLES Environment variables may be specified either in the system environment as usual, or in a lesskey (1) file. If environment variables are defined in more than one place, variables defined in a local lesskey file take precedence over variables defined in the system environment, which take precedence over variables defined in the system-wide lesskey file. COLUMNS Sets the number of columns on the screen. Takes precedence over the number of columns specified by the TERM variable. (But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD, the window system's idea of the screen size takes precedence over the LINES and COLUMNS environment variables.) EDITOR The name of the editor (used for the v command). HOME Name of the user's home directory (used to find a lesskey file on Unix and OS/2 systems). HOMEDRIVE, HOMEPATH Concatenation of the HOMEDRIVE and HOMEPATH environment vari- ables is the name of the user's home directory if the HOME vari- able is not set (only in the Windows version). INIT Name of the user's init directory (used to find a lesskey file on OS/2 systems). LANG Language for determining the character set. LC_CTYPE Language for determining the character set. LESS Options which are passed to less automatically. LESSANSIENDCHARS Characters which may end an ANSI color escape sequence (default "m"). LESSANSIMIDCHARS Characters which may appear between the ESC character and the end character in an ANSI color escape sequence (default "0123456789;[?!"'#%()*+ ". LESSBINFMT Format for displaying non-printable, non-control characters. LESSCHARDEF Defines a character set. LESSCHARSET Selects a predefined character set. LESSCLOSE Command line to invoke the (optional) input-postprocessor. LESSECHO Name of the lessecho program (default "lessecho"). The lessecho program is needed to expand metacharacters, such as * and ?, in filenames on Unix systems. LESSEDIT Editor prototype string (used for the v command). See discus- sion under PROMPTS. LESSGLOBALTAGS Name of the command used by the -t option to find global tags. Normally should be set to "global" if your system has the global (1) command. If not set, global tags are not used. LESSHISTFILE Name of the history file used to remember search commands and shell commands between invocations of less. If set to "-" or "/dev/null", a history file is not used. The default is "$HOME/.lesshst" on Unix systems, "$HOME/_lesshst" on DOS and Windows systems, or "$HOME/lesshst.ini" or "$INIT/lesshst.ini" on OS/2 systems. LESSHISTSIZE The maximum number of commands to save in the history file. The default is 100. LESSKEY Name of the default lesskey(1) file. LESSKEY_SYSTEM Name of the default system-wide lesskey(1) file. LESSMETACHARS List of characters which are considered "metacharacters" by the shell. LESSMETAESCAPE Prefix which less will add before each metacharacter in a com- mand sent to the shell. If LESSMETAESCAPE is an empty string, commands containing metacharacters will not be passed to the shell. LESSOPEN Command line to invoke the (optional) input-preprocessor. LESSSECURE Runs less in "secure" mode. See discussion under SECURITY. LESSSEPARATOR String to be appended to a directory name in filename comple- tion. LESSUTFBINFMT Format for displaying non-printable Unicode code points. LESS_IS_MORE Emulate the more (1) command. LINES Sets the number of lines on the screen. Takes precedence over the number of lines specified by the TERM variable. (But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD, the window system's idea of the screen size takes precedence over the LINES and COLUMNS environment variables.) PATH User's search path (used to find a lesskey file on MS-DOS and OS/2 systems). SHELL The shell used to execute the ! command, as well as to expand filenames. TERM The type of terminal on which less is being run. VISUAL The name of the editor (used for the v command). SEE ALSO lesskey(1) WARNINGS The = command and prompts (unless changed by -P) report the line num- bers of the lines at the top and bottom of the screen, but the byte and percent of the line after the one at the bottom of the screen. On certain older terminals (the so-called "magic cookie" terminals), search highlighting will cause an erroneous display. On such termi- nals, search highlighting is disabled by default to avoid possible problems. When searching in a binary file, text which follows a null byte may not be found. This problem does not occur when searching with regular expressions turned off via ^R, and also does not occur when less is compiled to use the PCRE regular expression library. In certain cases, when search highlighting is enabled and a search pat- tern begins with a ^, more text than the matching string may be high- lighted. (This problem does not occur when less is compiled to use the POSIX regular expression package.) On some systems, setlocale claims that ASCII characters 0 thru 31 are control characters rather than binary characters. This causes less to treat some binary files as ordinary, non-binary files. To workaround this problem, set the environment variable LESSCHARSET to "ascii" (or whatever character set is appropriate). This manual is too long. See http://www.greenwoodsoftware.com/less for the latest list of known bugs in less. COPYRIGHT Copyright (C) 1984-2007 Mark Nudelman less is part of the GNU project and is free software. You can redis- tribute it and/or modify it under the terms of either (1) the GNU Gen- eral Public License as published by the Free Software Foundation; or (2) the Less License. See the file README in the less distribution for more details regarding redistribution. You should have received a copy of the GNU General Public License along with the source for less; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. You should also have received a copy of the Less License; see the file LICENSE. less is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FIT- NESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. AUTHOR Mark Nudelman Send bug reports or comments to the above address or to bug-less@gnu.org. For more information, see the less homepage at http://www.greenwoodsoftware.com/less. - Version 408: 01 Oct 2007 LESS(1) + Version 409: 12 Oct 2007 LESS(1) Index: vendor/less/dist/contrib/less/less.nro =================================================================== --- vendor/less/dist/contrib/less/less.nro (revision 172596) +++ vendor/less/dist/contrib/less/less.nro (revision 172597) @@ -1,1676 +1,1676 @@ -.TH LESS 1 "Version 408: 01 Oct 2007" +.TH LESS 1 "Version 409: 12 Oct 2007" .SH NAME less \- opposite of more .SH SYNOPSIS .B "less \-?" .br .B "less \-\-help" .br .B "less \-V" .br .B "less \-\-version" .br .B "less [\-[+]aBcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX~]" .br .B " [\-b \fIspace\fP] [\-h \fIlines\fP] [\-j \fIline\fP] [\-k \fIkeyfile\fP]" .br .B " [\-{oO} \fIlogfile\fP] [\-p \fIpattern\fP] [\-P \fIprompt\fP] [\-t \fItag\fP]" .br .B " [\-T \fItagsfile\fP] [\-x \fItab\fP,...] [\-y \fIlines\fP] [\-[z] \fIlines\fP]" .br .B " [\-# \fIshift\fP] [+[+]\fIcmd\fP] [\-\-] [\fIfilename\fP]..." .br (See the OPTIONS section for alternate option syntax with long option names.) .SH DESCRIPTION .I Less is a program similar to .I more (1), but which allows backward movement in the file as well as forward movement. Also, .I less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like .I vi (1). .I Less uses termcap (or terminfo on some systems), so it can run on a variety of terminals. There is even limited support for hardcopy terminals. (On a hardcopy terminal, lines which should be printed at the top of the screen are prefixed with a caret.) .PP Commands are based on both .I more and .I vi. Commands may be preceded by a decimal number, called N in the descriptions below. The number is used by some commands, as indicated. .SH COMMANDS In the following descriptions, ^X means control-X. ESC stands for the ESCAPE key; for example ESC-v means the two character sequence "ESCAPE", then "v". .IP "h or H" Help: display a summary of these commands. If you forget all the other commands, remember this one. .IP "SPACE or ^V or f or ^F" Scroll forward N lines, default one window (see option \-z below). If N is more than the screen size, only the final screenful is displayed. Warning: some systems use ^V as a special literalization character. .IP "z" Like SPACE, but if N is specified, it becomes the new window size. .IP "ESC-SPACE" Like SPACE, but scrolls a full screenful, even if it reaches end-of-file in the process. .IP "RETURN or ^N or e or ^E or j or ^J" Scroll forward N lines, default 1. The entire N lines are displayed, even if N is more than the screen size. .IP "d or ^D" Scroll forward N lines, default one half of the screen size. If N is specified, it becomes the new default for subsequent d and u commands. .IP "b or ^B or ESC-v" Scroll backward N lines, default one window (see option \-z below). If N is more than the screen size, only the final screenful is displayed. .IP "w" Like ESC-v, but if N is specified, it becomes the new window size. .IP "y or ^Y or ^P or k or ^K" Scroll backward N lines, default 1. The entire N lines are displayed, even if N is more than the screen size. Warning: some systems use ^Y as a special job control character. .IP "u or ^U" Scroll backward N lines, default one half of the screen size. If N is specified, it becomes the new default for subsequent d and u commands. .IP "ESC-) or RIGHTARROW" Scroll horizontally right N characters, default half the screen width (see the \-# option). If a number N is specified, it becomes the default for future RIGHTARROW and LEFTARROW commands. While the text is scrolled, it acts as though the \-S option (chop lines) were in effect. .IP "ESC-( or LEFTARROW" Scroll horizontally left N characters, default half the screen width (see the \-# option). If a number N is specified, it becomes the default for future RIGHTARROW and LEFTARROW commands. .IP "r or ^R or ^L" Repaint the screen. .IP R Repaint the screen, discarding any buffered input. Useful if the file is changing while it is being viewed. .IP "F" Scroll forward, and keep trying to read when the end of file is reached. Normally this command would be used when already at the end of the file. It is a way to monitor the tail of a file which is growing while it is being viewed. (The behavior is similar to the "tail \-f" command.) .IP "g or < or ESC-<" Go to line N in the file, default 1 (beginning of file). (Warning: this may be slow if N is large.) .IP "G or > or ESC->" Go to line N in the file, default the end of the file. (Warning: this may be slow if N is large, or if N is not specified and standard input, rather than a file, is being read.) .IP "p or %" Go to a position N percent into the file. N should be between 0 and 100, and may contain a decimal point. .IP "P" Go to the line containing byte offset N in the file. .IP "{" If a left curly bracket appears in the top line displayed on the screen, the { command will go to the matching right curly bracket. The matching right curly bracket is positioned on the bottom line of the screen. If there is more than one left curly bracket on the top line, a number N may be used to specify the N-th bracket on the line. .IP "}" If a right curly bracket appears in the bottom line displayed on the screen, the } command will go to the matching left curly bracket. The matching left curly bracket is positioned on the top line of the screen. If there is more than one right curly bracket on the top line, a number N may be used to specify the N-th bracket on the line. .IP "(" Like {, but applies to parentheses rather than curly brackets. .IP ")" Like }, but applies to parentheses rather than curly brackets. .IP "[" Like {, but applies to square brackets rather than curly brackets. .IP "]" Like }, but applies to square brackets rather than curly brackets. .IP "ESC-^F" Followed by two characters, acts like {, but uses the two characters as open and close brackets, respectively. For example, "ESC ^F < >" could be used to go forward to the > which matches the < in the top displayed line. .IP "ESC-^B" Followed by two characters, acts like }, but uses the two characters as open and close brackets, respectively. For example, "ESC ^B < >" could be used to go backward to the < which matches the > in the bottom displayed line. .IP m Followed by any lowercase letter, marks the current position with that letter. .IP "'" (Single quote.) Followed by any lowercase letter, returns to the position which was previously marked with that letter. Followed by another single quote, returns to the position at which the last "large" movement command was executed. Followed by a ^ or $, jumps to the beginning or end of the file respectively. Marks are preserved when a new file is examined, so the ' command can be used to switch between input files. .IP "^X^X" Same as single quote. .IP /pattern Search forward in the file for the N-th line containing the pattern. N defaults to 1. The pattern is a regular expression, as recognized by the regular expression library supplied by your system. The search starts at the second line displayed (but see the \-a and \-j options, which change this). .sp 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 "^N or !" Search for lines which do NOT match the pattern. .IP "^E or *" Search multiple files. 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 "^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 "^K" Highlight any text which matches the pattern on the current screen, but don't move to the first match (KEEP current position). .IP "^R" Don't interpret regular expression metacharacters; that is, do a simple textual comparison. .RE .IP ?pattern Search backward in the file for the N-th line containing the pattern. The search starts at the line immediately before the top line displayed. .sp Certain characters are special as in the / command: .RS .IP "^N or !" Search for lines which do NOT match the pattern. .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 "^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" As in forward searches. .IP "^R" As in forward searches. .RE .IP "ESC-/pattern" Same as "/*". .IP "ESC-?pattern" Same as "?*". .IP n Repeat previous search, for N-th line containing the last pattern. If the previous search was modified by ^N, the search is made for the N-th line NOT containing the pattern. If the previous search was modified by ^E, the search continues in the next (or previous) file if not satisfied in the current file. If the previous search was modified by ^R, the search is done without using regular expressions. There is no effect if the previous search was modified by ^F or ^K. .IP N Repeat previous search, but in the reverse direction. .IP "ESC-n" Repeat previous search, but crossing file boundaries. The effect is as if the previous search were modified by *. .IP "ESC-N" Repeat previous search, but in the reverse direction and crossing file boundaries. .IP "ESC-u" Undo search highlighting. Turn off highlighting of strings matching the current search pattern. If highlighting is already off because of a previous ESC-u command, turn highlighting back on. Any search command will also turn highlighting back on. (Highlighting can also be disabled by toggling the \-G option; in that case search commands do not turn highlighting back on.) .IP ":e [filename]" Examine a new file. If the filename is missing, the "current" file (see the :n and :p commands below) from the list of files in the command line is re-examined. A percent sign (%) in the filename is replaced by the name of the current file. A pound sign (#) is replaced by the name of the previously examined file. However, two consecutive percent signs are simply replaced with a single percent sign. This allows you to enter a filename that contains a percent sign in the name. Similarly, two consecutive pound signs are replaced with a single pound sign. The filename is inserted into the command line list of files so that it can be seen by subsequent :n and :p commands. If the filename consists of several files, they are all inserted into the list of files and the first one is examined. If the filename contains one or more spaces, the entire filename should be enclosed in double quotes (also see the \-" option). .IP "^X^V or E" Same as :e. Warning: some systems use ^V as a special literalization character. On such systems, you may not be able to use ^V. .IP ":n" Examine the next file (from the list of files given in the command line). If a number N is specified, the N-th next file is examined. .IP ":p" Examine the previous file in the command line list. If a number N is specified, the N-th previous file is examined. .IP ":x" Examine the first file in the command line list. If a number N is specified, the N-th file in the list is examined. .IP ":d" Remove the current file from the list of files. .IP "t" Go to the next tag, if there were more than one matches for the current tag. See the \-t option for more details about tags. .IP "T" Go to the previous tag, if there were more than one matches for the current tag. .IP "= or ^G or :f" Prints some information about the file being viewed, including its name and the line number and byte offset of the bottom line being displayed. If possible, it also prints the length of the file, the number of lines in the file and the percent of the file above the last displayed line. .IP \- Followed by one of the command line option letters (see OPTIONS below), this will change the setting of that option and print a message describing the new setting. If a ^P (CONTROL-P) is entered immediately after the dash, the setting of the option is changed but no message is printed. If the option letter has a numeric value (such as \-b or \-h), or a string value (such as \-P or \-t), a new value may be entered after the option letter. If no new value is entered, a message describing the current setting is printed and nothing is changed. .IP \-\- Like the \- command, but takes a long option name (see OPTIONS below) rather than a single option letter. You must press RETURN after typing the option name. A ^P immediately after the second dash suppresses printing of a message describing the new setting, as in the \- command. .IP \-+ Followed by one of the command line option letters this will reset the option to its default setting and print a message describing the new setting. (The "\-+\fIX\fP" command does the same thing as "\-+\fIX\fP" on the command line.) This does not work for string-valued options. .IP \-\-+ Like the \-+ command, but takes a long option name rather than a single option letter. .IP \-! Followed by one of the command line option letters, this will reset the option to the "opposite" of its default setting and print a message describing the new setting. This does not work for numeric or string-valued options. .IP \-\-! Like the \-! command, but takes a long option name rather than a single option letter. .IP _ (Underscore.) Followed by one of the command line option letters, this will print a message describing the current setting of that option. The setting of the option is not changed. .IP __ (Double underscore.) Like the _ (underscore) command, but takes a long option name rather than a single option letter. You must press RETURN after typing the option name. .IP +cmd Causes the specified cmd to be executed each time a new file is examined. For example, +G causes .I less to initially display each file starting at the end rather than the beginning. .IP V Prints the version number of .I less being run. .IP "q or Q or :q or :Q or ZZ" Exits .I less. .PP The following four commands may or may not be valid, depending on your particular installation. .PP .IP v Invokes an editor to edit the current file being viewed. The editor is taken from the environment variable VISUAL if defined, or EDITOR if VISUAL is not defined, or defaults to "vi" if neither VISUAL nor EDITOR is defined. See also the discussion of LESSEDIT under the section on PROMPTS below. .IP "! shell-command" Invokes a shell to run the shell-command given. A percent sign (%) in the command is replaced by the name of the current file. A pound sign (#) is replaced by the name of the previously examined file. "!!" repeats the last shell command. "!" with no shell command simply invokes a shell. On Unix systems, the shell is taken from the environment variable SHELL, or defaults to "sh". On MS-DOS and OS/2 systems, the shell is the normal command processor. .IP "| shell-command" represents any mark letter. Pipes a section of the input file to the given shell command. The section of the file to be piped is between the first line on the current screen and the position marked by the letter. may also be ^ or $ to indicate beginning or end of file respectively. If is . or newline, the current screen is piped. .IP "s filename" Save the input to a file. This only works if the input is a pipe, not an ordinary file. .PP .SH OPTIONS Command line options are described below. Most options may be changed while .I less is running, via the "\-" command. .PP Most options may be given in one of two forms: either a dash followed by a single letter, or two dashes followed by a long option name. A long option name may be abbreviated as long as the abbreviation is unambiguous. For example, \-\-quit-at-eof may be abbreviated \-\-quit, but not --qui, since both \-\-quit-at-eof and \-\-quiet begin with \-\-qui. Some long option names are in uppercase, such as \-\-QUIT-AT-EOF, as distinct from \-\-quit-at-eof. Such option names need only have their first letter capitalized; the remainder of the name may be in either case. For example, \-\-Quit-at-eof is equivalent to \-\-QUIT-AT-EOF. .PP Options are also taken from the environment variable "LESS". For example, to avoid typing "less \-options ..." each time .I less is invoked, you might tell .I csh: .sp setenv LESS "-options" .sp or if you use .I sh: .sp LESS="-options"; export LESS .sp On MS-DOS, you don't need the quotes, but you should replace any percent signs in the options string by double percent signs. .sp The environment variable is parsed before the command line, so command line options override the LESS environment variable. If an option appears in the LESS variable, it can be reset to its default value on the command line by beginning the command line option with "\-+". .sp For options like \-P or \-D which take a following string, a dollar sign ($) must be used to signal the end of the string. For example, to set two \-D options on MS-DOS, you must have a dollar sign between them, like this: .sp LESS="-Dn9.1$-Ds4.1" .sp .IP "\-? or \-\-help" This option displays a summary of the commands accepted by .I less (the same as the h command). (Depending on how your shell interprets the question mark, it may be necessary to quote the question mark, thus: "\-\e?".) .IP "\-a or \-\-search-skip-screen" Causes searches to start after the last line displayed on the screen, thus skipping all lines displayed on the screen. By default, searches start at the second line on the screen (or after the last found line; see the \-j option). .IP "\-b\fIn\fP or \-\-buffers=\fIn\fP" Specifies the amount of buffer space .I less will use for each file, in units of kilobytes (1024 bytes). By default 64K of buffer space is used for each file (unless the file is a pipe; see the \-B option). The \-b option specifies instead that \fIn\fP kilobytes of buffer space should be used for each file. If \fIn\fP is \-1, buffer space is unlimited; that is, the entire file is read into memory. .IP "\-B or \-\-auto-buffers" By default, when data is read from a pipe, buffers are allocated automatically as needed. If a large amount of data is read from the pipe, this can cause a large amount of memory to be allocated. The \-B option disables this automatic allocation of buffers for pipes, so that only 64K (or the amount of space specified by the \-b option) is used for the pipe. Warning: use of \-B can result in erroneous display, since only the most recently viewed part of the file is kept in memory; any earlier data is lost. .IP "\-c or \-\-clear-screen" Causes full screen repaints to be painted from the top line down. By default, full screen repaints are done by scrolling from the bottom of the screen. .IP "\-C or \-\-CLEAR-SCREEN" Same as \-c, for compatibility with older versions of .I less. .IP "\-d or \-\-dumb" The \-d option suppresses the error message normally displayed if the terminal is dumb; that is, lacks some important capability, such as the ability to clear the screen or scroll backward. The \-d option does not otherwise change the behavior of .I less on a dumb terminal. .IP "\-D\fBx\fP\fIcolor\fP or \-\-color=\fBx\fP\fIcolor\fP" [MS-DOS only] Sets the color of the text displayed. \fBx\fP is a single character which selects the type of text whose color is being set: n=normal, s=standout, d=bold, u=underlined, k=blink. \fIcolor\fP is a pair of numbers separated by a period. The first number selects the foreground color and the second selects the background color of the text. A single number \fIN\fP is the same as \fIN.0\fP. .IP "\-e or \-\-quit-at-eof" Causes .I less to automatically exit the second time it reaches end-of-file. By default, the only way to exit .I less is via the "q" command. .IP "\-E or \-\-QUIT-AT-EOF" Causes .I less to automatically exit the first time it reaches end-of-file. .IP "\-f or \-\-force" Forces non-regular files to be opened. (A non-regular file is a directory or a device special file.) Also suppresses the warning message when a binary file is opened. By default, .I less will refuse to open non-regular files. Note that some operating systems will not allow directories to be read, even if \-f is set. .IP "\-F or \-\-quit-if-one-screen" Causes .I less to automatically exit if the entire file can be displayed on the first screen. .IP "\-g or \-\-hilite-search" Normally, .I less will highlight ALL strings which match the last search command. The \-g option changes this behavior to highlight only the particular string which was found by the last search command. This can cause .I less to run somewhat faster than the default. .IP "\-G or \-\-HILITE-SEARCH" The \-G option suppresses all highlighting of strings found by search commands. .IP "\-h\fIn\fP or \-\-max-back-scroll=\fIn\fP" Specifies a maximum number of lines to scroll backward. If it is necessary to scroll backward more than \fIn\fP lines, the screen is repainted in a forward direction instead. (If the terminal does not have the ability to scroll backward, \-h0 is implied.) .IP "\-i or \-\-ignore-case" Causes searches to ignore case; that is, uppercase and lowercase are considered identical. This option is ignored if any uppercase letters appear in the search pattern; in other words, if a pattern contains uppercase letters, then that search does not ignore case. .IP "\-I or \-\-IGNORE-CASE" Like \-i, but searches ignore case even if the pattern contains uppercase letters. .IP "\-j\fIn\fP or \-\-jump-target=\fIn\fP" Specifies a line on the screen where the "target" line is to be positioned. A target line is the object of a text search, tag search, jump to a line number, jump to a file percentage, or jump to a marked position. The screen line may be specified by a number: the top line on the screen is 1, the next is 2, and so on. The number may be negative to specify a line relative to the bottom of the screen: the bottom line on the screen is \-1, the second to the bottom is \-2, and so on. Alternately, the screen line may be specified as a fraction of the height of the screen, starting with a decimal point: .5 is in the middle of the screen, .3 is three tenths down from the first line, and so on. If the line is specified as a fraction, the actual line number is recalculated if the terminal window is resized, so that the target line remains at the specified fraction of the screen height. If the \-j option is used, searches begin at the line immediately after the target line. For example, if "\-j4" is used, the target line is the fourth line on the screen, so searches begin at the fifth line on the screen. .IP "\-J or \-\-status-column" Displays a status column at the left edge of the screen. The status column shows the lines that matched the current search. The status column is also used if the \-w or \-W option is in effect. .IP "\-k\fIfilename\fP or \-\-lesskey-file=\fIfilename\fP" Causes .I less to open and interpret the named file as a .I lesskey (1) file. Multiple \-k options may be specified. If the LESSKEY or LESSKEY_SYSTEM environment variable is set, or if a lesskey file is found in a standard place (see KEY BINDINGS), it is also used as a .I lesskey file. .IP "\-K or \-\-quit-on-intr" Causes .I less to exit immediately when an interrupt character (usually ^C) is typed. Normally, an interrupt character causes .I less to stop whatever it is doing and return to its command prompt. .IP "\-L or \-\-no-lessopen" Ignore the LESSOPEN environment variable (see the INPUT PREPROCESSOR section below). This option can be set from within \fIless\fP, but it will apply only to files opened subsequently, not to the file which is currently open. .IP "\-m or \-\-long-prompt" Causes .I less to prompt verbosely (like \fImore\fP), with the percent into the file. By default, .I less prompts with a colon. .IP "\-M or \-\-LONG-PROMPT" Causes .I less to prompt even more verbosely than .I more. .IP "\-n or \-\-line-numbers" Suppresses line numbers. The default (to use line numbers) may cause .I less to run more slowly in some cases, especially with a very large input file. Suppressing line numbers with the \-n option will avoid this problem. Using line numbers means: the line number will be displayed in the verbose prompt and in the = command, and the v command will pass the current line number to the editor (see also the discussion of LESSEDIT in PROMPTS below). .IP "\-N or \-\-LINE-NUMBERS" Causes a line number to be displayed at the beginning of each line in the display. .IP "\-o\fIfilename\fP or \-\-log-file=\fIfilename\fP" Causes .I less to copy its input to the named file as it is being viewed. This applies only when the input file is a pipe, not an ordinary file. If the file already exists, .I less will ask for confirmation before overwriting it. .IP "\-O\fIfilename\fP or \-\-LOG-FILE=\fIfilename\fP" The \-O option is like \-o, but it will overwrite an existing file without asking for confirmation. .sp If no log file has been specified, the \-o and \-O options can be used from within .I less to specify a log file. Without a file name, they will simply report the name of the log file. The "s" command is equivalent to specifying \-o from within .I less. .IP "\-p\fIpattern\fP or \-\-pattern=\fIpattern\fP" The \-p option on the command line is equivalent to specifying +/\fIpattern\fP; that is, it tells .I less to start at the first occurrence of \fIpattern\fP in the file. .IP "\-P\fIprompt\fP or \-\-prompt=\fIprompt\fP" Provides a way to tailor the three prompt styles to your own preference. This option would normally be put in the LESS environment variable, rather than being typed in with each .I less command. Such an option must either be the last option in the LESS variable, or be terminated by a dollar sign. -Ps followed by a string changes the default (short) prompt to that string. -Pm changes the medium (\-m) prompt. -PM changes the long (\-M) prompt. -Ph changes the prompt for the help screen. -P= changes the message printed by the = command. -Pw changes the message printed while waiting for data (in the F command). All prompt strings consist of a sequence of letters and special escape sequences. See the section on PROMPTS for more details. .IP "\-q or \-\-quiet or \-\-silent" Causes moderately "quiet" operation: the terminal bell is not rung if an attempt is made to scroll past the end of the file or before the beginning of the file. If the terminal has a "visual bell", it is used instead. The bell will be rung on certain other errors, such as typing an invalid character. The default is to ring the terminal bell in all such cases. .IP "\-Q or \-\-QUIET or \-\-SILENT" Causes totally "quiet" operation: the terminal bell is never rung. .IP "\-r or \-\-raw-control-chars" Causes "raw" control characters to be displayed. The default is to display control characters using the caret notation; for example, a control-A (octal 001) is displayed as "^A". Warning: when the \-r option is used, .I less cannot keep track of the actual appearance of the screen (since this depends on how the screen responds to each type of control character). Thus, various display problems may result, such as long lines being split in the wrong place. .IP "\-R or \-\-RAW-CONTROL-CHARS" Like \-r, but only ANSI "color" escape sequences are output in "raw" form. Unlike \-r, the screen appearance is maintained correctly in most cases. ANSI "color" escape sequences are sequences of the form: .sp ESC [ ... m .sp where the "..." is zero or more color specification characters For the purpose of keeping track of screen appearance, ANSI color escape sequences are assumed to not move the cursor. You can make .I less think that characters other than "m" can end ANSI color escape sequences by setting the environment variable LESSANSIENDCHARS to the list of characters which can end a color escape sequence. And you can make .I less think that characters other than the standard ones may appear between the ESC and the m by setting the environment variable LESSANSIMIDCHARS to the list of characters which can appear. .IP "\-s or \-\-squeeze-blank-lines" Causes consecutive blank lines to be squeezed into a single blank line. This is useful when viewing .I nroff output. .IP "\-S or \-\-chop-long-lines" Causes lines longer than the screen width to be chopped rather than folded. That is, the portion of a long line that does not fit in the screen width is not shown. The default is to fold long lines; that is, display the remainder on the next line. .IP "\-t\fItag\fP or \-\-tag=\fItag\fP" The \-t option, followed immediately by a TAG, will edit the file containing that tag. For this to work, tag information must be available; for example, there may be a file in the current directory called "tags", which was previously built by .I ctags (1) or an equivalent command. If the environment variable LESSGLOBALTAGS is set, it is taken to be the name of a command compatible with .I global (1), and that command is executed to find the tag. (See http://www.gnu.org/software/global/global.html). The \-t option may also be specified from within .I less (using the \- command) as a way of examining a new file. The command ":t" is equivalent to specifying \-t from within .I less. .IP "\-T\fItagsfile\fP or \-\-tag-file=\fItagsfile\fP" Specifies a tags file to be used instead of "tags". .IP "\-u or \-\-underline-special" Causes backspaces and carriage returns to be treated as printable characters; that is, they are sent to the terminal when they appear in the input. .IP "\-U or \-\-UNDERLINE-SPECIAL" Causes backspaces, tabs and carriage returns to be treated as control characters; that is, they are handled as specified by the \-r option. .sp By default, if neither \-u nor \-U is given, backspaces which appear adjacent to an underscore character are treated specially: the underlined text is displayed using the terminal's hardware underlining capability. Also, backspaces which appear between two identical characters are treated specially: the overstruck text is printed using the terminal's hardware boldface capability. Other backspaces are deleted, along with the preceding character. Carriage returns immediately followed by a newline are deleted. other carriage returns are handled as specified by the \-r option. Text which is overstruck or underlined can be searched for if neither \-u nor \-U is in effect. .IP "\-V or \-\-version" Displays the version number of .I less. .IP "\-w or \-\-hilite-unread" Temporarily highlights the first "new" line after a forward movement of a full page. The first "new" line is the line immediately following the line previously at the bottom of the screen. Also highlights the target line after a g or p command. The highlight is removed at the next command which causes movement. The entire line is highlighted, unless the \-J option is in effect, in which case only the status column is highlighted. .IP "\-W or \-\-HILITE-UNREAD" Like \-w, but temporarily highlights the first new line after any forward movement command larger than one line. .IP "\-x\fIn\fP,... or \-\-tabs=\fIn\fP,..." Sets tab stops. If only one \fIn\fP is specified, tab stops are set at multiples of \fIn\fP. If multiple values separated by commas are specified, tab stops are set at those positions, and then continue with the same spacing as the last two. For example, \fI-x9,17\fP will set tabs at positions 9, 17, 25, 33, etc. The default for \fIn\fP is 8. .IP "\-X or \-\-no-init" Disables sending the termcap initialization and deinitialization strings to the terminal. This is sometimes desirable if the deinitialization string does something unnecessary, like clearing the screen. .IP "\-\-no-keypad" Disables sending the keypad initialization and deinitialization strings to the terminal. This is sometimes useful if the keypad strings make the numeric keypad behave in an undesirable manner. .IP "\-y\fIn\fP or \-\-max-forw-scroll=\fIn\fP" Specifies a maximum number of lines to scroll forward. If it is necessary to scroll forward more than \fIn\fP lines, the screen is repainted instead. The \-c or \-C option may be used to repaint from the top of the screen if desired. By default, any forward movement causes scrolling. .IP "\-[z]\fIn\fP or \-\-window=\fIn\fP" Changes the default scrolling window size to \fIn\fP lines. The default is one screenful. The z and w commands can also be used to change the window size. The "z" may be omitted for compatibility with some versions of .I more. If the number .I n is negative, it indicates .I n lines less than the current screen size. For example, if the screen is 24 lines, \fI\-z-4\fP sets the scrolling window to 20 lines. If the screen is resized to 40 lines, the scrolling window automatically changes to 36 lines. .IP "\-\fI\(dqcc\fP\ or\ \-\-quotes=\fIcc\fP" Changes the filename quoting character. This may be necessary if you are trying to name a file which contains both spaces and quote characters. Followed by a single character, this changes the quote character to that character. Filenames containing a space should then be surrounded by that character rather than by double quotes. Followed by two characters, changes the open quote to the first character, and the close quote to the second character. Filenames containing a space should then be preceded by the open quote character and followed by the close quote character. Note that even after the quote characters are changed, this option remains \-" (a dash followed by a double quote). .IP "\-~ or \-\-tilde" Normally lines after end of file are displayed as a single tilde (~). This option causes lines after end of file to be displayed as blank lines. .IP "\-# or \-\-shift" Specifies the default number of positions to scroll horizontally in the RIGHTARROW and LEFTARROW commands. If the number specified is zero, it sets the default number of positions to one half of the screen width. .IP \-\- A command line argument of "\-\-" marks the end of option arguments. Any arguments following this are interpreted as filenames. This can be useful when viewing a file whose name begins with a "\-" or "+". .IP + If a command line option begins with \fB+\fP, the remainder of that option is taken to be an initial command to .I less. For example, +G tells .I less to start at the end of the file rather than the beginning, and +/xyz tells it to start at the first occurrence of "xyz" in the file. As a special case, + acts like +g; that is, it starts the display at the specified line number (however, see the caveat under the "g" command above). If the option starts with ++, the initial command applies to every file being viewed, not just the first one. The + command described previously may also be used to set (or change) an initial command for every file. .SH "LINE EDITING" When entering command line at the bottom of the screen (for example, a filename for the :e command, or the pattern for a search command), certain keys can be used to manipulate the command line. Most commands have an alternate form in [ brackets ] which can be used if a key does not exist on a particular keyboard. (The bracketed forms do not work in the MS-DOS version.) Any of these special keys may be entered literally by preceding it with the "literal" character, either ^V or ^A. A backslash itself may also be entered literally by entering two backslashes. .IP "LEFTARROW [ ESC-h ]" Move the cursor one space to the left. .IP "RIGHTARROW [ ESC-l ]" Move the cursor one space to the right. .IP "^LEFTARROW [ ESC-b or ESC-LEFTARROW ]" (That is, CONTROL and LEFTARROW simultaneously.) Move the cursor one word to the left. .IP "^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ]" (That is, CONTROL and RIGHTARROW simultaneously.) Move the cursor one word to the right. .IP "HOME [ ESC-0 ]" Move the cursor to the beginning of the line. .IP "END [ ESC-$ ]" Move the cursor to the end of the line. .IP "BACKSPACE" Delete the character to the left of the cursor, or cancel the command if the command line is empty. .IP "DELETE or [ ESC-x ]" Delete the character under the cursor. .IP "^BACKSPACE [ ESC-BACKSPACE ]" (That is, CONTROL and BACKSPACE simultaneously.) Delete the word to the left of the cursor. .IP "^DELETE [ ESC-X or ESC-DELETE ]" (That is, CONTROL and DELETE simultaneously.) Delete the word under the cursor. .IP "UPARROW [ ESC-k ]" Retrieve the previous command line. .IP "DOWNARROW [ ESC-j ]" Retrieve the next command line. .IP "TAB" Complete the partial filename to the left of the cursor. If it matches more than one filename, the first match is entered into the command line. Repeated TABs will cycle thru the other matching filenames. If the completed filename is a directory, a "/" is appended to the filename. (On MS-DOS systems, a "\e" is appended.) The environment variable LESSSEPARATOR can be used to specify a different character to append to a directory name. .IP "BACKTAB [ ESC-TAB ]" Like, TAB, but cycles in the reverse direction thru the matching filenames. .IP "^L" Complete the partial filename to the left of the cursor. If it matches more than one filename, all matches are entered into the command line (if they fit). .IP "^U (Unix and OS/2) or ESC (MS-DOS)" Delete the entire command line, or cancel the command if the command line is empty. If you have changed your line-kill character in Unix to something other than ^U, that character is used instead of ^U. .SH "KEY BINDINGS" You may define your own .I less commands by using the program .I lesskey (1) to create a lesskey file. This file specifies a set of command keys and an action associated with each key. You may also use .I lesskey to change the line-editing keys (see LINE EDITING), and to set environment variables. If the environment variable LESSKEY is set, .I less uses that as the name of the lesskey file. Otherwise, .I less looks in a standard place for the lesskey file: On Unix systems, .I less looks for a lesskey file called "$HOME/.less". On MS-DOS and Windows systems, .I less looks for a lesskey file called "$HOME/_less", and if it is not found there, then looks for a lesskey file called "_less" in any directory specified in the PATH environment variable. On OS/2 systems, .I less looks for a lesskey file called "$HOME/less.ini", and if it is not found, then looks for a lesskey file called "less.ini" in any directory specified in the INIT environment variable, and if it not found there, then looks for a lesskey file called "less.ini" in any directory specified in the PATH environment variable. See the .I lesskey manual page for more details. .P A system-wide lesskey file may also be set up to provide key bindings. If a key is defined in both a local lesskey file and in the system-wide file, key bindings in the local file take precedence over those in the system-wide file. If the environment variable LESSKEY_SYSTEM is set, .I less uses that as the name of the system-wide lesskey file. Otherwise, .I less looks in a standard place for the system-wide lesskey file: On Unix systems, the system-wide lesskey file is /usr/local/etc/sysless. (However, if .I less was built with a different sysconf directory than /usr/local/etc, that directory is where the sysless file is found.) On MS-DOS and Windows systems, the system-wide lesskey file is c:\e_sysless. On OS/2 systems, the system-wide lesskey file is c:\esysless.ini. .SH "INPUT PREPROCESSOR" You may define an "input preprocessor" for .I less. Before .I less opens a file, it first gives your input preprocessor a chance to modify the way the contents of the file are displayed. An input preprocessor is simply an executable program (or shell script), which writes the contents of the file to a different file, called the replacement file. The contents of the replacement file are then displayed in place of the contents of the original file. However, it will appear to the user as if the original file is opened; that is, .I less will display the original filename as the name of the current file. .PP An input preprocessor receives one command line argument, the original filename, as entered by the user. It should create the replacement file, and when finished, print the name of the replacement file to its standard output. If the input preprocessor does not output a replacement filename, .I less uses the original file, as normal. The input preprocessor is not called when viewing standard input. To set up an input preprocessor, set the LESSOPEN environment variable to a command line which will invoke your input preprocessor. This command line should include one occurrence of the string "%s", which will be replaced by the filename when the input preprocessor command is invoked. .PP When .I less closes a file opened in such a way, it will call another program, called the input postprocessor, which may perform any desired clean-up action (such as deleting the replacement file created by LESSOPEN). This program receives two command line arguments, the original filename as entered by the user, and the name of the replacement file. To set up an input postprocessor, set the LESSCLOSE environment variable to a command line which will invoke your input postprocessor. It may include two occurrences of the string "%s"; the first is replaced with the original name of the file and the second with the name of the replacement file, which was output by LESSOPEN. .PP For example, on many Unix systems, these two scripts will allow you to keep files in compressed format, but still let .I less view them directly: .PP lessopen.sh: .br #! /bin/sh .br case "$1" in .br *.Z) uncompress -\c $1 >/tmp/less.$$ 2>/dev/null .br if [ \-s /tmp/less.$$ ]; then .br echo /tmp/less.$$ .br else .br rm \-f /tmp/less.$$ .br fi .br ;; .br esac .PP lessclose.sh: .br #! /bin/sh .br rm $2 .PP To use these scripts, put them both where they can be executed and set LESSOPEN="lessopen.sh\ %s", and LESSCLOSE="lessclose.sh\ %s\ %s". More complex LESSOPEN and LESSCLOSE scripts may be written to accept other types of compressed files, and so on. .PP It is also possible to set up an input preprocessor to pipe the file data directly to .I less, rather than putting the data into a replacement file. This avoids the need to decompress the entire file before starting to view it. An input preprocessor that works this way is called an input pipe. An input pipe, instead of writing the name of a replacement file on its standard output, writes the entire contents of the replacement file on its standard output. If the input pipe does not write any characters on its standard output, then there is no replacement file and .I less uses the original file, as normal. To use an input pipe, make the first character in the LESSOPEN environment variable a vertical bar (|) to signify that the input preprocessor is an input pipe. .PP For example, on many Unix systems, this script will work like the previous example scripts: .PP lesspipe.sh: .br #! /bin/sh .br case "$1" in .br *.Z) uncompress \-c $1 2>/dev/null .br ;; .br esac .br .PP To use this script, put it where it can be executed and set LESSOPEN="|lesspipe.sh %s". When an input pipe is used, a LESSCLOSE postprocessor can be used, but it is usually not necessary since there is no replacement file to clean up. In this case, the replacement file name passed to the LESSCLOSE postprocessor is "\-". .SH "NATIONAL CHARACTER SETS" There are three types of characters in the input file: .IP "normal characters" can be displayed directly to the screen. .IP "control characters" should not be displayed directly, but are expected to be found in ordinary text files (such as backspace and tab). .IP "binary characters" should not be displayed directly and are not expected to be found in text files. .PP A "character set" is simply a description of which characters are to be considered normal, control, and binary. The LESSCHARSET environment variable may be used to select a character set. Possible values for LESSCHARSET are: .IP ascii BS, TAB, NL, CR, and formfeed are control characters, all chars with values between 32 and 126 are normal, and all others are binary. .IP iso8859 Selects an ISO 8859 character set. This is the same as ASCII, except characters between 160 and 255 are treated as normal characters. .IP latin1 Same as iso8859. .IP latin9 Same as iso8859. .IP dos Selects a character set appropriate for MS-DOS. .IP ebcdic Selects an EBCDIC character set. .IP IBM-1047 Selects an EBCDIC character set used by OS/390 Unix Services. This is the EBCDIC analogue of latin1. You get similar results by setting either LESSCHARSET=IBM-1047 or LC_CTYPE=en_US in your environment. .IP koi8-r Selects a Russian character set. .IP next Selects a character set appropriate for NeXT computers. .IP utf-8 Selects the UTF-8 encoding of the ISO 10646 character set. UTF-8 is special in that it supports multi-byte characters in the input file. It is the only character set that supports multi-byte characters. .IP windows Selects a character set appropriate for Microsoft Windows (cp 1251). .PP In special cases, it may be desired to tailor .I less to use a character set other than the ones definable by LESSCHARSET. In this case, the environment variable LESSCHARDEF can be used to define a character set. It should be set to a string where each character in the string represents one character in the character set. The character "." is used for a normal character, "c" for control, and "b" for binary. A decimal number may be used for repetition. For example, "bccc4b." would mean character 0 is binary, 1, 2 and 3 are control, 4, 5, 6 and 7 are binary, and 8 is normal. All characters after the last are taken to be the same as the last, so characters 9 through 255 would be normal. (This is an example, and does not necessarily represent any real character set.) .PP This table shows the value of LESSCHARDEF which is equivalent to each of the possible values for LESSCHARSET: .sp ascii\ 8bcccbcc18b95.b .br dos\ \ \ 8bcccbcc12bc5b95.b. .br ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b .br \ \ \ \ \ \ 9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b. .br IBM-1047 4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc .br \ \ \ \ \ \ 191.b .br iso8859 8bcccbcc18b95.33b. .br koi8-r 8bcccbcc18b95.b128. .br latin1 8bcccbcc18b95.33b. .br next\ \ 8bcccbcc18b95.bb125.bb .PP If neither LESSCHARSET nor LESSCHARDEF is set, but any of the strings "UTF-8", "UTF8", "utf-8" or "utf8" is found in the LC_ALL, LC_TYPE or LANG environment variables, then the default character set is utf-8. .PP If that string is not found, but your system supports the .I setlocale interface, .I less will use setlocale to determine the character set. setlocale is controlled by setting the LANG or LC_CTYPE environment variables. .PP Finally, if the .I setlocale interface is also not available, the default character set is latin1. .PP Control and binary characters are displayed in standout (reverse video). Each such character is displayed in caret notation if possible (e.g. ^A for control-A). Caret notation is used only if inverting the 0100 bit results in a normal printable character. Otherwise, the character is displayed as a hex number in angle brackets. This format can be changed by setting the LESSBINFMT environment variable. LESSBINFMT may begin with a "*" and one character to select the display attribute: "*k" is blinking, "*d" is bold, "*u" is underlined, "*s" is standout, and "*n" is normal. If LESSBINFMT does not begin with a "*", normal attribute is assumed. The remainder of LESSBINFMT is a string which may include one printf-style escape sequence (a % followed by x, X, o, d, etc.). For example, if LESSBINFMT is "*u[%x]", binary characters are displayed in underlined hexadecimal surrounded by brackets. The default if no LESSBINFMT is specified is "*s<%X>". The default if no LESSBINFMT is specified is "*s<%02X>". Warning: the result of expanding the character via LESSBINFMT must be less than 31 characters. .PP When the character set is utf-8, the LESSUTFBINFMT environment variable acts similarly to LESSBINFMT but it applies to Unicode code points that were successfully decoded but are unsuitable for display (e.g., unassigned code points). Its default value is "". Note that LESSUTFBINFMT and LESSBINFMT share their display attribute setting ("*x") so specifying one will affect both; LESSUTFBINFMT is read after LESSBINFMT so its setting, if any, will have priority. Problematic octets in a UTF-8 file (octets of a truncated sequence, octets of a complete but non-shortest form sequence, illegal octets, and stray trailing octets) are displayed individually using LESSBINFMT so as to facilitate diagnostic of how the UTF-8 file is ill-formed. .SH "PROMPTS" The \-P option allows you to tailor the prompt to your preference. The string given to the \-P option replaces the specified prompt string. Certain characters in the string are interpreted specially. The prompt mechanism is rather complicated to provide flexibility, but the ordinary user need not understand the details of constructing personalized prompt strings. .sp A percent sign followed by a single character is expanded according to what the following character is: .IP "%b\fIX\fP" Replaced by the byte offset into the current input file. The b is followed by a single character (shown as \fIX\fP above) which specifies the line whose byte offset is to be used. If the character is a "t", the byte offset of the top line in the display is used, an "m" means use the middle line, a "b" means use the bottom line, a "B" means use the line just after the bottom line, and a "j" means use the "target" line, as specified by the \-j option. .IP "%B" Replaced by the size of the current input file. .IP "%c" Replaced by the column number of the text appearing in the first column of the screen. .IP "%d\fIX\fP" Replaced by the page number of a line in the input file. The line to be used is determined by the \fIX\fP, as with the %b option. .IP "%D" Replaced by the number of pages in the input file, or equivalently, the page number of the last line in the input file. .IP "%E" Replaced by the name of the editor (from the VISUAL environment variable, or the EDITOR environment variable if VISUAL is not defined). See the discussion of the LESSEDIT feature below. .IP "%f" Replaced by the name of the current input file. .IP "%i" Replaced by the index of the current file in the list of input files. .IP "%l\fIX\fP" Replaced by the line number of a line in the input file. The line to be used is determined by the \fIX\fP, as with the %b option. .IP "%L" Replaced by the line number of the last line in the input file. .IP "%m" Replaced by the total number of input files. .IP "%p\fIX\fP" Replaced by the percent into the current input file, based on byte offsets. The line used is determined by the \fIX\fP as with the %b option. .IP "%P\fIX\fP" Replaced by the percent into the current input file, based on line numbers. The line used is determined by the \fIX\fP as with the %b option. .IP "%s" Same as %B. .IP "%t" Causes any trailing spaces to be removed. Usually used at the end of the string, but may appear anywhere. .IP "%x" Replaced by the name of the next input file in the list. .PP If any item is unknown (for example, the file size if input is a pipe), a question mark is printed instead. .PP The format of the prompt string can be changed depending on certain conditions. A question mark followed by a single character acts like an "IF": depending on the following character, a condition is evaluated. If the condition is true, any characters following the question mark and condition character, up to a period, are included in the prompt. If the condition is false, such characters are not included. A colon appearing between the question mark and the period can be used to establish an "ELSE": any characters between the colon and the period are included in the string if and only if the IF condition is false. Condition characters (which follow a question mark) may be: .IP "?a" True if any characters have been included in the prompt so far. .IP "?b\fIX\fP" True if the byte offset of the specified line is known. .IP "?B" True if the size of current input file is known. .IP "?c" True if the text is horizontally shifted (%c is not zero). .IP "?d\fIX\fP" True if the page number of the specified line is known. .IP "?e" True if at end-of-file. .IP "?f" True if there is an input filename (that is, if input is not a pipe). .IP "?l\fIX\fP" True if the line number of the specified line is known. .IP "?L" True if the line number of the last line in the file is known. .IP "?m" True if there is more than one input file. .IP "?n" True if this is the first prompt in a new input file. .IP "?p\fIX\fP" True if the percent into the current input file, based on byte offsets, of the specified line is known. .IP "?P\fIX\fP" True if the percent into the current input file, based on line numbers, of the specified line is known. .IP "?s" Same as "?B". .IP "?x" True if there is a next input file (that is, if the current input file is not the last one). .PP Any characters other than the special ones (question mark, colon, period, percent, and backslash) become literally part of the prompt. Any of the special characters may be included in the prompt literally by preceding it with a backslash. .PP Some examples: .sp ?f%f:Standard input. .sp This prompt prints the filename, if known; otherwise the string "Standard input". .sp ?f%f .?ltLine %lt:?pt%pt\e%:?btByte %bt:-... .sp This prompt would print the filename, if known. The filename is followed by the line number, if known, otherwise the percent if known, otherwise the byte offset if known. Otherwise, a dash is printed. Notice how each question mark has a matching period, and how the % after the %pt is included literally by escaping it with a backslash. .sp ?n?f%f\ .?m(file\ %i\ of\ %m)\ ..?e(END)\ ?x-\ Next\e:\ %x..%t .sp This prints the filename if this is the first prompt in a file, followed by the "file N of N" message if there is more than one input file. Then, if we are at end-of-file, the string "(END)" is printed followed by the name of the next file, if there is one. Finally, any trailing spaces are truncated. This is the default prompt. For reference, here are the defaults for the other two prompts (\-m and \-M respectively). Each is broken into two lines here for readability only. .nf .sp ?n?f%f\ .?m(file\ %i\ of\ %m)\ ..?e(END)\ ?x-\ Next\e:\ %x.: ?pB%pB\e%:byte\ %bB?s/%s...%t .sp ?f%f\ .?n?m(file\ %i\ of\ %m)\ ..?ltlines\ %lt-%lb?L/%L.\ : byte\ %bB?s/%s.\ .?e(END)\ ?x-\ Next\e:\ %x.:?pB%pB\e%..%t .sp .fi And here is the default message produced by the = command: .nf .sp ?f%f\ .?m(file\ %i\ of\ %m)\ .?ltlines\ %lt-%lb?L/%L.\ . byte\ %bB?s/%s.\ ?e(END)\ :?pB%pB\e%..%t .fi .PP The prompt expansion features are also used for another purpose: if an environment variable LESSEDIT is defined, it is used as the command to be executed when the v command is invoked. The LESSEDIT string is expanded in the same way as the prompt strings. The default value for LESSEDIT is: .nf .sp %E\ ?lm+%lm.\ %f .sp .fi Note that this expands to the editor name, followed by a + and the line number, followed by the file name. If your editor does not accept the "+linenumber" syntax, or has other differences in invocation syntax, the LESSEDIT variable can be changed to modify this default. .SH SECURITY When the environment variable LESSSECURE is set to 1, .I less runs in a "secure" mode. This means these features are disabled: .RS .IP "!" the shell command .IP "|" the pipe command .IP ":e" the examine command. .IP "v" the editing command .IP "s \-o" log files .IP "\-k" use of lesskey files .IP "\-t" use of tags files .IP " " metacharacters in filenames, such as * .IP " " filename completion (TAB, ^L) .RE .PP Less can also be compiled to be permanently in "secure" mode. .SH "COMPATIBILITY WITH MORE" If the environment variable LESS_IS_MORE is set to 1, or if the program is invoked via a file link named "more", .I less behaves (mostly) in conformance with the POSIX "more" command specification. In this mode, less behaves differently in these ways: .PP The \-e option works differently. If the \-e option is not set, .I less behaves as if the \-E option were set. If the \-e option is set, .I less behaves as if the \-e and \-F options were set. .PP The \-m option works differently. If the \-m option is not set, the medium prompt is used, and it is prefixed with the string "--More--". If the \-m option is set, the short prompt is used. .PP The \-n option acts like the \-z option. The normal behavior of the \-n option is unavailable in this mode. .PP The parameter to the \-p option is taken to be a .I less command rather than a search pattern. .PP The LESS environment variable is ignored, and the MORE environment variable is used in its place. .SH "ENVIRONMENT VARIABLES" Environment variables may be specified either in the system environment as usual, or in a .I lesskey (1) file. If environment variables are defined in more than one place, variables defined in a local lesskey file take precedence over variables defined in the system environment, which take precedence over variables defined in the system-wide lesskey file. .IP COLUMNS Sets the number of columns on the screen. Takes precedence over the number of columns specified by the TERM variable. (But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD, the window system's idea of the screen size takes precedence over the LINES and COLUMNS environment variables.) .IP EDITOR The name of the editor (used for the v command). .IP HOME Name of the user's home directory (used to find a lesskey file on Unix and OS/2 systems). .IP "HOMEDRIVE, HOMEPATH" Concatenation of the HOMEDRIVE and HOMEPATH environment variables is the name of the user's home directory if the HOME variable is not set (only in the Windows version). .IP INIT Name of the user's init directory (used to find a lesskey file on OS/2 systems). .IP LANG Language for determining the character set. .IP LC_CTYPE Language for determining the character set. .IP LESS Options which are passed to .I less automatically. .IP LESSANSIENDCHARS Characters which may end an ANSI color escape sequence (default "m"). .IP LESSANSIMIDCHARS Characters which may appear between the ESC character and the end character in an ANSI color escape sequence (default "0123456789;[?!"'#%()*+\ ". .IP LESSBINFMT Format for displaying non-printable, non-control characters. .IP LESSCHARDEF Defines a character set. .IP LESSCHARSET Selects a predefined character set. .IP LESSCLOSE Command line to invoke the (optional) input-postprocessor. .IP LESSECHO Name of the lessecho program (default "lessecho"). The lessecho program is needed to expand metacharacters, such as * and ?, in filenames on Unix systems. .IP LESSEDIT Editor prototype string (used for the v command). See discussion under PROMPTS. .IP LESSGLOBALTAGS Name of the command used by the \-t option to find global tags. Normally should be set to "global" if your system has the .I global (1) command. If not set, global tags are not used. .IP LESSHISTFILE Name of the history file used to remember search commands and shell commands between invocations of .I less. If set to "\-" or "/dev/null", a history file is not used. The default is "$HOME/.lesshst" on Unix systems, "$HOME/_lesshst" on DOS and Windows systems, or "$HOME/lesshst.ini" or "$INIT/lesshst.ini" on OS/2 systems. .IP LESSHISTSIZE The maximum number of commands to save in the history file. The default is 100. .IP LESSKEY Name of the default lesskey(1) file. .IP LESSKEY_SYSTEM Name of the default system-wide lesskey(1) file. .IP LESSMETACHARS List of characters which are considered "metacharacters" by the shell. .IP LESSMETAESCAPE Prefix which less will add before each metacharacter in a command sent to the shell. If LESSMETAESCAPE is an empty string, commands containing metacharacters will not be passed to the shell. .IP LESSOPEN Command line to invoke the (optional) input-preprocessor. .IP LESSSECURE Runs less in "secure" mode. See discussion under SECURITY. .IP LESSSEPARATOR String to be appended to a directory name in filename completion. .IP LESSUTFBINFMT Format for displaying non-printable Unicode code points. .IP LESS_IS_MORE Emulate the .I more (1) command. .IP LINES Sets the number of lines on the screen. Takes precedence over the number of lines specified by the TERM variable. (But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD, the window system's idea of the screen size takes precedence over the LINES and COLUMNS environment variables.) .IP PATH User's search path (used to find a lesskey file on MS-DOS and OS/2 systems). .IP SHELL The shell used to execute the ! command, as well as to expand filenames. .IP TERM The type of terminal on which .I less is being run. .IP VISUAL The name of the editor (used for the v command). .SH "SEE ALSO" lesskey(1) .SH WARNINGS The = command and prompts (unless changed by \-P) report the line numbers of the lines at the top and bottom of the screen, but the byte and percent of the line after the one at the bottom of the screen. .PP On certain older terminals (the so-called "magic cookie" terminals), search highlighting will cause an erroneous display. On such terminals, search highlighting is disabled by default to avoid possible problems. .PP When searching in a binary file, text which follows a null byte may not be found. This problem does not occur when searching with regular expressions turned off via ^R, and also does not occur when .I less is compiled to use the PCRE regular expression library. .PP In certain cases, when search highlighting is enabled and a search pattern begins with a ^, more text than the matching string may be highlighted. (This problem does not occur when less is compiled to use the POSIX regular expression package.) .PP On some systems, .I setlocale claims that ASCII characters 0 thru 31 are control characters rather than binary characters. This causes .I less to treat some binary files as ordinary, non-binary files. To workaround this problem, set the environment variable LESSCHARSET to "ascii" (or whatever character set is appropriate). .PP This manual is too long. .PP See http://www.greenwoodsoftware.com/less for the latest list of known bugs in less. .SH COPYRIGHT Copyright (C) 1984-2007 Mark Nudelman .PP less is part of the GNU project and is free software. You can redistribute it and/or modify it under the terms of either (1) the GNU General Public License as published by the Free Software Foundation; or (2) the Less License. See the file README in the less distribution for more details regarding redistribution. You should have received a copy of the GNU General Public License along with the source for less; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. You should also have received a copy of the Less License; see the file LICENSE. .PP less is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .SH AUTHOR .PP Mark Nudelman .br Send bug reports or comments to the above address or to .br bug-less@gnu.org. .br For more information, see the less homepage at .br http://www.greenwoodsoftware.com/less. Index: vendor/less/dist/contrib/less/lessecho.man =================================================================== --- vendor/less/dist/contrib/less/lessecho.man (revision 172596) +++ vendor/less/dist/contrib/less/lessecho.man (revision 172597) @@ -1,49 +1,49 @@ LESSECHO(1) LESSECHO(1) NAME lessecho - expand metacharacters SYNOPSIS lessecho [-ox] [-cx] [-pn] [-dn] [-mx] [-nn] [-ex] [-a] file ... DESCRIPTION lessecho is a program that simply echos its arguments on standard out- put. But any argument containing spaces is enclosed in quotes. OPTIONS A summary of options is included below. -ox Specifies "x" to be the open quote character. -cx Specifies "x" to be the close quote character. -pn Specifies "n" to be the open quote character, as an integer. -dn Specifies "n" to be the close quote character, as an integer. -mx Specifies "x" to be a metachar. -nn Specifies "n" to be a metachar, as an integer. -ex Specifies "x" to be the escape char for metachars. -fn Specifies "n" to be the escape char for metachars, as an inte- ger. -a Specifies that all arguments are to be quoted. The default is that only arguments containing spaces are quoted. SEE ALSO less(1) AUTHOR This manual page was written by Thomas Schoepf , for the Debian GNU/Linux system (but may be used by others). Send bug reports or comments to bug-less@gnu.org. - Version 408: 01 Oct 2007 LESSECHO(1) + Version 409: 12 Oct 2007 LESSECHO(1) Index: vendor/less/dist/contrib/less/lessecho.nro =================================================================== --- vendor/less/dist/contrib/less/lessecho.nro (revision 172596) +++ vendor/less/dist/contrib/less/lessecho.nro (revision 172597) @@ -1,47 +1,47 @@ -.TH LESSECHO 1 "Version 408: 01 Oct 2007" +.TH LESSECHO 1 "Version 409: 12 Oct 2007" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS .B lessecho .I "[-ox] [-cx] [-pn] [-dn] [-mx] [-nn] [-ex] [-a] file ..." .SH "DESCRIPTION" .I lessecho is a program that simply echos its arguments on standard output. But any argument containing spaces is enclosed in quotes. .SH OPTIONS A summary of options is included below. .TP .B \-ox Specifies "x" to be the open quote character. .TP .B \-cx Specifies "x" to be the close quote character. .TP .B \-pn Specifies "n" to be the open quote character, as an integer. .TP .B \-dn Specifies "n" to be the close quote character, as an integer. .TP .B \-mx Specifies "x" to be a metachar. .TP .B \-nn Specifies "n" to be a metachar, as an integer. .TP .B \-ex Specifies "x" to be the escape char for metachars. .TP .B \-fn Specifies "n" to be the escape char for metachars, as an integer. .TP .B \-a Specifies that all arguments are to be quoted. The default is that only arguments containing spaces are quoted. .SH "SEE ALSO" less(1) .SH AUTHOR This manual page was written by Thomas Schoepf , for the Debian GNU/Linux system (but may be used by others). .PP Send bug reports or comments to bug-less@gnu.org. Index: vendor/less/dist/contrib/less/lesskey.man =================================================================== --- vendor/less/dist/contrib/less/lesskey.man (revision 172596) +++ vendor/less/dist/contrib/less/lesskey.man (revision 172597) @@ -1,360 +1,360 @@ LESSKEY(1) LESSKEY(1) NAME lesskey - specify key bindings for less SYNOPSIS lesskey [-o output] [--] [input] lesskey [--output=output] [--] [input] lesskey -V lesskey --version DESCRIPTION Lesskey is used to specify a set of key bindings to be used by less. The input file is a text file which describes the key bindings, If the input file is "-", standard input is read. If no input file is speci- fied, a standard filename is used as the name of the input file, which depends on the system being used: On Unix systems, $HOME/.lesskey is used; on MS-DOS systems, $HOME/_lesskey is used; and on OS/2 systems $HOME/lesskey.ini is used, or $INIT/lesskey.ini if $HOME is undefined. The output file is a binary file which is used by less. If no output file is specified, and the environment variable LESSKEY is set, the value of LESSKEY is used as the name of the output file. Otherwise, a standard filename is used as the name of the output file, which depends on the system being used: On Unix and OS-9 systems, $HOME/.less is used; on MS-DOS systems, $HOME/_less is used; and on OS/2 systems, $HOME/less.ini is used, or $INIT/less.ini if $HOME is undefined. If the output file already exists, lesskey will overwrite it. The -V or --version option causes lesskey to print its version number and immediately exit. If -V or --version is present, other options and arguments are ignored. The input file consists of one or more sections. Each section starts with a line that identifies the type of section. Possible sections are: #command Defines new command keys. #line-edit Defines new line-editing keys. #env Defines environment variables. Blank lines and lines which start with a pound sign (#) are ignored, except for the special section header lines. COMMAND SECTION The command section begins with the line #command If the command section is the first section in the file, this line may be omitted. The command section consists of lines of the form: string action [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 less action, from the list below. The characters in the string may appear literally, or be prefixed by a caret to indicate a control key. A backslash followed by one to three octal digits may be used to specify a character by its octal value. A backslash fol- lowed by certain characters specifies input characters as follows: \b BACKSPACE \e ESCAPE \n NEWLINE \r RETURN \t TAB \ku UP ARROW \kd DOWN ARROW \kr RIGHT ARROW \kl LEFT ARROW \kU PAGE UP \kD PAGE DOWN \kh HOME \ke END \kx DELETE A backslash followed by any other character indicates that character is to be taken literally. Characters which must be preceded by backslash include caret, space, tab and the backslash itself. An action may be followed by an "extra" string. When such a command is entered while running less, the action is performed, and then the extra string is parsed, just as if it were typed in to less. This feature can be used in certain cases to extend the functionality of a command. For example, see the "{" and ":t" commands in the example below. The extra string has a special meaning for the "quit" action: when less quits, first character of the extra string is used as its exit status. EXAMPLE The following input file describes the set of default command keys used by less: #command \r forw-line \n forw-line e forw-line j forw-line \kd forw-line ^E forw-line ^N forw-line k back-line y back-line ^Y back-line ^K back-line ^P back-line J forw-line-force K back-line-force Y back-line-force d forw-scroll ^D forw-scroll u back-scroll ^U back-scroll \40 forw-screen f forw-screen ^F forw-screen ^V forw-screen \kD forw-screen b back-screen ^B back-screen \ev back-screen \kU back-screen z forw-window w back-window \e\40 forw-screen-force F forw-forever R repaint-flush r repaint ^R repaint ^L repaint \eu undo-hilite g goto-line \kh goto-line < goto-line \e< goto-line p percent % percent \e[ left-scroll \e] right-scroll \e( left-scroll \e) right-scroll { forw-bracket {} } back-bracket {} ( forw-bracket () ) back-bracket () [ forw-bracket [] ] back-bracket [] \e^F forw-bracket \e^B back-bracket G goto-end \e> goto-end > goto-end \ke goto-end = status ^G status :f status / forw-search ? back-search \e/ forw-search * \e? back-search * n repeat-search \en repeat-search-all N reverse-search \eN reverse-search-all m set-mark ' goto-mark ^X^X goto-mark E examine :e examine ^X^V examine :n next-file :p prev-file t next-tag T prev-tag :x index-file :d remove-file - toggle-option :t toggle-option t s toggle-option o _ display-option | pipe v visual ! shell + firstcmd H help h help V version 0 digit 1 digit 2 digit 3 digit 4 digit 5 digit 6 digit 7 digit 8 digit 9 digit q quit Q quit :q quit :Q quit ZZ quit PRECEDENCE Commands specified by lesskey take precedence over the default com- mands. A default command key may be disabled by including it in the input file with the action "invalid". Alternatively, a key may be defined to do nothing by using the action "noaction". "noaction" is similar to "invalid", but less will give an error beep for an "invalid" command, but not for a "noaction" command. In addition, ALL default commands may be disabled by adding this control line to the input file: #stop This will cause all default commands to be ignored. The #stop line should be the last line in that section of the file. Be aware that #stop can be dangerous. Since all default commands are disabled, you must provide sufficient commands before the #stop line to enable all necessary actions. For example, failure to provide a "quit" command can lead to frustration. LINE EDITING SECTION The line-editing section begins with the line: #line-edit This section specifies new key bindings for the line editing commands, in a manner similar to the way key bindings for ordinary commands are specified in the #command section. The line-editing section consists of a list of keys and actions, one per line as in the example below. EXAMPLE The following input file describes the set of default line-editing keys used by less: #line-edit \t forw-complete \17 back-complete \e\t back-complete ^L expand ^V literal ^A literal \el right \kr right \eh left \kl left \eb word-left \e\kl word-left \ew word-right \e\kr word-right \ei insert \ex delete \kx delete \eX word-delete \ekx word-delete \e\b word-backspace \e0 home \kh home \e$ end \ke end \ek up \ku up \ej down LESS ENVIRONMENT VARIABLES The environment variable section begins with the line #env Following this line is a list of environment variable assignments. Each line consists of an environment variable name, an equals sign (=) and the value to be assigned to the environment variable. White space before and after the equals sign is ignored. Variables assigned in this way are visible only to less. If a variable is specified in the system environment and also in a lesskey file, the value in the lesskey file takes precedence. Although the lesskey file can be used to over- ride variables set in the environment, the main purpose of assigning variables in the lesskey file is simply to have all less configuration information stored in one file. EXAMPLE The following input file sets the -i option whenever less is run, and specifies the character set to be "latin1": #env LESS = -i LESSCHARSET = latin1 SEE ALSO less(1) WARNINGS It is not possible to specify special keys, such as uparrow, in a key- board-independent manner. The only way to specify such keys is to specify the escape sequence which a particular keyboard sends when such a key is pressed. On MS-DOS and OS/2 systems, certain keys send a sequence of characters which start with a NUL character (0). This NUL character should be represented as \340 in a lesskey file. COPYRIGHT Copyright (C) 2000-2007 Mark Nudelman lesskey is part of the GNU project and is free software; you can redis- tribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. lesskey is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with lesskey; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. AUTHOR Mark Nudelman Send bug reports or comments to the above address or to bug- less@gnu.org. - Version 408: 01 Oct 2007 LESSKEY(1) + Version 409: 12 Oct 2007 LESSKEY(1) Index: vendor/less/dist/contrib/less/lesskey.nro =================================================================== --- vendor/less/dist/contrib/less/lesskey.nro (revision 172596) +++ vendor/less/dist/contrib/less/lesskey.nro (revision 172597) @@ -1,384 +1,384 @@ -.TH LESSKEY 1 "Version 408: 01 Oct 2007" +.TH LESSKEY 1 "Version 409: 12 Oct 2007" .SH NAME lesskey \- specify key bindings for less .SH SYNOPSIS .B "lesskey [-o output] [--] [input]" .br .B "lesskey [--output=output] [--] [input]" .br .B "lesskey -V" .br .B "lesskey --version" .SH DESCRIPTION .I Lesskey is used to specify a set of key bindings to be used by .I less. The input file is a text file which describes the key bindings, If the input file is "-", standard input is read. If no input file is specified, a standard filename is used as the name of the input file, which depends on the system being used: On Unix systems, $HOME/.lesskey is used; on MS-DOS systems, $HOME/_lesskey is used; and on OS/2 systems $HOME/lesskey.ini is used, or $INIT/lesskey.ini if $HOME is undefined. The output file is a binary file which is used by .I less. If no output file is specified, and the environment variable LESSKEY is set, the value of LESSKEY is used as the name of the output file. Otherwise, a standard filename is used as the name of the output file, which depends on the system being used: On Unix and OS-9 systems, $HOME/.less is used; on MS-DOS systems, $HOME/_less is used; and on OS/2 systems, $HOME/less.ini is used, or $INIT/less.ini if $HOME is undefined. If the output file already exists, .I lesskey will overwrite it. .PP The -V or --version option causes .I lesskey to print its version number and immediately exit. If -V or --version is present, other options and arguments are ignored. .PP The input file consists of one or more .I sections. Each section starts with a line that identifies the type of section. Possible sections are: .IP #command Defines new command keys. .IP #line-edit Defines new line-editing keys. .IP #env Defines environment variables. .PP Blank lines and lines which start with a pound sign (#) are ignored, except for the special section header lines. .SH "COMMAND SECTION" The command section begins with the line .sp #command .sp If the command section is the first section in the file, this line may be omitted. The command section consists of lines of the form: .sp \fIstring\fP \fIaction\fP [extra-string] .sp Whitespace is any sequence of one or more spaces and/or tabs. 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 caret to indicate a control key. A backslash followed by one to three octal digits may be used to specify a character by its octal value. A backslash followed by certain characters specifies input characters as follows: .IP \eb BACKSPACE .IP \ee ESCAPE .IP \en NEWLINE .IP \er RETURN .IP \et TAB .IP \eku UP ARROW .IP \ekd DOWN ARROW .IP \ekr RIGHT ARROW .IP \ekl LEFT ARROW .IP \ekU PAGE UP .IP \ekD PAGE DOWN .IP \ekh HOME .IP \eke END .IP \ekx DELETE .PP A backslash followed by any other character indicates that character is to be taken literally. Characters which must be preceded by backslash include caret, space, tab and the backslash itself. .PP An action may be followed by an "extra" string. When such a command is entered while running .I less, the action is performed, and then the extra string is parsed, just as if it were typed in to .I less. This feature can be used in certain cases to extend the functionality of a command. For example, see the "{" and ":t" commands in the example below. The extra string has a special meaning for the "quit" action: when .I less quits, first character of the extra string is used as its exit status. .SH EXAMPLE The following input file describes the set of default command keys used by less: .sp .nf #command \er forw-line \en forw-line e forw-line j forw-line \ekd forw-line ^E forw-line ^N forw-line k back-line y back-line ^Y back-line ^K back-line ^P back-line J forw-line-force K back-line-force Y back-line-force d forw-scroll ^D forw-scroll u back-scroll ^U back-scroll \e40 forw-screen f forw-screen ^F forw-screen ^V forw-screen \ekD forw-screen b back-screen ^B back-screen \eev back-screen \ekU back-screen z forw-window w back-window \ee\e40 forw-screen-force F forw-forever R repaint-flush r repaint ^R repaint ^L repaint \eeu undo-hilite g goto-line \ekh goto-line < goto-line \ee< goto-line p percent % percent \ee[ left-scroll \ee] right-scroll \ee( left-scroll \ee) right-scroll { forw-bracket {} } back-bracket {} ( forw-bracket () ) back-bracket () [ forw-bracket [] ] back-bracket [] \ee^F forw-bracket \ee^B back-bracket G goto-end \ee> goto-end > goto-end \eke goto-end = status ^G status :f status / forw-search ? back-search \ee/ forw-search * \ee? back-search * n repeat-search \een repeat-search-all N reverse-search \eeN reverse-search-all m set-mark ' goto-mark ^X^X goto-mark E examine :e examine ^X^V examine :n next-file :p prev-file t next-tag T prev-tag :x index-file :d remove-file - toggle-option :t toggle-option t s toggle-option o _ display-option | pipe v visual ! shell + firstcmd H help h help V version 0 digit 1 digit 2 digit 3 digit 4 digit 5 digit 6 digit 7 digit 8 digit 9 digit q quit Q quit :q quit :Q quit ZZ quit .fi .sp .SH PRECEDENCE Commands specified by .I lesskey take precedence over the default commands. A default command key may be disabled by including it in the input file with the action "invalid". Alternatively, a key may be defined to do nothing by using the action "noaction". "noaction" is similar to "invalid", but .I less will give an error beep for an "invalid" command, but not for a "noaction" command. In addition, ALL default commands may be disabled by adding this control line to the input file: .sp #stop .sp This will cause all default commands to be ignored. The #stop line should be the last line in that section of the file. .PP Be aware that #stop can be dangerous. Since all default commands are disabled, you must provide sufficient commands before the #stop line to enable all necessary actions. For example, failure to provide a "quit" command can lead to frustration. .SH "LINE EDITING SECTION" The line-editing section begins with the line: .sp #line-edit .sp This section specifies new key bindings for the line editing commands, in a manner similar to the way key bindings for ordinary commands are specified in the #command section. The line-editing section consists of a list of keys and actions, one per line as in the example below. .SH EXAMPLE The following input file describes the set of default line-editing keys used by less: .sp .nf #line-edit \et forw-complete \e17 back-complete \ee\et back-complete ^L expand ^V literal ^A literal \eel right \ekr right \eeh left \ekl left \eeb word-left \ee\ekl word-left \eew word-right \ee\ekr word-right \eei insert \eex delete \ekx delete \eeX word-delete \eekx word-delete \ee\eb word-backspace \ee0 home \ekh home \ee$ end \eke end \eek up \eku up \eej down .fi .sp .SH "LESS ENVIRONMENT VARIABLES" The environment variable section begins with the line .sp #env .sp Following this line is a list of environment variable assignments. Each line consists of an environment variable name, an equals sign (=) and the value to be assigned to the environment variable. White space before and after the equals sign is ignored. Variables assigned in this way are visible only to .I less. If a variable is specified in the system environment and also in a lesskey file, the value in the lesskey file takes precedence. Although the lesskey file can be used to override variables set in the environment, the main purpose of assigning variables in the lesskey file is simply to have all .I less configuration information stored in one file. .SH EXAMPLE The following input file sets the -i option whenever .I less is run, and specifies the character set to be "latin1": .sp .nf #env LESS = -i LESSCHARSET = latin1 .fi .sp .SH "SEE ALSO" less(1) .SH WARNINGS It is not possible to specify special keys, such as uparrow, in a keyboard-independent manner. The only way to specify such keys is to specify the escape sequence which a particular keyboard sends when such a key is pressed. .PP On MS-DOS and OS/2 systems, certain keys send a sequence of characters which start with a NUL character (0). This NUL character should be represented as \e340 in a lesskey file. .SH COPYRIGHT Copyright (C) 2000-2007 Mark Nudelman .PP lesskey is part of the GNU project and is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. .PP lesskey is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .PP You should have received a copy of the GNU General Public License along with lesskey; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. .SH AUTHOR .PP Mark Nudelman .br Send bug reports or comments to the above address or to bug-less@gnu.org. Index: vendor/less/dist/contrib/less/version.c =================================================================== --- vendor/less/dist/contrib/less/version.c (revision 172596) +++ vendor/less/dist/contrib/less/version.c (revision 172597) @@ -1,700 +1,701 @@ /* * Copyright (C) 1984-2007 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. * * For more information about less, or for information on how to * contact the author, see the README file. */ /* ----------------------- CHANGE HISTORY -------------------------- 1/29/84 Allowed use on standard input 2/1/84 Added E, N, P commands 4/17/84 Added '=' command, 'stop' signal handling 4/20/84 Added line folding v2 4/27/84 Fixed '=' command to use BOTTOM_PLUS_ONE, instead of TOP, added 'p' & 'v' commands v3 5/3/84 Added -m and -t options, '-' command v4 5/3/84 Added LESS environment variable v5 5/3/84 New comments, fixed '-' command slightly v6 5/15/84 Added -Q, visual bell v7 5/24/84 Fixed jump_back(n) bug: n should count real lines, not folded lines. Also allow number on G command. v8 5/30/84 Re-do -q and -Q commands v9 9/25/84 Added "+" argument v10 10/10/84 Fixed bug in -b argument processing v11 10/18/84 Made error() ring bell if \n not entered. ----------------------------------------------------------------- v12 2/13/85 Reorganized signal handling and made portable to 4.2bsd. v13 2/16/85 Reword error message for '-' command. v14 2/22/85 Added -bf and -bp variants of -b. v15 2/25/85 Miscellaneous changes. v16 3/13/85 Added -u flag for backspace processing. v17 4/13/85 Added j and k commands, changed -t default. v18 4/20/85 Rewrote signal handling code. v19 5/2/85 Got rid of "verbose" eq_message(). Made search() scroll in some cases. v20 5/21/85 Fixed screen.c ioctls for System V. v21 5/23/85 Fixed some first_cmd bugs. v22 5/24/85 Added support for no RECOMP nor REGCMP. v23 5/25/85 Miscellanous changes and prettying up. Posted to USENET. ----------------------------------------------------------------- v24 6/3/85 Added ti,te terminal init & de-init. (Thanks to Mike Kersenbrock) v25 6/8/85 Added -U flag, standout mode underlining. v26 6/9/85 Added -M flag. Use underline termcap (us) if it exists. v27 6/15/85 Renamed some variables to make unique in 6 chars. Minor fix to -m. v28 6/28/85 Fixed right margin bug. v29 6/28/85 Incorporated M.Rose's changes to signal.c v30 6/29/85 Fixed stupid bug in argument processing. v31 7/15/85 Added -p flag, changed repaint algorithm. Added kludge for magic cookie terminals. v32 7/16/85 Added cat_file if output not a tty. v33 7/23/85 Added -e flag and EDITOR. v34 7/26/85 Added -s flag. v35 7/27/85 Rewrote option handling; added option.c. v36 7/29/85 Fixed -e flag to work if not last file. v37 8/10/85 Added -x flag. v38 8/19/85 Changed prompting; created prompt.c. v39 8/24/85 (Not -p) does not initially clear screen. v40 8/26/85 Added "skipping" indicator in forw(). Posted to USENET. ----------------------------------------------------------------- v41 9/17/85 ONLY_RETURN, control char commands, faster search, other minor fixes. v42 9/25/85 Added ++ command line syntax; ch_fsize for pipes. v43 10/15/85 Added -h flag, changed prim.c algorithms. v44 10/16/85 Made END print in all cases of eof; ignore SIGTTOU after receiv ing SIGTSTP. v45 10/16/85 Never print backspaces unless -u. v46 10/24/85 Backwards scroll in jump_loc. v47 10/30/85 Fixed bug in edit(): *first_cmd==0 v48 11/16/85 Use TIOCSETN instead of TIOCSETP. Added marks (m and ' commands). Posted to USENET. ----------------------------------------------------------------- v49 1/9/86 Fixed bug: signal didn't clear mcc. v50 1/15/86 Added ' (quote) to gomark. v51 1/16/86 Added + cmd, fixed problem if first_cmd fails, made g cmd sort of "work" on pipes ev en if bof is no longer buffered. v52 1/17/86 Made short files work better. v53 1/20/86 Added -P option. v54 1/20/86 Changed help to use HELPFILE. v55 1/23/86 Messages work better if not tty output. v56 1/24/86 Added -l option. v57 1/31/86 Fixed -l to get confirmation before ov erwriting an existing file. v58 8/28/86 Added filename globbing. v59 9/15/86 Fixed some bugs with very long filenames. v60 9/26/86 Incorporated changes from Leith (Casey) Leedom for boldface and -z option. v61 9/26/86 Got rid of annoying repaints after ! cmd. Posted to USENET. ----------------------------------------------------------------- v62 12/23/86 Added is_directory(); change -z default to -1 instead of 24; cat-and-exit if -e and file is less than a screenful. v63 1/8/87 Fixed bug in cat-and-exit if > 1 file. v64 1/12/87 Changed puts/putstr, putc/putchr, getc/getchr to av oid name conflict with stdio functions. v65 1/26/87 Allowed '-' command to change NUMBER v alued options (thanks to Gary Puckering) v66 2/13/87 Fixed bug: prepaint should use force=1. v67 2/24/87 Added !! and % expansion to ! command. v68 2/25/87 Added SIGWINCH and TIOCGWINSZ support; changed is_directory to bad_file. (thanks to J. Robert Ward) v69 2/25/87 Added SIGWIND and WIOCGETD (for Unix PC). v70 3/13/87 Changed help cmd from 'h' to 'H'; better error msgs in bad_file, errno_message. v71 5/11/87 Changed -p to -c, made triple -c/-C for clear-eol like more's -c. v72 6/26/87 Added -E, -L, use $SHELL in lsystem(). (thanks to Stev e Spearman) v73 6/26/87 Allow Examine "#" for previous file. Posted to USENET 8/25/87. ----------------------------------------------------------------- v74 9/18/87 Fix conflict in EOF symbol with stdio.h, Make os.c more portable to BSD. v75 9/23/87 Fix problems in get_term (thanks to Paul Eggert); new backwards scrolling in jump_loc (thanks to Marion Hakanson). v76 9/23/87 Added -i flag; allow single "!" to inv oke a shell (thanks to Franco Barber). v77 9/24/87 Added -n flag and line number support. v78 9/25/87 Fixed problem with prompts longer than the screen width. v79 9/29/87 Added the _ command. v80 10/6/87 Allow signal to break out of linenum scan. v81 10/6/87 Allow -b to be changed from within less. v82 10/7/87 Add cmd_decode to use a table for key binding (thanks to Dav id Nason). v83 10/9/87 Allow .less file for user-defined keys. v84 10/11/87 Fix -e/-E problems (thanks to Felix Lee). v85 10/15/87 Search now keeps track of line numbers. v86 10/20/87 Added -B option and autobuf; fixed "pipe error" bug. v87 3/1/88 Fix bug re BSD signals while reading file. v88 3/12/88 Use new format for -P option (thanks to der Mouse), allow "+-c" without message, fix bug re BSD hangup. v89 3/18/88 Turn off line numbers if linenum scan is interrupted. v90 3/30/88 Allow -P from within less. v91 3/30/88 Added tags file support (new -t option) (thanks to Brian Campbell). v92 4/4/88 Added -+option syntax. v93 4/11/88 Add support for slow input (thanks to Joe Orost & apologies for taking almost 3 years to get this in!) v94 4/11/88 Redo reading/signal stuff. v95 4/20/88 Repaint screen better after signal. v96 4/21/88 Add /! and ?! commands. v97 5/17/88 Allow -l/-L from within less. Eliminate some static arrays (use calloc). Posted to USENET. ----------------------------------------------------------------- v98 10/14/88 Fix incorrect calloc call; uninitialized var in exec_mca; core dump on unknown TERM. Make v cmd work if past last line of file. Fix some signal bugs. v99 10/29/88 Allow space between -X and string, when X is a string-valued option. v100 1/5/89 Fix globbing bug when $SHELL not set; allow spaces after -t command. v101 1/6/89 Fix problem with long (truncated) lines in tags file (thanks to Neil Dixon). v102 1/6/89 Fix bug with E# when no prev file; allow spaces after -l command. v103 3/14/89 Add -N, -f and -? options. Add z and w commands. Add %L for prompt strings. v104 3/16/89 Added EDITPROTO. v105 3/20/89 Fix bug in find_linenum which cached incorrectly on long lines. v106 3/31/89 Added -k option and multiple lesskey files. v107 4/27/89 Add 8-bit char support and -g option. Split option code into 3 files. v108 5/5/89 Allocate position table dynamically (thanks to Paul Eggert); change % command from "percent" to vi-style brace finder. v109 5/10/89 Added ESC-% command, split prim.c. v110 5/24/89 Fixed bug in + option; fixed repaint bug under Sun windows (thanks to Paul Eggert). v111 5/25/89 Generalized # and % expansion; use calloc for some error messages. v112 5/30/89 Get rid of ESC-%, add {}()[] commands. v113 5/31/89 Optimize lseeks (thanks to Paul Eggert). v114 7/25/89 Added ESC-/ and ESC-/! commands. v115 7/26/89 Added ESC-n command. v116 7/31/89 Added find_pos to optimize g command. v117 8/1/89 Change -f option to -r. v118 8/2/89 Save positions for all previous files, not just the immediately previous one. v119 8/7/89 Save marks across file boundaries. Add file handle stuff. v120 8/11/89 Add :ta command. v121 8/16/89 Add -f option. v122 8/30/89 Fix performance with many buffers. v123 8/31/89 Verbose prompts for string options. Posted beta to USENET. ----------------------------------------------------------------- v124 9/18/89 Reorganize search commands, N = rev, ESC-n = span, add ESC-N. v125 9/18/89 Fix tab bug (thanks to Alex Liu). Fix EOF bug when both -w and -c. v126 10/25/89 Add -j option. v127 10/27/89 Fix problems with blank lines before BOF. v128 10/27/89 Add %bj, etc. to prompt strings. v129 11/3/89 Add -+,-- commands; add set-option and unset-option to lesskey. v130 11/6/89 Generalize A_EXTRA to string, remove set-option, unset-option from lesskey. v131 11/7/89 Changed name of EDITPROTO to LESSEDIT. v132 11/8/89 Allow editing of command prefix. v133 11/16/89 Add -y option (thanks to Jeff Sullivan). v134 12/1/89 Glob filenames in the -l command. v135 12/5/89 Combined {}()[] commands into one, and added ESC-^F and ESC-^B commands. v136 1/20/90 Added -S, -R flags. Added | command. Added warning for binary files. (thanks to Richard Brittain and J. Sullivan). v137 1/21/90 Rewrote horrible pappend code. Added * notation for hi-bit chars. v138 1/24/90 Fix magic cookie terminal handling. Get rid of "cleanup" loop in ch_get. v139 1/27/90 Added MSDOS support. (many thanks to Richard Brittain). v140 2/7/90 Editing a new file adds it to the command line list. v141 2/8/90 Add edit_list for editing >1 file. v142 2/10/90 Add :x command. v143 2/11/90 Add * and @ modifies to search cmds. Change ESC-/ cmd from /@* to / *. v144 3/1/90 Messed around with ch_zero; no real change. v145 3/2/90 Added -R and -v/-V for MSDOS; renamed FILENAME to avoid conflict. v146 3/5/90 Pull cmdbuf functions out of command.c v147 3/7/90 Implement ?@; fix multi-file edit bugs. v148 3/29/90 Fixed bug in :e then :e#. v149 4/3/90 Change error,ierror,query to use PARG. v150 4/6/90 Add LESS_CHARSET, LESS_CHARDEF. v151 4/13/90 Remove -g option; clean up ispipe. v152 4/14/90 lsystem() closes input file, for editors which require exclusive open. v153 4/18/90 Fix bug if SHELL unset; fix bug in overstrike control char. v154 4/25/90 Output to fd 2 via buffer. v155 4/30/90 Ignore -i if uppercase in pattern (thanks to Michael Rendell.) v156 5/3/90 Remove scroll limits in forw() & back(); causes problems with -c. v157 5/4/90 Forward search starts at next real line (not screen line) after jump target. v158 6/14/90 Added F command. v159 7/29/90 Fix bug in exiting: output not flushed. v160 7/29/90 Clear screen before initial output w/ -c. v161 7/29/90 Add -T flag. v162 8/14/90 Fix bug with +F on command line. v163 8/21/90 Added LESSBINFMT variable. v164 9/5/90 Added -p, LINES, COLUMNS and unset mark ' == BOF, for 1003.2 D5. v165 9/6/90 At EOF with -c set, don't display empty screen when try to page forward. v166 9/6/90 Fix G when final line in file wraps. v167 9/11/90 Translate CR/LF -> LF for 1003.2. v168 9/13/90 Return to curr file if "tag not found". v169 12/12/90 G goes to EOF even if file has grown. v170 1/17/91 Add optimization for BSD _setjmp; fix #include ioctl.h TERMIO problem. (thanks to Paul Eggert) Posted to USENET. ----------------------------------------------------------------- v171 3/6/91 Fix -? bug in get_filename. v172 3/15/91 Fix G bug in empty file. Fix bug with ?\n and -i and uppercase pattern at EOF! (thanks to Paul Eggert) v173 3/17/91 Change N cmd to not permanently change direction. (thanks to Brian Matthews) v174 3/18/91 Fix bug with namelogfile not getting cleared when change files. v175 3/18/91 Fix bug with ++cmd on command line. (thanks to Jim Meyering) v176 4/2/91 Change | to not force current screen, include marked line, start/end from top of screen. Improve search speed. (thanks to Don Mears) v177 4/2/91 Add LESSHELP variable. Fix bug with F command with -e. Try /dev/tty for input before using fd 2. Patches posted to USENET 4/2/91. ----------------------------------------------------------------- v178 4/8/91 Fixed bug in globbing logfile name. (thanks to Jim Meyering) v179 4/9/91 Allow negative -z for screen-relative. v180 4/9/91 Clear to eos rather than eol if "db"; don't use "sr" if "da". (thanks to Tor Lillqvist) v181 4/18/91 Fixed bug with "negative" chars 80 - FF. (thanks to Benny Sander Hofmann) v182 5/16/91 Fixed bug with attribute at EOL. (thanks to Brian Matthews) v183 6/1/91 Rewrite linstall to do smart config. v184 7/11/91 Process \b in searches based on -u rather than -i. v185 7/11/91 -Pxxx sets short prompt; assume SIGWINCH after a SIGSTOP. (thanks to Ken Laprade) ----------------------------------------------------------------- v186 4/20/92 Port to MS-DOS (Microsoft C). v187 4/23/92 Added -D option & TAB_COMPLETE_FILENAME. v188 4/28/92 Added command line editing features. v189 12/8/92 Fix mem overrun in anscreen.c:init; fix edit_list to recover from bin file. v190 2/13/93 Make TAB enter one filename at a time; create ^L with old TAB functionality. v191 3/10/93 Defer creating "flash" page for MS-DOS. v192 9/6/93 Add BACK-TAB. v193 9/17/93 Simplify binary_file handling. v194 1/4/94 Add rudiments of alt_filename handling. v195 1/11/94 Port back to Unix; support keypad. ----------------------------------------------------------------- v196 6/7/94 Fix bug with bad filename; fix IFILE type problem. (thanks to David MacKenzie) v197 6/7/94 Fix bug with .less tables inserted wrong. v198 6/23/94 Use autoconf installation technology. (thanks to David MacKenzie) v199 6/29/94 Fix MS-DOS build (thanks to Tim Wiegman). v200 7/25/94 Clean up copyright, minor fixes. Posted to prep.ai.mit.edu ----------------------------------------------------------------- v201 7/27/94 Check for no memcpy; add casts to calloc; look for regcmp in libgen.a. (thanks to Kaveh Ghazi). v202 7/28/94 Fix bug in edit_next/edit_prev with non-existant files. v203 8/2/94 Fix a variety of configuration bugs on various systems. (thanks to Sakai Kiyotaka, Harald Koenig, Bjorn Brox, Teemu Rantanen, and Thorsten Lockert) v204 8/3/94 Use strerror if available. (thanks to J.T. Conklin) v205 8/5/94 Fix bug in finding "me" termcap entry. (thanks to Andreas Stolcke) 8/10/94 v205+: Change BUFSIZ to LBUFSIZE to avoid name conflict with stdio.h. Posted to prep.ai.mit.edu ----------------------------------------------------------------- v206 8/10/94 Use initial_scrpos for -t to avoid displaying first page before init(). (thanks to Dominique Petitpierre) v207 8/12/94 Fix bug if stdout is not tty. v208 8/16/94 Fix bug in close_altfile if goto err1 in edit_ifile. (Thanks to M.J. Hewitt) v209 8/16/94 Change scroll to wscroll to avoid conflict with library function. v210 8/16/94 Fix bug with bold on 8 bit chars. (thanks to Vitor Duarte) v211 8/16/94 Don't quit on EOI in jump_loc / forw. v212 8/18/94 Use time_t if available. v213 8/20/94 Allow ospeed to be defined in termcap.h. v214 8/20/94 Added HILITE_SEARCH, -F, ESC-u cmd. (thanks to Paul Lew and Bob Byrnes) v215 8/23/94 Fix -i toggle behavior. v216 8/23/94 Process BS in all searches, not only -u. v217 8/24/94 Added -X flag. v218 8/24/94 Reimplement undo_search. v219 8/24/94 Find tags marked with line number instead of pattern. v220 8/24/94 Stay at same position after SIG_WINCH. v221 8/24/94 Fix bug in file percentage in big file. v222 8/25/94 Do better if can't reopen current file. v223 8/27/94 Support setlocale. (thanks to Robert Joop) v224 8/29/94 Revert v216: process BS in search only if -u. v225 9/6/94 Rewrite undo_search again: toggle. v226 9/15/94 Configuration fixes. (thanks to David MacKenzie) v227 9/19/94 Fixed strerror config problem. Posted to prep.ai.mit.edu ----------------------------------------------------------------- v228 9/21/94 Fix bug in signals: repeated calls to get_editkeys overflowed st_edittable. v229 9/21/94 Fix "Nothing to search" error if -a and SRCH_PAST_EOF. v230 9/21/94 Don't print extra error msg in search after regerror(). v231 9/22/94 Fix hilite bug if search matches 0 chars. (thanks to John Polstra) v232 9/23/94 Deal with weird systems that have termios.h but not tcgetattr(). Posted to prep.ai.mit.edu ----------------------------------------------------------------- v233 9/26/94 Use get_term() instead of pos_init() in psignals to re-get lower_left termcap. (Thanks to John Malecki) v234 9/26/94 Make MIDDLE closer to middle of screen. v235 9/27/94 Use local strchr if system doesn't have. v236 9/28/94 Don't use libucb; use libterm if libtermcap & libcurses doesn't work. (Fix for Solaris; thanks to Frank Kaefer) v237 9/30/94 Use system isupper() etc if provided. Posted to prep.ai.mit.edu ----------------------------------------------------------------- v238 10/6/94 Make binary non-blinking if LESSBINFMT is set to a string without a *. v239 10/7/94 Don't let delimit_word run back past beginning of cmdbuf. v240 10/10/94 Don't write into termcap buffer. (Thanks to Benoit Speckel) v241 10/13/94 New lesskey file format. Don't expand filenames in search command. v242 10/14/94 Allow lesskey specification of "literal". v243 10/14/94 Add #stop command to lesskey. v244 10/16/94 Add -f flag to lesskey. v245 10/25/94 Allow TAB_COMPLETE_FILENAME to be undefd. v246 10/27/94 Move help file to /usr/local/share. v247 10/27/94 Add -V option. v248 11/5/94 Add -V option to lesskey. v249 11/5/94 Remove -f flag from lesskey; default input file is ~/.lesskey.in, not stdin. v250 11/7/94 Lesskey input file "-" means stdin. v251 11/9/94 Convert cfgetospeed result to ospeed. (Thanks to Andrew Chernov) v252 11/16/94 Change default lesskey input file from .lesskey.in to .lesskey. Posted to prep.ai.mit.edu ----------------------------------------------------------------- v253 11/21/94 Fix bug when tags file has a backslash. v254 12/6/94 Fix -k option. v255 12/8/94 Add #define EXAMINE to disable :e etc. v256 12/10/94 Change highlighting: only highlite search results (but now it is reliable). v257 12/10/94 Add goto_line and repaint_highlight to optimize highlight repaints. v258 12/12/94 Fixup in hilite_line if BS_SPECIAL. v259 12/12/94 Convert to autoconf 2.0. v260 12/13/94 Add SECURE define. v261 12/14/94 Use system WERASE char as EC_W_BACKSPACE. v262 12/16/94 Add -g/-G flag and screen_hilite. v263 12/20/94 Reimplement/optimize -G flag behavior. v264 12/23/94 Allow EXTRA string after line-edit cmd in lesskey file. v265 12/24/94 Add LESSOPEN=|cmd syntax. v266 12/26/94 Add -I flag. v267 12/28/94 Formalize the four-byte header emitted by a LESSOPEN pipe. v268 12/28/94 Get rid of four-byte header. v269 1/2/95 Close alt file before open new one. Avoids multiple popen(). v270 1/3/95 Use VISUAL; use S_ISDIR/S_ISREG; fix config problem with Solaris POSIX regcomp. v271 1/4/95 Don't quit on read error. v272 1/5/95 Get rid of -L. v273 1/6/95 Fix ch_ungetchar bug; don't call LESSOPEN on a pipe. v274 1/6/95 Ported to OS/2 (thanks to Kai Uwe Rommel) v275 1/18/95 Fix bug if toggle -G at EOF. v276 1/30/95 Fix OS/2 version. v277 1/31/95 Add "next" charset; don't display ^X for X > 128. v278 2/14/95 Change default for -G. Posted to prep.ai.mit.edu ----------------------------------------------------------------- v279 2/22/95 Add GNU options --help, --version. Minor config fixes. v280 2/24/95 Clean up calls to glob(); don't set # if we can't open the new file. v281 2/24/95 Repeat search should turn on hilites. v282 3/2/95 Minor fixes. v283 3/2/95 Fix homefile; make OS2 look in $HOME. v284 3/2/95 Error if "v" on LESSOPENed file; "%" figures out file size on pipe. v285 3/7/95 Don't set # in lsystem; lesskey try $HOME first. v286 3/7/95 Reformat change history (too much free time?). v287 3/8/95 Fix hilite bug if overstrike multiple chars. v288 3/8/95 Allow lesskey to override get_editkey keys. v289 3/9/95 Fix adj_hilite bug when line gets processed by hilite_line more than once. v290 3/9/95 Make configure automatically. Fix Sequent problem with incompatible sigsetmask(). Posted to prep.ai.mit.edu ----------------------------------------------------------------- v291 3/21/95 Add #env to lesskey. Fix MS-DOS build. Posted to simtel. ----------------------------------------------------------------- v292 4/24/95 Add MS-DOS support for Borland C. Fix arrow keys in MS-DOS versions. v293 4/28/95 Add auto-versioning stuff to make dist. v294 5/12/95 Fix Borland build. 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. v299 1/25/96 Fix percent overflow in jump_percent (thanks to Brent Wiese); don't send "ti" after shell command till RETURN pressed. v300 1/25/96 Change -U to print tabs as ^I. v301 1/30/96 Make hilites work in cmd F output. v302 1/31/96 Fix cmd F to notice window-change signals. v303 1/31/96 Add ESC-SPACE command. v304 2/1/96 Add ^R search modifier; add LESSSECURE. v305 2/2/96 Workaround Linux /proc kernel bug; add LESSKEY. v306 3/16/96 Minor fixes. v307 3/25/96 Allow cmd line arg "--"; fix DOS & OS/2 defines.h. v308 4/4/96 Port to OS-9 (thanks to Boisy Pitre); fix -d. v309 4/9/96 Fix OS-9 version; fix tags bug with "$". v310 4/10/96 Get rid of HELPFILE. v311 4/22/96 Add Windows32 support; merge doscreen.c into screen.c. v312 4/24/96 Don't quit after "cannot reopen" error. v313 4/25/96 Added horizontal scrolling. v314 4/26/96 Modified -e to quit on reaching end of a squished file. v315 4/26/96 Fix "!;TAB" bug. v316 5/2/96 Make "|a" when (a < curr screen) go to end of curr screen. v317 5/14/96 Various fixes for the MS-DOS and OS/2 builds. Added ## and %% handling for filenames v318 5/29/96 Port to OS-9 Microware compiler; minor fixes (thanks to Martin Gregorie). v319 7/8/96 Fix Windows port (thanks to Jeff Paquette). v320 7/11/96 Final fixes for Windows port. v321 7/18/96 Minor fixes. Posted to Web page. ----------------------------------------------------------------- v322 8/13/96 Fix bug in shell escape from help file; add support for Microsoft Visual C under Windows; numerous small fixes. v323 8/19/96 Fixes for Windows version (thanks to Simon Munton); fix for Linux library weirdness (thanks to Jim Diamond); port to DJGPP (thanks to Eli Zaretskii). v324 8/21/96 Add support for spaces in filenames (thanks to Simon Munton). v325 8/21/96 Add lessecho, for spaces in filenames under Unix. v326 8/27/96 Fix DJGPP version. v327 9/1/96 Reorganize lglob, make spaces in filenames work better in Unix. v328 10/7/96 Append / to directory name in filename completion. Fix MS-DOS and OS-9 versions. v329 10/11/96 Fix more MS-DOS bugs; add LESSSEPARATOR; add -" option. Add LESSMETACHARS, LESSMETAESCAPE. v330 10/21/96 Minor fixes. Posted to Web page. ----------------------------------------------------------------- v331 4/22/97 Various Windows fixes (thanks to Gurusamy Sarathy). v332 4/22/97 Enter filenames from cmd line into edit history. Posted to Web page. ----------------------------------------------------------------- v333 3/4/99 Changed -w to highlite new line after forward movement. v334 3/9/99 Avoid overflowing prompt buffer; add %d and %D. v335 3/20/99 Add EBCDIC support (thanks to Thomas Dorner). Use HOMEDRIVE/HOMEPATH on Windows (thanks to Preston Bannister). Posted to Web page. ----------------------------------------------------------------- v336 4/8/99 Fix installation bugs. v337 4/9/99 Fix another installation bug. Posted to Web page. ----------------------------------------------------------------- v338 4/13/99 Add support for long option names. v339 4/18/99 Add \k, long option names to lesskey. Add -^P. Add :d. v340 4/21/99 Add regexec2. Fix Windows build. Posted to Web page. ----------------------------------------------------------------- v341 5/6/99 Add -F option; %c & ?c prompt escapes. (Thanks to Michele Maltoni) v342 7/22/99 Add system-wide lesskey file; allow GPL or Less License. v343 9/23/99 Support UTF-8 (Thanks to Robert Brady). Add %P and ?P in prompts. v344 10/27/99 -w highlights target line of g and p commands. v345 10/29/99 Make -R pass thru ESC but not other control chars. Posted to Web page. ----------------------------------------------------------------- v346 11/4/99 Fix bugs in long option processing; R cmd should clear hilites. Posted to Web page. ----------------------------------------------------------------- v347 12/13/99 Fixes for DJGPP version (thanks to Eli Zaretskii). v348 12/28/99 Fix deleting file with marks (thanks to Dimitar Jekov). Fix color problem in DJGPP version (thanks to Eli Zaretskii). v349 1/24/00 Fix minor DJGPP bugs; check environment vars for UTF-8; add --with-editor (thanks to Eli, Markus Kuhn, Thomas Schoepf). v350 3/1/00 Fix clear-while-standout bug. v351 3/5/00 Change -M and = prompts to show top & bottom line number. Posted to Web page. ----------------------------------------------------------------- v352 3/8/00 Fix scan_option NULL dereference. ----------------------------------------------------------------- v353 3/20/00 Fix SECURE compile bug, allow space after numeric option. v354 3/23/00 Add support for PCRE; add --with-regex configure option. ----------------------------------------------------------------- v355 6/28/00 Add -# option (thanks to Andy Levinson). v356 7/5/00 Add -J option. v357 7/6/00 Support sigprocmask. ----------------------------------------------------------------- v358 7/8/00 Fix problems with #stop in lesskey file. Posted to Web page. ----------------------------------------------------------------- v359 9/10/00 Fixes for Win32 display problems (thanks to Maurizio Vairani). v360 1/17/01 Move sysless to etc. v361 12/4/01 Add IBM-1047 charset & EBCDIC fixes (thanks to Thomas Dorner). Fix 32 bit dependencies (thanks to Paul Eggert). Fix UTF-8 overstriking (thanks to Robert Brady). v362 12/4/01 Make status column show search targets. v363 12/6/01 Add --no-keypad option. Add variable width tabstops (thanks to Peter Samuelson). v364 12/10/01 Better handling of very long lines in input; Fix horizontal shifting of colored text. v365 12/11/01 Fix overstriking of tabs; Add support for global(1) and multiple tag matches (thanks to Shigio Yamaguchi and Tim Vanderhoek). v366 12/11/01 Fixes for OS/2 (thanks to Kyosuke Tokoro). v367 12/13/01 Allow -D and -x options to terminate without dollar sign; Right/left arrow when entering N are shift cmds, not line edit. v368 12/18/01 Update lesskey commands. v370 12/23/01 Fix tags error messages. Posted to Web page. ----------------------------------------------------------------- v371 12/26/01 Fix new_file bug; use popen in Windows version; fix some compiler warnings. v372 12/29/01 Make -b be in units of 1K. v373 1/14/02 Improve handling of filenames containing shell metachars. v374 2/7/02 Fix memory leak; fix bug in -x argument parsing. v375 4/7/02 Fix searching for SGR sequences; fix SECURE build; add SGR support to DJGPP version (thanks to Eli Zaretskii). v376 6/10/02 Fix bug in overstriking mulitbyte UTF-8 characters (thanks to Jungshik Shin). Posted to Web page. ----------------------------------------------------------------- v377 9/10/02 Fix bug in Windows version when file contains CR; fix bug in search highlights with -R; make initial buffer limit really be 64K not unlimited. v378 9/30/02 Misc bug fixes and compiler warning cleanup. Posted to Web page. ----------------------------------------------------------------- v379 11/23/02 Add -L option; fix bug with ctrl-K in lesskey files; improve UTF-8 overstriking and underscore overstriking; fix minor man page problems; change to autoconf 2.54. v380 11/24/02 Make LINENUM same as POSITION. v381 11/28/02 Make -N use 7 columns for line number if possible. ----------------------------------------------------------------- v382 2/3/04 Remove copyrighted code. ----------------------------------------------------------------- v383 2/16/04 Add history file; add -K option; improve UTF-8 handling; fix some signed char bugs (thanks to Christian Biere); fix some upper/lower case bugs (thanks to Bjoern Jacke); add erase2 char (thanks to David Lawrence); add windows charset (thanks to Dimitar Zhekov). v384 2/20/04 Improvements in UTF-8 handling. v385 2/23/04 Fix UTF-8 output bug. ----------------------------------------------------------------- v386 9/13/05 Improvements to UTF-8 shift & color (thanks to Charles Levert); protect against invalid LESSOPEN and LESSCLOSE values. v387 9/14/05 Update Charles Levert's UTF-8 patch. v388 9/14/05 Change history behavior; change most sprintf calls to snprintf. v389 9/14/05 Fix copy & paste with long lines; improve performance of expand_linebuf; fix crash in init_mlist; v390 9/15/05 Show search matches in status column even if -G is set. ----------------------------------------------------------------- v391 9/17/05 Fix bugs. v392 10/14/05 Fix line wrapping bug. v393 10/19/05 Allow multiple attributes per char; fix bold+underline bug (thanks again to Charles Levert). v394 11/8/05 Fix prompt bug; fix compile problem in Windows build. ----------------------------------------------------------------- v395 1/12/07 Update Unicode tables (thanks to Charles Levert); don't chmod if LESSHISTFILE = /dev/null; make -f work for directories; support DESTDIR in Makefile; fix sigset_t detection in configure; make "t" cmd traverse tags in correct order v396 1/13/07 Add compatibility with POSIX more. v397 3/21/07 Allow decimal point in number for % command; Allow decimal point in number for -j option; Allow n command to fetch last search pattern from history (thanks to arno). v398 3/22/07 Don't rewrite history file if not necessary; fix bug when filenames contain "$". v399 3/22/07 Don't move to bottom of screen at startup; don't output extraneous newlines. v400 3/23/07 Allow search to find pattern after null byte (PCRE and no-regex) (thanks to Michael Constant). ----------------------------------------------------------------- v401 3/24/07 Minor documentation fixes. v402 3/30/07 Fix autoconf bug when memcpy etc are inline; fix bug in terminating number following -j option. v403 5/25/07 Fix Windows build. v404 6/5/07 Fix display bug with F command and long lines. v405 6/17/07 Fix display bug when using -w option. v406 6/17/07 Fix secure build. v407 8/16/07 Fix bugs; support CSI chars. v408 10/1/07 Fix bug in -i with non-ASCII chars. +v409 10/12/07 Fix crash when viewing text with invalid UTF-8 sequences. */ -char version[] = "408"; +char version[] = "409";