GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
oct-hist.cc File Reference
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <string>
#include "cmd-hist.h"
#include "file-ops.h"
#include "lo-mappers.h"
#include "octave-link.h"
#include "oct-env.h"
#include "oct-time.h"
#include "str-vec.h"
#include "unistd-wrappers.h"
#include "defaults.h"
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "input.h"
#include "oct-hist.h"
#include "ovl.h"
#include "pager.h"
#include "parse.h"
#include "sighandlers.h"
#include "sysdep.h"
#include "interpreter.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
Include dependency graph for oct-hist.cc:

Go to the source code of this file.

Functions

static std::string default_history_file (void)
 
static int default_history_size (void)
 
static std::string default_history_timestamp_format (void)
 
static void do_edit_history (octave::interpreter &interp, const octave_value_list &args)
 
static string_vector do_history (const octave_value_list &args, int nargout)
 
static void do_run_history (const octave_value_list &args)
 
With two run the list of commands between the command xample roup run_history OR run_history nd group nd example oindent executes the most recent command again The command xample run_history nd example oindent executes commands through Specifying a larger number for the first command than the last command reverses the list of commands before executing them For history nd deftypefn * do_run_history (args)
 
static void edit_history_add_hist (const std::string &line)
 
static char * edit_history_readline (std::fstream &stream)
 
OCTAVE_EXPORT octave_value_list Fedit_history (octave::interpreter &interp, const octave_value_list &args, int) Octave executes the commands that remain in the file. It is often more convenient to use ode
 
OCTAVE_EXPORT octave_value_list Fhistory_control (const octave_value_list &args, int nargout) but may be overridden by the environment variable
 
static bool get_int_arg (const octave_value &arg, int &val)
 
void initialize_history (bool read_history_file)
 
static std::string mk_tmp_hist_file (const octave_value_list &args, bool insert_curr, const char *warn_for)
 
void octave_history_write_timestamp (void)
 
return ovl ()
 
static void unlink_cleanup (const char *file)
 

Variables

With one edit the specified command ar {cmd_number}
 
With one argument
 
to define functions rather than attempting to enter them directly on the command line The block of commands is executed as soon as you exit the editor To avoid executing any simply delete all the lines from the buffer before leaving the editor When invoked with no arguments
 
to define functions rather than attempting to enter them directly on the command line The block of commands is executed as soon as you exit the editor To avoid executing any simply delete all the lines from the buffer before leaving the editor When invoked with no edit the previously executed command
 
to define functions rather than attempting to enter them directly on the command line The block of commands is executed as soon as you exit the editor To avoid executing any commands
 
With two edit the list of commands between specifying a larger number for the first command than the last command reverses the list of commands before they are placed in the buffer to be edited eealso
 
With two run the list of commands between the command xample roup run_history OR run_history nd group nd example oindent executes the most recent command again The command xample run_history nd example oindent executes commands through Specifying a larger number for the first command than the last command reverses the list of commands before executing them For example
 
bool input_from_tmp_history_file = false
 
The value of lines which begin with a space character are not saved in the history list A value of all commands are saved on the history list
 
The value of ode {history_control} is a colon-separated list of values controlling how commands are saved on the history list. If the list of values includes ode{ignorespace}
 
static std::string Vhistory_timestamp_format_string = default_history_timestamp_format ()
 

Function Documentation

◆ default_history_file()

static std::string default_history_file ( void  )
static

◆ default_history_size()

static int default_history_size ( void  )
static

Definition at line 90 of file oct-hist.cc.

References octave::sys::env::getenv(), string, and val.

Referenced by initialize_history().

◆ default_history_timestamp_format()

static std::string default_history_timestamp_format ( void  )
static

◆ do_edit_history()

◆ do_history()

◆ do_run_history() [1/2]

◆ do_run_history() [2/2]

With two run the list of commands between the command xample roup run_history OR run_history nd group nd example oindent executes the most recent command again The command xample run_history nd example oindent executes commands through Specifying a larger number for the first command than the last command reverses the list of commands before executing them For history nd deftypefn* do_run_history ( args  )

◆ edit_history_add_hist()

static void edit_history_add_hist ( const std::string line)
static

Definition at line 309 of file oct-hist.cc.

References octave::command_history::add(), octave_link::append_history(), string, and tmp.

Referenced by do_edit_history().

◆ edit_history_readline()

static char* edit_history_readline ( std::fstream &  stream)
static

Definition at line 259 of file oct-hist.cc.

References c.

Referenced by do_edit_history().

◆ Fedit_history()

OCTAVE_EXPORT octave_value_list Fedit_history ( octave::interpreter interp,
const octave_value_list args,
int   
)

