Mercurial > octave-nkf
diff src/pager.cc @ 2097:19ba1a7dcfbb
[project @ 1996-04-28 10:40:15 by jwe]
author | jwe |
---|---|
date | Sun, 28 Apr 1996 10:42:14 +0000 |
parents | 0b7c868bc4df |
children | debe20e17d64 |
line wrap: on
line diff
--- a/src/pager.cc Sun Apr 28 10:12:19 1996 +0000 +++ b/src/pager.cc Sun Apr 28 10:42:14 1996 +0000 @@ -309,6 +309,44 @@ return retval; } +static string +default_pager (void) +{ + string pager_binary; + + char *pgr = getenv ("PAGER"); + + if (pgr) + pager_binary = string (pgr); +#ifdef DEFAULT_PAGER + else + { + pager_binary = string (DEFAULT_PAGER); + + if (pager_binary == "less") + { + pager_binary.append (" -e"); + + if (! getenv ("LESS")) + pager_binary.append + (" -P-- less ?pB(%pB\%):--. (f)orward, (b)ack, (q)uit$"); + } + } +#endif + + return pager_binary; +} + +void +symbols_of_pager (void) +{ + DEFVAR (PAGER, default_pager (), 0, sv_pager_binary, + "path to pager binary"); + + DEFVAR (page_screen_output, 1.0, 0, page_screen_output, + "if possible, send output intended for the screen through the pager"); +} + /* ;;; Local Variables: *** ;;; mode: C++ ***