Mercurial > hg > octave-nkf
changeset 15477:8b5fc510c6d6
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.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 03 Oct 2012 02:43:32 -0400 |
parents | 7760d5eff9b2 |
children | b1ff8c83e232 |
files | libinterp/octave.cc |
diffstat | 1 files changed, 5 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/octave.cc +++ b/libinterp/octave.cc @@ -146,11 +146,6 @@ // (--path; -p) static std::list<std::string> 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)