annotate scripts/deprecated/dump_prefs.m @ 22323:bac0d6f07a3e

maint: Update copyright notices for 2016.
author John W. Eaton <jwe@octave.org>
date Wed, 17 Aug 2016 01:05:19 -0400
parents 1da428cbf401
children 1b1e740be472
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22323
bac0d6f07a3e maint: Update copyright notices for 2016.
John W. Eaton <jwe@octave.org>
parents: 21434
diff changeset
1 ## Copyright (C) 1994-2016 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 -*-
20852
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19697
diff changeset
20 ## @deftypefn {} {} dump_prefs ()
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19697
diff changeset
21 ## @deftypefnx {} {} dump_prefs (@var{fid})
19196
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19192
diff changeset
22 ##
19645
ebd27d8c63fd update default branch to release as 4.0
John W. Eaton <jwe@octave.org>
parents: 19196
diff changeset
23 ## @code{dump_prefs} is deprecated and will be removed in Octave version 4.4.
19196
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19192
diff changeset
24 ## Please use individual preference get/set routines in all new code.
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19192
diff changeset
25 ##
19192
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
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: 18857
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: 18857
diff changeset
28 ##
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
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: 18857
diff changeset
30 ## the file specified by file descriptor @var{fid}.
3449
858695b3ed62 [project @ 2000-01-18 04:08:59 by jwe]
jwe
parents: 3426
diff changeset
31 ## @end deftypefn
799
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
32
2314
949ab8eba8bc [project @ 1996-07-12 03:58:02 by jwe]
jwe
parents: 2313
diff changeset
33 ## Author: jwe
949ab8eba8bc [project @ 1996-07-12 03:58:02 by jwe]
jwe
parents: 2313
diff changeset
34
19645
ebd27d8c63fd update default branch to release as 4.0
John W. Eaton <jwe@octave.org>
parents: 19196
diff changeset
35 ## Deprecated in 4.0
ebd27d8c63fd update default branch to release as 4.0
John W. Eaton <jwe@octave.org>
parents: 19196
diff changeset
36
19192
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
37 function dump_prefs (fid)
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
38
19196
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19192
diff changeset
39 persistent warned = false;
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19192
diff changeset
40 if (! warned)
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19192
diff changeset
41 warned = true;
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19192
diff changeset
42 warning ("Octave:deprecated-function",
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19192
diff changeset
43 "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: 19192
diff changeset
44 endif
93f7f4d074b1 Deprecate dump_prefs.m
Rik <rik@octave.org>
parents: 19192
diff changeset
45
19192
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
46 if (nargin > 1)
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
47 print_usage ();
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
48 endif
799
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
49
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
50 if (nargin == 0)
19192
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
51 fid = stdout;
799
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
52 endif
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
53
19192
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
54 ## 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: 18857
diff changeset
55 ## 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: 18857
diff changeset
56 ## each time the list of preference variables changes
799
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
57
19192
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
58 ## 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: 18857
diff changeset
59 ## Example, 'gnuplot_command_end' is no longer valid.
5868
84b5cd59e627 [project @ 2006-06-29 06:39:20 by jwe]
jwe
parents: 5794
diff changeset
60
19192
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
61 pref_list = {"EDITOR"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
62 "EXEC_PATH"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
63 "IMAGE_PATH"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
64 "PAGER"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
65 "PS1"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
66 "PS2"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
67 "PS4"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
68 "beep_on_error"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
69 "completion_append_char"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
70 "crash_dumps_octave_core"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
71 "echo_executing_commands"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
72 "fixed_point_format"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
73 "gnuplot_binary"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
74 "gnuplot_command_end"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
75 "gnuplot_command_plot"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
76 "gnuplot_command_replot"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
77 "gnuplot_command_splot"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
78 "gnuplot_command_title"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
79 "gnuplot_command_using"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
80 "gnuplot_command_with"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
81 "history_file"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
82 "history_size"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
83 "ignore_function_time_stamp"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
84 "info_file"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
85 "info_program"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
86 "makeinfo_program"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
87 "max_recursion_depth"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
88 "output_max_field_width"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
89 "output_precision"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
90 "page_output_immediately"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
91 "page_screen_output"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
92 "print_answer_id_name"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
93 "print_empty_dimensions"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
94 "save_precision"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
95 "saving_history"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
96 "sighup_dumps_octave_core"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
97 "sigterm_dumps_octave_core"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
98 "silent_functions"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
99 "split_long_rows"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
100 "string_fill_char"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
101 "struct_levels_to_print"
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
102 "suppress_verbose_help_message"};
3163
7f7228c0e658 [project @ 1998-04-10 16:51:47 by jwe]
jwe
parents: 2853
diff changeset
103
19192
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
104 for i = 1:rows (pref_list)
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
105 pref = pref_list{i};
3163
7f7228c0e658 [project @ 1998-04-10 16:51:47 by jwe]
jwe
parents: 2853
diff changeset
106 try
19192
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
107 val = feval (pref);
5868
84b5cd59e627 [project @ 2006-06-29 06:39:20 by jwe]
jwe
parents: 5794
diff changeset
108 if (isnumeric (val))
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 7017
diff changeset
109 val = sprintf ("%g", val);
5868
84b5cd59e627 [project @ 2006-06-29 06:39:20 by jwe]
jwe
parents: 5794
diff changeset
110 endif
19192
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
111 fprintf (fid, " %s = %s\n", pref, val);
3163
7f7228c0e658 [project @ 1998-04-10 16:51:47 by jwe]
jwe
parents: 2853
diff changeset
112 catch
19192
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
113 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
114 end_try_catch
7f7228c0e658 [project @ 1998-04-10 16:51:47 by jwe]
jwe
parents: 2853
diff changeset
115 endfor
799
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
116
47846f7e18fc [project @ 1994-10-13 16:57:33 by jwe]
jwe
parents:
diff changeset
117 endfunction
17338
1c89599167a6 maint: End m-files with 1 blank line.
Rik <rik@octave.org>
parents: 14868
diff changeset
118
19192
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
119
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
120 %!error dump_prefs (1,2)
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 18857
diff changeset
121