Mercurial > octave-nkf
changeset 20511:7ddb10b31126 stable
__finish__.m: Change from function to script to stay in base workspace (bug #45869).
* __finish__.m: Remove function declaration changing it to a script.
Update docstring.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 03 Sep 2015 11:22:35 -0700 |
parents | ab4090316e6d |
children | a9a1f021d96b 3be09ebf2105 |
files | scripts/startup/__finish__.m |
diffstat | 1 files changed, 15 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/startup/__finish__.m Mon Aug 24 15:27:03 2015 -0700 +++ b/scripts/startup/__finish__.m Thu Sep 03 11:22:35 2015 -0700 @@ -17,27 +17,25 @@ ## <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {} __finish__ () -## Undocumented internal function. +## @deftypefn {Script File} {} __finish__ +## Check for the existence of the function/script, @file{finish}, in the +## path or current working directory and execute it. +## +## This function is intended to be excecuted upon a clean exit from Octave. +## This is accomplished in the system script @file{startup/octaverc} by use of +## the built-in function @code{atexit}. +## @seealso{atexit} ## @end deftypefn -## Check for the existence of the function/script, @file{finish}, in the -## path or current working directory and execute it. This function is -## intended to be excecuted upon a clean exit from Octave. This is -## accomplished in the system script @file{startup/octaverc} by use of -## the built-in function @code{atexit}. +## No function declaration, this is is an Octave script. This means we are +## still in the base workspace with access to all user variables. -function __finish__ () - - if (exist ("finish", "file")) - ## No arg list here since finish might be a script. - finish; - endif - -endfunction +if (exist ("finish", "file")) + ## No arg list here since finish might be a script. + finish; +endif - -## No test needed for internal helper function. +## No test needed for internal helper m-file. %!assert (1)