Definition at line 587 of file oct-hist.cc.

References do_edit_history(), ovl(), and print_usage().

◆ Fhistory_control()

OCTAVE_EXPORT octave_value_list Fhistory_control ( const octave_value_list args,
int  nargout 
)

Definition at line 734 of file oct-hist.cc.

◆ get_int_arg()

static bool get_int_arg ( const octave_value arg,
int &  val 
)
static

◆ initialize_history()

◆ mk_tmp_hist_file()

static std::string mk_tmp_hist_file ( const octave_value_list args,
bool  insert_curr,
const char *  warn_for 
)
static

◆ octave_history_write_timestamp()

void octave_history_write_timestamp ( void  )

◆ ovl()

return ovl ( )

Referenced by Fedit_history().

◆ unlink_cleanup()

static void unlink_cleanup ( const char *  file)
static

Definition at line 437 of file oct-hist.cc.

References file, and octave_unlink_wrapper().

Referenced by do_edit_history(), and do_run_history().

Variable Documentation

◆ ar

With two run the list of commands between ar {cmd_number}

Definition at line 587 of file oct-hist.cc.

◆ argument

With one argument

Definition at line 587 of file oct-hist.cc.

◆ arguments

With two arguments

Definition at line 587 of file oct-hist.cc.

◆ command

to define functions rather than attempting to enter them directly on the command line The block of commands is executed as soon as you exit the editor To avoid executing any simply delete all the lines from the buffer before leaving the editor When invoked with no edit the previously executed command

◆ commands

to define functions rather than attempting to enter them directly on the command line The block of commands is executed as soon as you exit the editor To avoid executing any commands

◆ eealso

With two edit the list of commands between specifying a larger number for the first command than the last command reverses the list of commands before they are placed in the buffer to be edited eealso

Definition at line 587 of file oct-hist.cc.

◆ example

With two run the list of commands between the command xample roup run_history OR run_history nd group nd example oindent executes the most recent command again The command xample run_history nd example oindent executes commands through Specifying a larger number for the first command than the last command reverses the list of commands before executing them For example

Definition at line 700 of file oct-hist.cc.

◆ input_from_tmp_history_file

bool input_from_tmp_history_file = false

Definition at line 70 of file oct-hist.cc.

Referenced by do_edit_history(), and do_run_history().

◆ list

The value of lines which begin with a space character are not saved in the history list A value of all commands are saved on the history list

Definition at line 734 of file oct-hist.cc.

Referenced by UrlFilter::HotSpot::actions(), octave::stream_list::clear(), octave::tree_evaluator::do_unwind_protect_cleanup_code(), octave::main_window::dock_widget_list(), QtHandles::ListBoxControl::eventFilter(), F__octave_link_list_dialog__(), KeyboardTranslatorManager::findTranslators(), octave::profiler::stats::function_set_value(), octave::stream_list::get_file_number(), octave::stream_list::get_info(), octave::main_window::handle_create_listview(), FilterChain::hotSpots(), octave_link::list_dialog(), octave::stream_list::list_open_files(), QtHandles::ListBoxControl::ListBoxControl(), make_plot_mapper(), octave::stream_list::open_file_numbers(), octave::stream_list::remove(), QtHandles::ListBoxControl::sendSelectionChange(), octave::QUIWidgetCreator::signal_listview(), KeyboardTranslatorReader::tokenize(), QtHandles::ListBoxControl::update(), QtHandles::updateSelection(), octave::tree_checker::visit_complex_for_command(), octave::tree_print_code::visit_complex_for_command(), octave::tree_checker::visit_do_until_command(), octave::tree_print_code::visit_do_until_command(), octave::tree_checker::visit_if_clause(), octave::tree_print_code::visit_if_clause(), octave::tree_checker::visit_if_command(), octave::tree_print_code::visit_if_command(), octave::tree_checker::visit_simple_for_command(), octave::tree_print_code::visit_simple_for_command(), octave::tree_checker::visit_switch_case(), octave::tree_print_code::visit_switch_case(), octave::tree_checker::visit_switch_command(), octave::tree_print_code::visit_switch_command(), octave::tree_checker::visit_while_command(), and octave::tree_print_code::visit_while_command().

◆ ode

The value of lines which begin with a space character are not saved in the history list A value of ode {history_control} is a colon-separated list of values controlling how commands are saved on the history list. If the list of values includes ode{ignorespace}

Definition at line 734 of file oct-hist.cc.

◆ Vhistory_timestamp_format_string

std::string Vhistory_timestamp_format_string = default_history_timestamp_format ()
static

Definition at line 121 of file oct-hist.cc.

Referenced by octave_history_write_timestamp().