Navigation

Operators and Keywords

Function List:

C++ API

oct-hist.cc File Reference

#include <cstdlib>
#include <cstring>
#include <string>
#include <fstream>
#include <sys/types.h>
#include <unistd.h>
#include "cmd-hist.h"
#include "file-ops.h"
#include "lo-mappers.h"
#include "oct-env.h"
#include "oct-time.h"
#include "str-vec.h"
#include <defaults.h>
#include "defun.h"
#include "error.h"
#include "gripes.h"
#include "input.h"
#include "oct-hist.h"
#include "oct-obj.h"
#include "pager.h"
#include "parse.h"
#include "sighandlers.h"
#include "sysdep.h"
#include "toplev.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
Include dependency graph for oct-hist.cc:

Functions

void initialize_history (bool read_history_file)
void octave_history_write_timestamp (void)
 DEFUN (edit_history, args,,"-*- texinfo -*-\n\ @deftypefn {Command} {} edit_history [@var{first}] [@var{last}]\n\ If invoked with no arguments, @code{edit_history} allows you to edit the\n\ history list using the editor named by the variable @w{@env{EDITOR}}. The\n\ commands to be edited are first copied to a temporary file. When you\n\ exit the editor, Octave executes the commands that remain in the file.\n\ It is often more convenient to use @code{edit_history} to define functions \n\ rather than attempting to enter them directly on the command line.\n\ By default, the block of commands is executed as soon as you exit the\n\ editor. To avoid executing any commands, simply delete all the lines\n\ from the buffer before exiting the editor.\n\ \n\ The @code{edit_history} command takes two optional arguments specifying\n\ the history numbers of first and last commands to edit. For example,\n\ the command\n\ \n\ @example\n\ edit_history 13\n\ @end example\n\ \n\ @noindent\n\ extracts all the commands from the 13th through the last in the history\n\ list. The command\n\ \n\ @example\n\ edit_history 13 169\n\ @end example\n\ \n\ @noindent\n\ only extracts commands 13 through 169. Specifying a larger number for\n\ the first command than the last command reverses the list of commands\n\ before placing them in the buffer to be edited. If both arguments are\n\ omitted, the previous command in the history list is used.\n\ @seealso{run_history}\n\ @end deftypefn")
 DEFUN (history, args,,"-*- texinfo -*-\n\ @deftypefn {Command} {} history options\n\ If invoked with no arguments, @code{history} displays a list of commands\n\ that you have executed. Valid options are:\n\ \n\ @table @code\n\ @item -w @var{file}\n\ Write the current history to the file @var{file}. If the name is\n\ omitted, use the default history file (normally @file{~/.octave_hist}).\n\ \n\ @item -r @var{file}\n\ Read the file @var{file}, appending its contents to the current \n\ history list. If the name is omitted, use the default history file\n\ (normally @file{~/.octave_hist}).\n\ \n\ @item @var{n}\n\ Display only the most recent @var{n} lines of history.\n\ \n\ @item -q\n\ Don't number the displayed lines of history. This is useful for cutting\n\ and pasting commands using the X Window System.\n\ @end table\n\ \n\ For example, to display the five most recent commands that you have\n\ typed without displaying line numbers, use the command\n\ @kbd{history -q 5}.\n\ @end deftypefn")
 DEFUN (run_history, args,,"-*- texinfo -*-\n\ @deftypefn {Command} {} run_history [@var{first}] [@var{last}]\n\ Similar to @code{edit_history}, except that the editor is not invoked,\n\ and the commands are simply executed as they appear in the history list.\n\ @seealso{edit_history}\n\ @end deftypefn")
 DEFUN (history_control, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} history_control ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} history_control (@var{new_val})\n\ Query or set the internal variable that specifies how commands are saved\n\ to the history list. The default value is an empty character string,\n\ but may be overridden by the environment variable\n\ @w{@env{OCTAVE_HISTCONTROL}}.\n\ \n\ The value of @code{history_control} is a colon-separated list of values\n\ controlling how commands are saved on the history list. If the list\n\ of values includes @code{ignorespace}, lines which begin with a space\n\ character are not saved in the history list. A value of @code{ignoredups}\n\ causes lines matching the previous history entry to not be saved.\n\ A value of @code{ignoreboth} is shorthand for @code{ignorespace} and\n\ @code{ignoredups}. A value of @code{erasedups} causes all previous lines\n\ matching the current line to be removed from the history list before that\n\ line is saved. Any value not in the above list is ignored. If\n\ @code{history_control} is the empty string, all commands are saved on\n\ the history list, subject to the value of @code{saving_history}.\n\ @seealso{history_file, history_size, history_timestamp_format_string, saving_history}\n\ @end deftypefn")
 DEFUN (history_size, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} history_size ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} history_size (@var{new_val})\n\ Query or set the internal variable that specifies how many entries\n\ to store in the history file. The default value is @code{1024},\n\ but may be overridden by the environment variable @w{@env{OCTAVE_HISTSIZE}}.\n\ @seealso{history_file, history_timestamp_format_string, saving_history}\n\ @end deftypefn")
 DEFUN (history_file, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} history_file ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} history_file (@var{new_val})\n\ Query or set the internal variable that specifies the name of the\n\ file used to store command history. The default value is\n\ @file{~/.octave_hist}, but may be overridden by the environment\n\ variable @w{@env{OCTAVE_HISTFILE}}.\n\ @seealso{history_size, saving_history, history_timestamp_format_string}\n\ @end deftypefn")
 DEFUN (history_timestamp_format_string, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} history_timestamp_format_string ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} history_timestamp_format_string (@var{new_val})\n\ Query or set the internal variable that specifies the format string\n\ for the comment line that is written to the history file when Octave\n\ exits. The format string is passed to @code{strftime}. The default\n\ value is\n\ \n\ @example\n\ \"# Octave VERSION, %a %b %d %H:%M:%S %Y %Z <USER@@HOST>\"\n\ @end example\n\ @seealso{strftime, history_file, history_size, saving_history}\n\ @end deftypefn")
 DEFUN (saving_history, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} saving_history ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} saving_history (@var{new_val})\n\ Query or set the internal variable that controls whether commands entered\n\ on the command line are saved in the history file.\n\ @seealso{history_control, history_file, history_size, history_timestamp_format_string}\n\ @end deftypefn")

Variables

bool input_from_tmp_history_file = false
bool Vsaving_history = true

Function Documentation

DEFUN ( history_size  ,
args  ,
nargout   
)
DEFUN ( history  ,
args   
)
DEFUN ( run_history  ,
args   
)
DEFUN ( history_control  ,
args  ,
nargout   
)
DEFUN ( history_file  ,
args  ,
nargout   
)
DEFUN ( history_timestamp_format_string  ,
args  ,
nargout   
)
DEFUN ( saving_history  ,
args  ,
nargout   
)
DEFUN ( edit_history  ,
args   
)
void initialize_history ( bool  read_history_file  ) 
void octave_history_write_timestamp ( void   ) 

Variable Documentation

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines