comparison 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
comparison
equal deleted inserted replaced
7293:d45fc511fc5d 7294:fb902b3b2a5d
142 142
143 // TRUE if the plotting system has requested a call to drawnow at 143 // TRUE if the plotting system has requested a call to drawnow at
144 // the next user prompt. 144 // the next user prompt.
145 static bool Vdrawnow_requested = false; 145 static bool Vdrawnow_requested = false;
146 146
147 // TRUE if we are running in the Emacs GUD mode.
148 static bool Vgud_mode = false;
149
147 static void 150 static void
148 do_input_echo (const std::string& input_string) 151 do_input_echo (const std::string& input_string)
149 { 152 {
150 int do_echo = reading_script_file ? 153 int do_echo = reading_script_file ?
151 (Vecho_executing_commands & ECHO_SCRIPTS) 154 (Vecho_executing_commands & ECHO_SCRIPTS)
615 618
616 std::ostringstream buf; 619 std::ostringstream buf;
617 620
618 if (! nm.empty ()) 621 if (! nm.empty ())
619 { 622 {
620 buf << "stopped in " << nm; 623 if (Vgud_mode)
621 624 {
622 if (line > 0) 625 static char ctrl_z = 'Z' & 0x1f;
623 buf << " at line " << line; 626
627 buf << ctrl_z << ctrl_z << nm << ":" << line;
628 }
629 else
630 {
631 buf << "stopped in " << nm;
632
633 if (line > 0)
634 buf << " at line " << line;
635 }
624 } 636 }
625 637
626 std::string msg = buf.str (); 638 std::string msg = buf.str ();
627 639
628 if (! msg.empty ()) 640 if (! msg.empty ())
629 message ("keyboard", msg.c_str ()); 641 message (Vgud_mode ? 0 : "keyboard", msg.c_str ());
630 642
631 std::string prompt = "debug> "; 643 std::string prompt = "debug> ";
632 644
633 if (nargin > 0) 645 if (nargin > 0)
634 { 646 {
1294 print_usage (); 1306 print_usage ();
1295 1307
1296 return retval; 1308 return retval;
1297 } 1309 }
1298 1310
1311 DEFUN (__gud_mode__, args, ,
1312 "-*- texinfo -*-\n\
1313 @deftypefn {Built-in Function} {} __gud_mode__ ()\n\
1314 Undocumented internal function.\n\
1315 @end deftypefn")
1316 {
1317 octave_value retval;
1318
1319 int nargin = args.length ();
1320
1321 if (nargin == 0)
1322 retval = Vgud_mode;
1323 else if (nargin == 1)
1324 Vgud_mode = args(0).bool_value ();
1325 else
1326 print_usage ();
1327
1328 return retval;
1329 }
1330
1299 /* 1331 /*
1300 ;;; Local Variables: *** 1332 ;;; Local Variables: ***
1301 ;;; mode: C++ *** 1333 ;;; mode: C++ ***
1302 ;;; End: *** 1334 ;;; End: ***
1303 */ 1335 */