# HG changeset patch # User Rik # Date 1441304555 25200 # Node ID 7ddb10b311265174e6d7537687c75ab21a093238 # Parent ab4090316e6d94b62f39883e79323c076c679a9c __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. diff -r ab4090316e6d -r 7ddb10b31126 scripts/startup/__finish__.m --- 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 @@ ## . ## -*- 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)