# HG changeset patch # User John W. Eaton # Date 1349247064 14400 # Node ID b1ff8c83e232a718b498d686a596d822a79d77c2 # Parent 8b5fc510c6d6ac856a20bab5f8f1c3d2f62541f7 set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options * octave.cc (octave_process_command_line): Set Vdoc_cache_file and Vtexi_macros_file directly. (octave_initialize_interpreter): Don't call bind_internal_variable to set Vdoc_cache_file or Vtexi_macros_file. (doc_cache_file, Vtexi_macros_file): Delete unused static variables. * defaults.cc (set_default_doc_cache_file): Don't set Vdoc_cache_file unless it is empty. (set_default_texi_macros_file): Don't set Vtexi_macros_file unless it is empty. diff -r 8b5fc510c6d6 -r b1ff8c83e232 libinterp/interpfcn/defaults.cc --- a/libinterp/interpfcn/defaults.cc Wed Oct 03 02:43:32 2012 -0400 +++ b/libinterp/interpfcn/defaults.cc Wed Oct 03 02:51:04 2012 -0400 @@ -296,21 +296,27 @@ static void set_default_doc_cache_file (void) { - std::string def_file = subst_octave_home (OCTAVE_DOC_CACHE_FILE); + if (Vdoc_cache_file.empty ()) + { + std::string def_file = subst_octave_home (OCTAVE_DOC_CACHE_FILE); - std::string env_file = octave_env::getenv ("OCTAVE_DOC_CACHE_FILE"); + std::string env_file = octave_env::getenv ("OCTAVE_DOC_CACHE_FILE"); - Vdoc_cache_file = env_file.empty () ? def_file : env_file; + Vdoc_cache_file = env_file.empty () ? def_file : env_file; + } } static void set_default_texi_macros_file (void) { - std::string def_file = subst_octave_home (OCTAVE_TEXI_MACROS_FILE); + if (Vtexi_macros_file.empty ()) + { + std::string def_file = subst_octave_home (OCTAVE_TEXI_MACROS_FILE); - std::string env_file = octave_env::getenv ("OCTAVE_TEXI_MACROS_FILE"); + std::string env_file = octave_env::getenv ("OCTAVE_TEXI_MACROS_FILE"); - Vtexi_macros_file = env_file.empty () ? def_file : env_file; + Vtexi_macros_file = env_file.empty () ? def_file : env_file; + } } static void diff -r 8b5fc510c6d6 -r b1ff8c83e232 libinterp/octave.cc --- a/libinterp/octave.cc Wed Oct 03 02:43:32 2012 -0400 +++ b/libinterp/octave.cc Wed Oct 03 02:51:04 2012 -0400 @@ -146,10 +146,6 @@ // (--path; -p) static std::list command_line_path; -// The file used for the doc string cache. -// (--doc-cache-file) -static std::string doc_cache_file; - // The value for "EXEC_PATH" specified on the command line. // (--exec-path) static std::string exec_path; @@ -162,10 +158,6 @@ // (--no-window-system) static bool no_window_system = false; -// The value for "texi_macros_file" specified on the command line. -// (--texi-macros-file) -static std::string texi_macros_file; - // Usage message static const char *usage_string = "octave [-HVdfhiqvx] [--debug] [--echo-commands] [--eval CODE]\n\ @@ -773,7 +765,7 @@ case DOC_CACHE_FILE_OPTION: if (optarg) - doc_cache_file = optarg; + Vdoc_cache_file = optarg; break; case EVAL_OPTION: @@ -852,7 +844,7 @@ case TEXI_MACROS_FILE_OPTION: if (optarg) - texi_macros_file = optarg; + Vtexi_macros_file = optarg; break; case TRADITIONAL_OPTION: @@ -933,9 +925,6 @@ it != command_line_path.end (); it++) load_path::set_command_line_path (*it); - if (! doc_cache_file.empty ()) - bind_internal_variable ("doc_cache_file", doc_cache_file); - if (! exec_path.empty ()) set_exec_path (exec_path); @@ -945,9 +934,6 @@ if (no_window_system) display_info::no_window_system (); - if (! texi_macros_file.empty ()) - bind_internal_variable ("texi_macros_file", texi_macros_file); - if (jit_debug_option) bind_internal_variable ("enable_jit_debugging", true);