Mercurial > octave
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 |
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 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
2313 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
799 | 18 |
3449 | 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 | 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 | 24 ## Please use individual preference get/set routines in all new code. |
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 | 31 ## @end deftypefn |
799 | 32 |
2314 | 33 ## Author: jwe |
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 | 39 persistent warned = false; |
40 if (! warned) | |
41 warned = true; | |
42 warning ("Octave:deprecated-function", | |
43 "dump_prefs is obsolete and will be removed from a future version of Octave, recode using individual preference get/set routines"); | |
44 endif | |
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 | 49 |
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 | 52 endif |
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 | 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 | 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 | 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 | 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 | 108 if (isnumeric (val)) |
10549 | 109 val = sprintf ("%g", val); |
5868 | 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 | 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 | 114 end_try_catch |
115 endfor | |
799 | 116 |
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 |