# HG changeset patch # User John W. Eaton # Date 1349246612 14400 # Node ID 8b5fc510c6d6ac856a20bab5f8f1c3d2f62541f7 # Parent 7760d5eff9b2821a419a365059be58e7133707fc don't use bind_internal_variable when handling -x option * octave.cc (echo_executing_commands): Delete static variable. (octave_process_command_line): Call Fecho_executing_commands directly here for -H option. (octave_initialize_interpreter): Don't call bind_internal_variable to set echo_executing_commands variable here. (octave_execute_interpreter): Call Fecho_executing_commands directly here instead of using bind_internal_variable. diff -r 7760d5eff9b2 -r 8b5fc510c6d6 libinterp/octave.cc --- a/libinterp/octave.cc Wed Oct 03 02:38:53 2012 -0400 +++ b/libinterp/octave.cc Wed Oct 03 02:43:32 2012 -0400 @@ -146,11 +146,6 @@ // (--path; -p) static std::list command_line_path; -// Flags used to determine what commands should be echoed when they are -// parsed and executed. -// (--echo-commands; -x) -static int echo_executing_commands = 0; - // The file used for the doc string cache. // (--doc-cache-file) static std::string doc_cache_file; @@ -761,8 +756,10 @@ break; case 'x': - echo_executing_commands - = (ECHO_SCRIPTS | ECHO_FUNCTIONS | ECHO_CMD_LINE); + { + int val = ECHO_SCRIPTS | ECHO_FUNCTIONS | ECHO_CMD_LINE; + Fecho_executing_commands (octave_value (val)); + } break; case 'v': @@ -936,10 +933,6 @@ it != command_line_path.end (); it++) load_path::set_command_line_path (*it); - if (echo_executing_commands) - bind_internal_variable ("echo_executing_commands", - echo_executing_commands); - if (! doc_cache_file.empty ()) bind_internal_variable ("doc_cache_file", doc_cache_file); @@ -1067,7 +1060,7 @@ // FIXME -- is this the right thing to do? - bind_internal_variable ("echo_executing_commands", ECHO_CMD_LINE); + Fecho_executing_commands (octave_value (ECHO_CMD_LINE)); } if (octave_embedded)