annotate scripts/deprecated/dump_prefs.m @ 20614:10ec79b47808

use new string_value method to handle value extraction errors * __voronoi__.cc, chol.cc, colamd.cc, fftw.cc: Use new string_value method.
author John W. Eaton <jwe@octave.org>
date Thu, 08 Oct 2015 18:15:56 -0400
parents 4197fc428c7d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19731
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 19679
diff changeset
1 ## Copyright (C) 1994-2015 John W. Eaton
2313
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
2 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
3 ## This file is part of Octave.
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
4 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
6 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6447
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6447
diff changeset
8 ## your option) any later version.
2313
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
9 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
13 ## General Public License for more details.
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
14 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2311
diff changeset
15 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6447
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6447
diff changeset
17 ## <http://www.gnu.org/licenses/>.
799
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
18
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
19 ## -*- texinfo -*-
12528
2ac5028e5cb7 dump_prefs.m: Close @deftypefn macro left open.
Rik <octave@nomad.inbox5.com>
parents: 12527
diff changeset
20 ## @deftypefn {Function File} {} dump_prefs ()
2ac5028e5cb7 dump_prefs.m: Close @deftypefn macro left open.
Rik <octave@nomad.inbox5.com>
parents: 12527
diff changeset
21 ## @deftypefnx {Function File} {} dump_prefs (@var{fid})
19230
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19226
diff changeset
22 ##
19679
ebd27d8c63fd update default branch to release as 4.0
John W. Eaton <jwe@octave.org>
parents: 19230
diff changeset
23 ## @code{dump_prefs} is deprecated and will be removed in Octave version 4.4.
19230
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19226
diff changeset
24 ## Please use individual preference get/set routines in all new code.
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19226
diff changeset
25 ##
19226
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
26 ## Dump the current settings of all user preferences to stdout in a format that
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
27 ## can be parsed by Octave later.
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
28 ##
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
29 ## If the optional argument @var{fid} is given then the results are written to
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
30 ## the file specified by file descriptor @var{fid}.
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
31 ## @seealso{octave_config_info}
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
32 ## @end deftypefn
799
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
33
2314
949ab8eba8bc [project @ 1996-07-12 03:58:02 by jwe]
jwe
parents: 2313
diff changeset
34 ## Author: jwe
949ab8eba8bc [project @ 1996-07-12 03:58:02 by jwe]
jwe
parents: 2313
diff changeset
35
19679
ebd27d8c63fd update default branch to release as 4.0
John W. Eaton <jwe@octave.org>
parents: 19230
diff changeset
36 ## Deprecated in 4.0
ebd27d8c63fd update default branch to release as 4.0
John W. Eaton <jwe@octave.org>
parents: 19230
diff changeset
37
19226
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
38 function dump_prefs (fid)
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
39
19230
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19226
diff changeset
40 persistent warned = false;
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19226
diff changeset
41 if (! warned)
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19226
diff changeset
42 warned = true;
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19226
diff changeset
43 warning ("Octave:deprecated-function",
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19226
diff changeset
44 "dump_prefs is obsolete and will be removed from a future version of Octave, recode using individual preference get/set routines");
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19226
diff changeset
45 endif
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19226
diff changeset
46
19226
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
47 if (nargin > 1)
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
48 print_usage ();
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
49 endif
799
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
50
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
51 if (nargin == 0)
19226
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
52 fid = stdout;
799
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
53 endif
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
54
19226
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
55 ## FIXME: It would be nice to be able to get the list of built-in variables
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
56 ## directly from Octave so that we wouldn't have to remember to update it
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
57 ## each time the list of preference variables changes
799
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
58
19226
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
59 ## FIXME: Update this list for 4.2.0 release
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
60 ## Example, 'gnuplot_command_end' is no longer valid.
5868
84b5cd59e627 [project @ 2006-06-29 06:39:20 by jwe]
jwe
parents: 5794
diff changeset
61
19226
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
62 pref_list = {"EDITOR"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
63 "EXEC_PATH"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
64 "IMAGE_PATH"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
65 "PAGER"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
66 "PS1"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
67 "PS2"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
68 "PS4"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
69 "beep_on_error"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
70 "completion_append_char"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
71 "crash_dumps_octave_core"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
72 "echo_executing_commands"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
73 "fixed_point_format"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
74 "gnuplot_binary"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
75 "gnuplot_command_end"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
76 "gnuplot_command_plot"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
77 "gnuplot_command_replot"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
78 "gnuplot_command_splot"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
79 "gnuplot_command_title"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
80 "gnuplot_command_using"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
81 "gnuplot_command_with"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
82 "history_file"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
83 "history_size"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
84 "ignore_function_time_stamp"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
85 "info_file"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
86 "info_program"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
87 "makeinfo_program"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
88 "max_recursion_depth"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
89 "output_max_field_width"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
90 "output_precision"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
91 "page_output_immediately"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
92 "page_screen_output"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
93 "print_answer_id_name"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
94 "print_empty_dimensions"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
95 "save_precision"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
96 "saving_history"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
97 "sighup_dumps_octave_core"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
98 "sigterm_dumps_octave_core"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
99 "silent_functions"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
100 "split_long_rows"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
101 "string_fill_char"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
102 "struct_levels_to_print"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
103 "suppress_verbose_help_message"};
3163
7f7228c0e658 [project @ 1998-04-10 16:51:47 by jwe]
jwe
parents: 2853
diff changeset
104
19226
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
105 for i = 1:rows (pref_list)
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
106 pref = pref_list{i};
3163
7f7228c0e658 [project @ 1998-04-10 16:51:47 by jwe]
jwe
parents: 2853
diff changeset
107 try
19226
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
108 val = feval (pref);
5868
84b5cd59e627 [project @ 2006-06-29 06:39:20 by jwe]
jwe
parents: 5794
diff changeset
109 if (isnumeric (val))
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 7017
diff changeset
110 val = sprintf ("%g", val);
5868
84b5cd59e627 [project @ 2006-06-29 06:39:20 by jwe]
jwe
parents: 5794
diff changeset
111 endif
19226
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
112 fprintf (fid, " %s = %s\n", pref, val);
3163
7f7228c0e658 [project @ 1998-04-10 16:51:47 by jwe]
jwe
parents: 2853
diff changeset
113 catch
19226
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
114 fprintf (fid, "# %s = <no value or error in displaying it>\n", pref);
3163
7f7228c0e658 [project @ 1998-04-10 16:51:47 by jwe]
jwe
parents: 2853
diff changeset
115 end_try_catch
7f7228c0e658 [project @ 1998-04-10 16:51:47 by jwe]
jwe
parents: 2853
diff changeset
116 endfor
799
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
117
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
118 endfunction
17338
1c89599167a6 maint: End m-files with 1 blank line.
Rik <rik@octave.org>
parents: 14868
diff changeset
119
19226
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
120
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
121 %!error dump_prefs (1,2)
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18891
diff changeset
122