view scripts/prefs/private/saveprefs.m @ 20834:27b333c88c8e

Overhaul m-files in prefs directory. Update docstrings, re-code to match Matlab behavior, put input validation first, add BIST tests. * addpref.m, getpref.m, ispref.m, preferences.m, rmpref.m, setpref.m: Update docstrings, re-code to match Matlab behavior, put input validation first, add BIST tests. * loadprefs.m, prefsfile.m, saveprefs.m: Update docstring. Remove ## note about testing. * saveprefs.m: Update docstring. Remove ## note about testing. Change function declaration to not return any value. * scripts/prefs/private/prefdir.m: Move file from scripts/prefs to private directory. Match variable names in doc to those in function. * module.mk: Change build system to find prefdir.m in private directory.
author Rik <rik@octave.org>
date Wed, 09 Dec 2015 12:01:31 -0800
parents 9fc020886ae9
children 516bb87ea72e
line wrap: on
line source

## Copyright (C) 2012-2015 John W. Eaton
##
## 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 {Function File} {} saveprefs (@var{s})
## Save user preferences in the structure @var{s} to Octave's preference file.
## @end deftypefn

## Author: jwe

function saveprefs (s)

  prefs = s;

  save (prefsfile (), "prefs");

endfunction