Mercurial > hg > octave-lyh
diff src/input.cc @ 3707:58140935c812
[project @ 2000-07-28 09:40:52 by jwe]
author | jwe |
---|---|
date | Fri, 28 Jul 2000 09:40:54 +0000 |
parents | 4b1a93f83264 |
children | b65077dfa1b1 |
line wrap: on
line diff
--- a/src/input.cc +++ b/src/input.cc @@ -504,14 +504,14 @@ std::string prompt ("debug> "); if (nargin > 0) - { - prompt = args(0).string_value (); + { + prompt = args(0).string_value (); - if (error_state) - { - error ("input: unrecognized argument"); - return retval; - } + if (error_state) + { + error ("input: unrecognized argument"); + return retval; + } } again: @@ -640,6 +640,35 @@ command_history::ignore_entries (! Vsaving_history); } +octave_value +do_keyboard (const octave_value_list& args) +{ + octave_value retval; + + int nargin = args.length (); + + assert (nargin == 0 || nargin == 1); + + unwind_protect::begin_frame ("do_keyboard"); + + // XXX FIXME XXX -- we shouldn't need both the + // command_history object and the + // Vsaving_history variable... + command_history::ignore_entries (false); + + unwind_protect::add (restore_command_history, 0); + + unwind_protect_bool (Vsaving_history); + + Vsaving_history = true; + + retval = get_user_input (args, true, 0); + + unwind_protect::run_frame ("do_keyboard"); + + return retval; +} + DEFUN (keyboard, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} keyboard (@var{prompt})\n\ @@ -660,24 +689,7 @@ int nargin = args.length (); if (nargin == 0 || nargin == 1) - { - unwind_protect::begin_frame ("keyboard"); - - // XXX FIXME XXX -- we shouldn't need both the - // command_history object and the - // Vsaving_history variable... - command_history::ignore_entries (false); - - unwind_protect::add (restore_command_history, 0); - - unwind_protect_bool (Vsaving_history); - - Vsaving_history = true; - - retval = get_user_input (args, true, 0); - - unwind_protect::run_frame ("keyboard"); - } + do_keyboard (args); else print_usage ("keyboard");