Mercurial > hg > octave-lyh
diff src/input.cc @ 7294:fb902b3b2a5d
[project @ 2007-12-11 18:55:46 by jwe]
author | jwe |
---|---|
date | Tue, 11 Dec 2007 18:55:46 +0000 |
parents | e8c94e473c68 |
children | 745a8299c2b5 |
line wrap: on
line diff
--- a/src/input.cc +++ b/src/input.cc @@ -144,6 +144,9 @@ // the next user prompt. static bool Vdrawnow_requested = false; +// TRUE if we are running in the Emacs GUD mode. +static bool Vgud_mode = false; + static void do_input_echo (const std::string& input_string) { @@ -617,16 +620,25 @@ if (! nm.empty ()) { - buf << "stopped in " << nm; + if (Vgud_mode) + { + static char ctrl_z = 'Z' & 0x1f; - if (line > 0) - buf << " at line " << line; + buf << ctrl_z << ctrl_z << nm << ":" << line; + } + else + { + buf << "stopped in " << nm; + + if (line > 0) + buf << " at line " << line; + } } std::string msg = buf.str (); if (! msg.empty ()) - message ("keyboard", msg.c_str ()); + message (Vgud_mode ? 0 : "keyboard", msg.c_str ()); std::string prompt = "debug> "; @@ -1296,6 +1308,26 @@ return retval; } +DEFUN (__gud_mode__, args, , + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} __gud_mode__ ()\n\ +Undocumented internal function.\n\ +@end deftypefn") +{ + octave_value retval; + + int nargin = args.length (); + + if (nargin == 0) + retval = Vgud_mode; + else if (nargin == 1) + Vgud_mode = args(0).bool_value (); + else + print_usage (); + + return retval; +} + /* ;;; Local Variables: *** ;;; mode: C++ ***