Mercurial > hg > octave-lyh
changeset 16876:9e0618443c2b
Rename saving_history() to history_save().
* NEWS: Announch renaming.
* doc/interpreter/basics.txi: Use history_save in manual.
* libgui/src/resource-manager.cc: Update list of Octave keywords.
* libinterp/interpfcn/oct-hist.cc(Fsaving_history): Rename function.
Rename seealso links in other functions.
* libinterp/octave.cc(octave_process_command_line): Call history_save(0)
for -H option.
* libinterp/parse-tree/pt-assign.cc: Update list of old built-in variables.
* scripts/deprecated/saving_history.m: Add deprecated command to call history_save().
* scripts/deprecated/module.mk: Add deprecated saving_history.m to build system.
author | Rik <rik@octave.org> |
---|---|
date | Sun, 30 Jun 2013 14:19:02 -0700 |
parents | b04ae15530fc |
children | 5482cd26311a |
files | NEWS doc/interpreter/basics.txi libgui/src/resource-manager.cc libinterp/interpfcn/oct-hist.cc libinterp/octave.cc libinterp/parse-tree/pt-assign.cc scripts/deprecated/module.mk scripts/deprecated/saving_history.m |
diffstat | 8 files changed, 72 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS +++ b/NEWS @@ -176,19 +176,18 @@ ** Other new functions added in 3.8.0: - base64_decode ellipke polyeig - base64_encode erfcinv rgbplot - betaincinv erfi save_default_options - built_in_docstrings_file expint shrinkfaces - cmpermute findfigs splinefit - cmunique fminsearch strjoin - colorcube gallery struct2hdl - copyobj gco tetramesh - dawson hdl2struct waterfall - dblist importdata - doc_cache_create iscolormap - ellipj lines - + base64_decode ellipke lines + base64_encode erfcinv polyeig + betaincinv erfi rgbplot + built_in_docstrings_file expint save_default_options + cmpermute findfigs shrinkfaces + cmunique fminsearch splinefit + colorcube gallery strjoin + copyobj gco struct2hdl + dawson hdl2struct tetramesh + dblist history_save waterfall + doc_cache_create importdata + ellipj iscolormap ** Deprecated functions. @@ -216,6 +215,7 @@ java_unsigned_conversion javafields javamethods + saving_history The following keywords have been deprecated in Octave 3.8 and will be removed from Octave 3.12 (or whatever version is the second major
--- a/doc/interpreter/basics.txi +++ b/doc/interpreter/basics.txi @@ -722,7 +722,7 @@ Octave also allows you customize the details of when, where, and how history is saved. -@DOCSTRING(saving_history) +@DOCSTRING(history_save) @DOCSTRING(history_control)
--- a/libgui/src/resource-manager.cc +++ b/libgui/src/resource-manager.cc @@ -933,6 +933,7 @@ "history " "history_control " "history_file " + "history_save " "history_size " "history_timestamp_format_string " "hold " @@ -1455,7 +1456,6 @@ "saveimage " "saveobj " "savepath " - "saving_history " "scanf " "scatter " "scatter3 "
--- a/libinterp/interpfcn/oct-hist.cc +++ b/libinterp/interpfcn/oct-hist.cc @@ -755,8 +755,8 @@ 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\ +the history list, subject to the value of @code{history_save}.\n\ +@seealso{history_file, history_size, history_timestamp_format_string, history_save}\n\ @end deftypefn") { std::string old_history_control = command_history::histcontrol (); @@ -779,7 +779,7 @@ Query or set the internal variable that specifies how many entries\n\ to store in the history file. The default value is @code{1000},\n\ but may be overridden by the environment variable @w{@env{OCTAVE_HISTSIZE}}.\n\ -@seealso{history_file, history_timestamp_format_string, saving_history}\n\ +@seealso{history_file, history_timestamp_format_string, history_save}\n\ @end deftypefn") { int old_history_size = command_history::size (); @@ -804,7 +804,7 @@ 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\ +@seealso{history_size, history_save, history_timestamp_format_string}\n\ @end deftypefn") { std::string old_history_file = command_history::file (); @@ -837,17 +837,17 @@ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ -@seealso{strftime, history_file, history_size, saving_history}\n\ +@seealso{strftime, history_file, history_size, history_save}\n\ @end deftypefn") { return SET_INTERNAL_VARIABLE (history_timestamp_format_string); } -DEFUN (saving_history, args, nargout, +DEFUN (history_save, 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\ -@deftypefnx {Built-in Function} {} saving_history (@var{new_val}, \"local\")\n\ +@deftypefn {Built-in Function} {@var{val} =} history_save ()\n\ +@deftypefnx {Built-in Function} {@var{old_val} =} history_save (@var{new_val})\n\ +@deftypefnx {Built-in Function} {} history_save (@var{new_val}, \"local\")\n\ Query or set the internal variable that controls whether commands entered\n\ on the command line are saved in the history file.\n\ \n\ @@ -857,14 +857,14 @@ @seealso{history_control, history_file, history_size, history_timestamp_format_string}\n\ @end deftypefn") { - bool old_saving_history = ! command_history::ignoring_entries (); + bool old_history_save = ! command_history::ignoring_entries (); - bool tmp = old_saving_history; + bool tmp = old_history_save; octave_value retval = set_internal_variable (tmp, args, nargout, - "saving_history"); + "history_save"); - if (tmp != old_saving_history) + if (tmp != old_history_save) command_history::ignore_entries (! tmp); return retval;
--- a/libinterp/octave.cc +++ b/libinterp/octave.cc @@ -682,7 +682,7 @@ break; case 'H': - Fsaving_history (octave_value (false)); + Fhistory_save (octave_value (false)); read_history_file = false; break;
--- a/libinterp/parse-tree/pt-assign.cc +++ b/libinterp/parse-tree/pt-assign.cc @@ -87,6 +87,7 @@ "gnuplot_command_with", "gnuplot_has_frames", "history_file", + "history_save", "history_size", "ignore_function_time_stamp", "max_recursion_depth", @@ -103,7 +104,6 @@ "save_default_options", "save_header_format_string", "save_precision", - "saving_history", "sighup_dumps_octave_core", "sigterm_dumps_octave_core", "silent_functions",
--- a/scripts/deprecated/module.mk +++ b/scripts/deprecated/module.mk @@ -19,6 +19,7 @@ deprecated/javafields.m \ deprecated/javamethods.m \ deprecated/polyderiv.m \ + deprecated/saving_history.m \ deprecated/shell_cmd.m \ deprecated/studentize.m \ deprecated/sylvester_matrix.m
new file mode 100644 --- /dev/null +++ b/scripts/deprecated/saving_history.m @@ -0,0 +1,41 @@ +## Copyright (C) 2013 Rik Wehbring +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Built-in Function} {@var{val} =} saving_history () +## @deftypefnx {Built-in Function} {@var{old_val} =} saving_history (@var{new_val}) +## @deftypefnx {Built-in Function} {} saving_history (@var{new_val}, \"local\") +## This function has been deprecated. Use @code{@file{history_save}} instead. +## @seealso{history_save} +## @end deftypefn + +## Deprecated in 3.8 + +function retval = saving_history (varargin) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "saving_history is obsolete and will be removed from a future version of Octave, please use history_save instead"); + endif + + retval = save_default_options (varargin{:}); + +endfunction +