# HG changeset patch # User Rik # Date 1374253963 25200 # Node ID 8003a4f013bedec242cf7c564205e42c03aca51d # Parent a3f6790df115358e4dbbfbdaaf18524be1c40906 Announce new prefdir, preferences functions and add to manual. * NEWS: Add prefdir, preferences to list of new functions for 3.8. * doc/interpreter/gui.txi: Add prefdir, preferences to manual. * scripts/help/__unimplemented__.m: Remove functions from list of unimplemented. * scripts/prefs/prefdir.m: Add @seealso references to docstring. * scripts/prefs/preferences.m: Use prefsfile() instead of creating name. * scripts/prefs/private/prefsfile.m: Use filesep() instead of '/' for Windows users. diff --git a/NEWS b/NEWS --- a/NEWS +++ b/NEWS @@ -191,19 +191,19 @@ atan2d erfcinv lines base64_decode erfi polyeig - base64_encode expint readline_re_read_init_file - betaincinv findfigs readline_read_init_file - built_in_docstrings_file flintmax rgbplot - cmpermute fminsearch save_default_options - cmunique gallery shrinkfaces - colorcube gco splinefit - copyobj hdl2struct stemleaf - dawson history_save strjoin - dblist imformats struct2hdl - debug_jit importdata tetramesh - doc_cache_create iscolormap waterfall - ellipj jit_enable - ellipke jit_startcnt + base64_encode expint prefdir + betaincinv findfigs preferences + built_in_docstrings_file flintmax readline_re_read_init_file + cmpermute fminsearch readline_read_init_file + cmunique gallery rgbplot + colorcube gco save_default_options + copyobj hdl2struct shrinkfaces + dawson history_save splinefit + dblist imformats stemleaf + debug_jit importdata strjoin + doc_cache_create iscolormap struct2hdl + ellipj jit_enable tetramesh + ellipke jit_startcnt waterfall ** Deprecated functions. diff --git a/doc/interpreter/gui.txi b/doc/interpreter/gui.txi --- a/doc/interpreter/gui.txi +++ b/doc/interpreter/gui.txi @@ -81,13 +81,17 @@ @node User-Defined Preferences @section User-Defined Preferences +@DOCSTRING(getpref) + +@DOCSTRING(setpref) + @DOCSTRING(addpref) -@DOCSTRING(getpref) +@DOCSTRING(rmpref) @DOCSTRING(ispref) -@DOCSTRING(rmpref) +@DOCSTRING(prefdir) -@DOCSTRING(setpref) +@DOCSTRING(preferences) diff --git a/scripts/help/__unimplemented__.m b/scripts/help/__unimplemented__.m --- a/scripts/help/__unimplemented__.m +++ b/scripts/help/__unimplemented__.m @@ -336,8 +336,6 @@ "plotbrowser", "plotedit", "plottools", - "prefdir", - "preferences", "printdlg", "printopt", "printpreview", diff --git a/scripts/prefs/prefdir.m b/scripts/prefs/prefdir.m --- a/scripts/prefs/prefdir.m +++ b/scripts/prefs/prefdir.m @@ -17,21 +17,22 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} prefdir -## @deftypefnx {Function File} {folder =} prefdir -## Return the folder that contains the preferences for octave. +## @deftypefn {Function File} {} prefdir +## @deftypefnx {Function File} {@var{dir} =} prefdir +## Return the directory that contains the preferences for Octave. ## ## Examples: ## -## Display the preferences folder +## Display the preferences directory ## @example ## prefdir ## @end example ## ## Change to the preferences folder ## @example -## cd(prefdir) +## cd (prefdir) ## @end example +## @seealso{preferences, getpref, setpref, addpref, rmpref} ## @end deftypefn ## Author: John Donoghue @@ -39,6 +40,7 @@ function folder = prefdir () - folder = getenv("HOME"); - -endfunction \ No newline at end of file + folder = getenv ("HOME"); + +endfunction + diff --git a/scripts/prefs/preferences.m b/scripts/prefs/preferences.m --- a/scripts/prefs/preferences.m +++ b/scripts/prefs/preferences.m @@ -18,14 +18,12 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} preferences -## Display the preferences settings. If in GUI mode, display using the preferences dialog, otherwise display in EDITOR. +## Display preferences settings for Octave. ## -## Example: -# -## @example -## preferences -## @end example +## If in GUI mode, display using the preferences dialog, otherwise display +## the preferences with the @code{edit} function. ## +## @seealso{getpref, setpref, addpref, rmpref} ## @end deftypefn ## Author: John Donoghue @@ -33,10 +31,9 @@ function preferences () if (! __octave_link_enabled__ ()) - prefs_file = [ getenv("HOME") "/.octave_prefs" ]; - - edit (prefs_file); + edit (prefsfile ()); else - __octave_link_show_preferences__ (); + __octave_link_show_preferences__ (); endif -endfunction \ No newline at end of file +endfunction + diff --git a/scripts/prefs/private/prefsfile.m b/scripts/prefs/private/prefsfile.m --- a/scripts/prefs/private/prefsfile.m +++ b/scripts/prefs/private/prefsfile.m @@ -25,9 +25,8 @@ function retval = prefsfile () - retval = [ prefdir() "/.octave_prefs" ]; + retval = [prefdir() filesep() ".octave_prefs"]; - endfunction %% Testing these functions will require some care to avoid wiping out