# HG changeset patch # User jwe # Date 830688134 0 # Node ID 19ba1a7dcfbb8ee7c2e5be52c21675da3680d744 # Parent 91c0c3d18339a142dce75c901551d9076e355b14 [project @ 1996-04-28 10:40:15 by jwe] diff --git a/configure.in b/configure.in --- a/configure.in +++ b/configure.in @@ -20,7 +20,7 @@ ### along with Octave; see the file COPYING. If not, write to the Free ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -AC_REVISION($Revision: 1.192 $) +AC_REVISION($Revision: 1.193 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -626,12 +626,12 @@ AC_HEADER_DIRENT AC_HEADER_TIME AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(assert.h float.h floatingpoint.h limits.h memory.h) -AC_CHECK_HEADERS(pwd.h stdlib.h string.h unistd.h varargs.h) -AC_CHECK_HEADERS(sys/fcntl.h sys/param.h sys/resource.h sys/select.h) -AC_CHECK_HEADERS(sys/stat.h sys/time.h sys/times.h sys/utsname.h) -AC_CHECK_HEADERS(termios.h termio.h sgtty.h) -AC_CHECK_HEADERS(termcap.h curses.h) + +AC_CHECK_HEADERS(assert.h curses.h fcntl.h float.h floatingpoint.h \ + limits.h memory.h pwd.h sgtty.h stdlib.h string.h \ + sys/param.h sys/resource.h sys/select.h sys/stat.h \ + sys/time.h sys/times.h sys/types.h sys/utsname.h \ + termcap.h termio.h termios.h unistd.h varargs.h) if test "$ac_cv_header_termios_h" = yes \ || test "$ac_cv_header_termio_h" = yes \ @@ -669,11 +669,13 @@ ### Checks for functions and variables. -AC_CHECK_FUNCS(setvbuf getcwd gethostname bzero bcopy rindex vfprintf vsprintf) -AC_CHECK_FUNCS(stricmp strnicmp strcasecmp strncasecmp strerror atexit) -AC_CHECK_FUNCS(on_exit tempnam memmove putenv strdup) -AC_CHECK_FUNCS(mkdir rmdir rename umask) -AC_CHECK_FUNCS(sigaction sigprocmask sigpending sigsuspend) +AC_CHECK_FUNCS(atexit bcopy bzero dup2 execvp fcntl fork getcwd \ + gethostname getpgrp getpid getppid lstat memmove \ + mkdir mkfifo on_exit pipe putenv rename rindex rmdir \ + setvbuf sigaction sigpending sigprocmask sigsuspend \ + stat strcasecmp strdup strerror stricmp strncasecmp \ + strnicmp tempnam umask unlink vfprintf vsprintf \ + waitpid) OCTAVE_SMART_PUTENV OCTAVE_PROGRAM_INVOCATION_NAME @@ -848,6 +850,7 @@ AC_TYPE_MODE_T AC_TYPE_OFF_T +AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_UID_T AC_CHECK_TYPE(dev_t, short) @@ -964,9 +967,6 @@ AC_CHECK_PROGS(DEFAULT_PAGER, less more page pg, []) if test -z "$DEFAULT_PAGER"; then AC_MSG_WARN([I couldn't find `less', `more', `page', or `pg']) -elif test "$DEFAULT_PAGER" = less; then - DEFAULT_PAGER="less -e" - AC_MSG_RESULT([defining DEFAULT_PAGER to be $DEFAULT_PAGER]) fi ### Even though we include config.h, we need to have the preprocessor diff --git a/src/pager.cc b/src/pager.cc --- a/src/pager.cc +++ b/src/pager.cc @@ -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++ *** diff --git a/src/pager.h b/src/pager.h --- a/src/pager.h +++ b/src/pager.h @@ -116,6 +116,8 @@ extern pid_t octave_pager_pid; +extern void symbols_of_pager (void); + #endif /* diff --git a/src/variables.cc b/src/variables.cc --- a/src/variables.cc +++ b/src/variables.cc @@ -353,23 +353,6 @@ } 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); -#endif - - return pager_binary; -} - -string maybe_add_default_load_path (const string& pathstring) { string std_path = subst_octave_home (OCTAVE_FCNFILEPATH); @@ -1614,9 +1597,6 @@ DEFCONSTX ("OCTAVE_VERSION", SBV_OCTAVE_VERSION, OCTAVE_VERSION, 0, 0, "Octave version"); - DEFVAR (PAGER, default_pager (), 0, sv_pager_binary, - "path to pager binary"); - DEFVAR (PS1, "\\s:\\#> ", 0, sv_ps1, "primary prompt string"); @@ -1748,9 +1728,6 @@ DEFVAR (output_precision, 5.0, 0, set_output_precision, "number of significant figures to display for numeric output"); - DEFVAR (page_screen_output, 1.0, 0, page_screen_output, - "if possible, send output intended for the screen through the pager"); - DEFCONST (pi, 4.0 * atan (1.0), 0, 0, "ratio of the circumference of a circle to its diameter"); @@ -1871,6 +1848,7 @@ install_builtin_variables_7 (); install_builtin_variables_8 (); + symbols_of_pager (); symbols_of_syscalls (); }