changeset 16875:b04ae15530fc

Rename default_save_options() to save_default_options(). * NEWS: Announce renaming. * doc/interpreter/basics.txi, doc/interpreter/io.txi: Update references in manual to point to save_default_options. * libgui/src/resource-manager.cc: Update keyword list. libinterp/interpfcn/load-save.cc(Fsave_default_options): Rename function. Rename seealso links. Rename variable Vdefault_save_options to Vsave_defaut_options. * libinterp/octave.cc(maximum_braindamage): Call save_default_options. * libinterp/parse-tree/pt-assign.cc: Update list of old Octave built-in variables. * scripts/deprecated/default_save_options.m: Add deprecated function which calls save_default_options. * scripts/deprecated/module.mk: Add deprecated script default_save_options.m to build.
author Rik <rik@octave.org>
date Sun, 30 Jun 2013 13:50:48 -0700
parents f160f9029b4e
children 9e0618443c2b
files NEWS doc/interpreter/basics.txi doc/interpreter/io.txi libgui/src/resource-manager.cc libinterp/interpfcn/load-save.cc libinterp/octave.cc libinterp/parse-tree/pt-assign.cc scripts/deprecated/default_save_options.m scripts/deprecated/module.mk
diffstat 9 files changed, 66 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS
+++ b/NEWS
@@ -178,13 +178,13 @@
 
       base64_decode               ellipke         polyeig              
       base64_encode               erfcinv         rgbplot                   
-      betaincinv                  erfi            shrinkfaces            
-      built_in_docstrings_file    expint          splinefit              
-      cmpermute                   findfigs        strjoin                
-      cmunique                    fminsearch      struct2hdl             
-      colorcube                   gallery         tetramesh              
-      copyobj                     gco             waterfall              
-      dawson                      hdl2struct                  
+      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   
@@ -205,6 +205,7 @@
     be removed from Octave 3.12 (or whatever version is the second major
     release after 3.8):
 
+      default_save_options
       gen_doc_cache
       java_convert_matrix
       java_debug
--- a/doc/interpreter/basics.txi
+++ b/doc/interpreter/basics.txi
@@ -248,7 +248,7 @@
 beep_on_error                   = true
 confirm_recursive_rmdir         = false
 crash_dumps_octave_core         = false
-default_save_options            = "-mat-binary"
+save_default_options            = "-mat-binary"
 do_braindead_shortcircuit_evaluation = true
 fixed_point_format              = true
 history_timestamp_format_string = "%%-- %D %I:%M %p --%%"
--- a/doc/interpreter/io.txi
+++ b/doc/interpreter/io.txi
@@ -149,7 +149,7 @@
 The @code{save} and @code{load} commands allow data to be written to and
 read from disk files in various formats.  The default format of files
 written by the @code{save} command can be controlled using the functions
-@code{default_save_options} and @code{save_precision}.
+@code{save_default_options} and @code{save_precision}.
 
 As an example the following code creates a 3-by-3 matrix and saves it
 to the file @samp{myfile.mat}.
@@ -180,7 +180,7 @@
 
 There are three functions that modify the behavior of @code{save}.
 
-@DOCSTRING(default_save_options)
+@DOCSTRING(save_default_options)
 
 @DOCSTRING(save_precision)
 
--- a/libgui/src/resource-manager.cc
+++ b/libgui/src/resource-manager.cc
@@ -663,7 +663,6 @@
       "dec2bin "
       "dec2hex "
       "deconv "
-      "default_save_options "
       "del2 "
       "delaunay "
       "delaunay3 "
@@ -1448,6 +1447,7 @@
       "runlength "
       "runtests "
       "save "
+      "save_default_options "
       "save_header_format_string "
       "save_precision "
       "saveas "
--- a/libinterp/interpfcn/load-save.cc
+++ b/libinterp/interpfcn/load-save.cc
@@ -103,7 +103,7 @@
 
 // The default output format.  May be one of "binary", "text",
 // "mat-binary", or "hdf5".
-static std::string Vdefault_save_options = "-text";
+static std::string Vsave_default_options = "-text";
 
 // The output format for Octave core files.
 static std::string Voctave_core_file_options = "-binary";
@@ -1470,7 +1470,7 @@
 with corresponding names.\n\
 Valid options for the @code{save} command are listed in the following table.\n\
 Options that modify the output format override the format specified by\n\
-@code{default_save_options}.\n\
+@code{save_default_options}.\n\
 \n\
 If save is invoked using the functional form\n\
 \n\
