annotate scripts/prefs/prefdir.m @ 27919:1891570abac8

update Octave Project Developers copyright for the new year In files that have the "Octave Project Developers" copyright notice, update for 2020.
author John W. Eaton <jwe@octave.org>
date Mon, 06 Jan 2020 22:29:51 -0500
parents b442ec6dda5c
children bd51beb6205e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27919
1891570abac8 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27918
diff changeset
1 ## Copyright (C) 2013-2020 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
2 ##
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
3 ## See the file COPYRIGHT.md in the top-level directory of this distribution
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
4 ## or <https://octave.org/COPYRIGHT.html/>.
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
5 ##
17010
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
6 ##
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
7 ## This file is part of Octave.
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
8 ##
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
9 ## Octave is free software: you can redistribute it and/or modify it
17010
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
10 ## under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
11 ## the Free Software Foundation, either version 3 of the License, or
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22549
diff changeset
12 ## (at your option) any later version.
17010
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
13 ##
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
14 ## Octave is distributed in the hope that it will be useful, but
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
15 ## WITHOUT ANY WARRANTY; without even the implied warranty of
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22549
diff changeset
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22549
diff changeset
17 ## GNU General Public License for more details.
17010
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
18 ##
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
19 ## You should have received a copy of the GNU General Public License
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
20 ## along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
21 ## <https://www.gnu.org/licenses/>.
17010
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
22
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
23 ## -*- texinfo -*-
20852
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 20834
diff changeset
24 ## @deftypefn {} {} prefdir
21906
e0952881e051 prefdir: Turn into a public function, make Matlab compatible (bug #48221)
Mike Miller <mtmiller@octave.org>
parents: 20852
diff changeset
25 ## @deftypefnx {} {} prefdir (1)
20852
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 20834
diff changeset
26 ## @deftypefnx {} {@var{dir} =} prefdir
20834
27b333c88c8e Overhaul m-files in prefs directory.
Rik <rik@octave.org>
parents: 20017
diff changeset
27 ## Return the directory that holds the preferences for Octave.
17010
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
28 ##
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
29 ## Examples:
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
30 ##
17017
8003a4f013be Announce new prefdir, preferences functions and add to manual.
Rik <rik@octave.org>
parents: 17010
diff changeset
31 ## Display the preferences directory
17170
d6499c14021c doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents: 17020
diff changeset
32 ##
17010
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
33 ## @example
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
34 ## prefdir
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
35 ## @end example
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
36 ##
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
37 ## Change to the preferences folder
17170
d6499c14021c doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents: 17020
diff changeset
38 ##
17010
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
39 ## @example
17017
8003a4f013be Announce new prefdir, preferences functions and add to manual.
Rik <rik@octave.org>
parents: 17010
diff changeset
40 ## cd (prefdir)
17010
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
41 ## @end example
21906
e0952881e051 prefdir: Turn into a public function, make Matlab compatible (bug #48221)
Mike Miller <mtmiller@octave.org>
parents: 20852
diff changeset
42 ##
e0952881e051 prefdir: Turn into a public function, make Matlab compatible (bug #48221)
Mike Miller <mtmiller@octave.org>
parents: 20852
diff changeset
43 ## If called with an argument, the preferences directory is created if it
e0952881e051 prefdir: Turn into a public function, make Matlab compatible (bug #48221)
Mike Miller <mtmiller@octave.org>
parents: 20852
diff changeset
44 ## doesn't already exist.
17020
960ac70ac8f3 prefdir.m: Adjust seealso references in docstring.
Rik <rik@octave.org>
parents: 17017
diff changeset
45 ## @seealso{getpref, setpref, addpref, rmpref, ispref}
17010
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
46 ## @end deftypefn
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
47
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
48 ## Author: John Donoghue
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
49
20834
27b333c88c8e Overhaul m-files in prefs directory.
Rik <rik@octave.org>
parents: 20017
diff changeset
50 function dir = prefdir ()
17010
c50ee84842a9 Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
51
20834
27b333c88c8e Overhaul m-files in prefs directory.
Rik <rik@octave.org>
parents: 20017
diff changeset
52 dir = get_home_directory ();
17017
8003a4f013be Announce new prefdir, preferences functions and add to manual.
Rik <rik@octave.org>
parents: 17010
diff changeset
53
21906
e0952881e051 prefdir: Turn into a public function, make Matlab compatible (bug #48221)
Mike Miller <mtmiller@octave.org>
parents: 20852
diff changeset
54 if (nargin > 0)
25787
3293cd2651fb prefer 'isfolder' over 'exist (..., "dir")' in Octave functions
Mike Miller <mtmiller@octave.org>
parents: 25054
diff changeset
55 if (! isfolder (dir))
21906
e0952881e051 prefdir: Turn into a public function, make Matlab compatible (bug #48221)
Mike Miller <mtmiller@octave.org>
parents: 20852
diff changeset
56 mkdir (dir);
e0952881e051 prefdir: Turn into a public function, make Matlab compatible (bug #48221)
Mike Miller <mtmiller@octave.org>
parents: 20852
diff changeset
57 endif
e0952881e051 prefdir: Turn into a public function, make Matlab compatible (bug #48221)
Mike Miller <mtmiller@octave.org>
parents: 20852
diff changeset
58 endif
e0952881e051 prefdir: Turn into a public function, make Matlab compatible (bug #48221)
Mike Miller <mtmiller@octave.org>
parents: 20852
diff changeset
59
17017
8003a4f013be Announce new prefdir, preferences functions and add to manual.
Rik <rik@octave.org>
parents: 17010
diff changeset
60 endfunction