#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"
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 () |
|
static |
Definition at line 73 of file oct-hist.cc.
References octave::sys::file_ops::concat(), file, octave::sys::env::get_home_directory(), octave::sys::env::getenv(), and string.
Referenced by do_history(), and initialize_history().
|
static |
Definition at line 90 of file oct-hist.cc.
References octave::sys::env::getenv(), string, and val.
Referenced by initialize_history().
|
static |
Definition at line 108 of file oct-hist.cc.
References octave::sys::env::get_host_name(), octave::sys::env::get_user_name(), and OCTAVE_VERSION.
|
static |
Definition at line 443 of file oct-hist.cc.
References octave::action_container::add_fcn(), edit_history_add_hist(), edit_history_readline(), octave::environment::editor(), error(), file, frame, octave::interpreter::get_environment(), octave::ignore_interrupts(), input_from_tmp_history_file, mk_tmp_hist_file(), name, octave::action_container::protect_var(), octave::set_interrupt_handler(), octave::source_file(), string, system(), and unlink_cleanup().
Referenced by Fedit_history().
|
static |
Definition at line 130 of file oct-hist.cc.
References octave::action_container::add_fcn(), octave::command_history::append(), arg, octave::command_history::clear(), octave_link::clear_history(), default_history_file(), err_wrong_type_arg(), error(), octave::command_history::file(), fname, frame, i, octave_value::int_value(), octave_value::is_string(), octave_value::isnumeric(), octave_value_list::length(), octave::command_history::list(), nargout(), Array< T >::numel(), octave_stdout, option, panic_impossible, octave::command_history::read(), octave::command_history::read_range(), octave::command_history::set_file(), octave_link::set_history(), string, octave_value::string_value(), tmp, and octave::command_history::write().
|
static |
Definition at line 510 of file oct-hist.cc.
References octave::action_container::add_fcn(), frame, input_from_tmp_history_file, mk_tmp_hist_file(), name, octave::action_container::protect_var(), octave::source_file(), string, and unlink_cleanup().
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 |
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().
|
static |
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().
OCTAVE_EXPORT octave_value_list Fhistory_control | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 734 of file oct-hist.cc.
|
static |
Definition at line 327 of file oct-hist.cc.
References arg, octave_value::int_value(), octave_value::is_string(), octave_value::isnumeric(), string, octave_value::string_value(), tmp, and val.
Referenced by mk_tmp_hist_file().
void initialize_history | ( | bool | read_history_file | ) |
Definition at line 532 of file oct-hist.cc.
References default_history_file(), default_history_size(), octave::sys::env::getenv(), octave::command_history::initialize(), octave::command_history::list(), and octave_link::set_history().
|
static |
Definition at line 346 of file oct-hist.cc.
References error(), file, get_int_arg(), i, octave_value_list::length(), octave::command_history::list(), name, Array< T >::numel(), octave::command_history::remove(), string, swap, and octave::sys::tempnam().
Referenced by do_edit_history(), and do_run_history().
void octave_history_write_timestamp | ( | void | ) |
Definition at line 543 of file oct-hist.cc.
References octave::command_history::add(), octave_link::append_history(), now, string, and Vhistory_timestamp_format_string.
return ovl | ( | ) |
Referenced by Fedit_history().
|
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().
Definition at line 587 of file oct-hist.cc.
With one argument |
Definition at line 587 of file oct-hist.cc.
With two arguments |
Definition at line 587 of file oct-hist.cc.
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 |
Definition at line 587 of file oct-hist.cc.
Referenced by KeyboardTranslatorReader::createEntry(), octave::main_window::execute_command_in_terminal(), octave_link::execute_command_in_terminal(), octave::file_editor_tab::handle_octave_result(), octave_popen(), octave_procbuf::octave_procbuf(), procstreambase::open(), octave_procbuf::open(), KeyboardTranslatorReader::parseAsCommand(), procstreambase::procstreambase(), KeyboardTranslatorReader::readNext(), and KeyboardTranslator::Entry::setCommand().
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 |
Definition at line 587 of file oct-hist.cc.
Referenced by octave::octave_qscintilla::contextmenu_run(), octave::file_editor_tab::new_file(), octave::main_window::new_file(), octave::file_editor::request_new_file(), and octave::main_window::request_new_script().
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.
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.
Definition at line 70 of file oct-hist.cc.
Referenced by do_edit_history(), and do_run_history().
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().
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.
|
static |
Definition at line 121 of file oct-hist.cc.
Referenced by octave_history_write_timestamp().