@@ -1576,7 +1576,7 @@
 @noindent\n\
 saves the variable @samp{a} and all variables beginning with @samp{b} to\n\
 the file @file{data} in Octave's binary format.\n\
-@seealso{load, default_save_options, save_header_format_string, dlmread, csvread, fread}\n\
+@seealso{load, save_default_options, save_header_format_string, dlmread, csvread, fread}\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -1600,7 +1600,7 @@
   bool use_zlib = false;
 
   // get default options
-  parse_save_options (Vdefault_save_options, format, append, save_as_floats,
+  parse_save_options (Vsave_default_options, format, append, save_as_floats,
                       use_zlib);
 
   // override from command line
@@ -1773,11 +1773,11 @@
   return SET_INTERNAL_VARIABLE (crash_dumps_octave_core);
 }
 
-DEFUN (default_save_options, args, nargout,
+DEFUN (save_default_options, args, nargout,
   "-*- texinfo -*-\n\
-@deftypefn  {Built-in Function} {@var{val} =} default_save_options ()\n\
-@deftypefnx {Built-in Function} {@var{old_val} =} default_save_options (@var{new_val})\n\
-@deftypefnx {Built-in Function} {} default_save_options (@var{new_val}, \"local\")\n\
+@deftypefn  {Built-in Function} {@var{val} =} save_default_options ()\n\
+@deftypefnx {Built-in Function} {@var{old_val} =} save_default_options (@var{new_val})\n\
+@deftypefnx {Built-in Function} {} save_default_options (@var{new_val}, \"local\")\n\
 Query or set the internal variable that specifies the default options\n\
 for the @code{save} command, and defines the default format.\n\
 Typical values include @code{\"-ascii\"}, @code{\"-text -zip\"}.\n\
@@ -1789,7 +1789,7 @@
 @seealso{save}\n\
 @end deftypefn")
 {
-  return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (default_save_options);
+  return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (save_default_options);
 }
 
 DEFUN (octave_core_file_limit, args, nargout,
--- a/libinterp/octave.cc
+++ b/libinterp/octave.cc
@@ -626,7 +626,7 @@
   Fbeep_on_error (octave_value (true));
   Fconfirm_recursive_rmdir (octave_value (false));
   Fcrash_dumps_octave_core (octave_value (false));
-  Fdefault_save_options (octave_value ("-mat-binary"));
+  Fsave_default_options (octave_value ("-mat-binary"));
   Fdo_braindead_shortcircuit_evaluation (octave_value (true));
   Ffixed_point_format (octave_value (true));
   Fhistory_timestamp_format_string (octave_value ("%%-- %D %I:%M %p --%%"));
--- a/libinterp/parse-tree/pt-assign.cc
+++ b/libinterp/parse-tree/pt-assign.cc
@@ -74,7 +74,6 @@
   "debug_on_interrupt",
   "debug_on_warning",
   "debug_symtab_lookups",
-  "default_save_options",
   "echo_executing_commands",
   "fixed_point_format",
   "gnuplot_binary",
@@ -101,6 +100,7 @@
   "print_answer_id_name",
   "print_empty_dimensions",
   "print_rhs_assign_val",
+  "save_default_options",
   "save_header_format_string",
   "save_precision",
   "saving_history",
new file mode 100644
--- /dev/null
+++ b/scripts/deprecated/default_save_options.m
@@ -0,0 +1,42 @@
+## 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} =} default_save_options ()
+## @deftypefnx {Built-in Function} {@var{old_val} =} default_save_options (@var{new_val})
+## @deftypefnx {Built-in Function} {} default_save_options (@var{new_val}, \"local\")
+## This function has been deprecated.  Use @code{@file{save_default_options}}
+## instead.
+## @seealso{save_default_options}
+## @end deftypefn
+
+## Deprecated in 3.8
+
+function retval = default_save_options (varargin)
+
+  persistent warned = false;
+  if (! warned)
+    warned = true;
+    warning ("Octave:deprecated-function",
+             "default_save_options is obsolete and will be removed from a future version of Octave, please use save_default_options instead");
+  endif
+
+  retval = save_default_options (varargin{:});
+
+endfunction
+
--- a/scripts/deprecated/module.mk
+++ b/scripts/deprecated/module.mk
@@ -5,6 +5,7 @@
   deprecated/cor.m \
   deprecated/corrcoef.m \
   deprecated/cut.m \
+  deprecated/default_save_options.m \
   deprecated/java_debug.m \
   deprecated/error_text.m \
   deprecated/gen_doc_cache.m \