diff options
author | Andy Wingo <wingo@pobox.com> | 2010-03-30 10:53:05 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-03-30 10:53:05 +0200 |
commit | 6128f34c4b6ae713c4dddc38093aafe7260ccab6 (patch) | |
tree | a830087ec04bb3c2d8f10c9fda5dc6cba3ed5828 /libguile/script.c | |
parent | 2533f10b40cdab357140347fe05e291f02bb5cb5 (diff) | |
download | guile-6128f34c4b6ae713c4dddc38093aafe7260ccab6.tar.gz |
correctly handle --no-autocompile (fixed broken previous patch)
* libguile/load.c (scm_init_load): Initialize %load-should-autocompile
to false.
* libguile/init.c (scm_i_init_guile):
* libguile/load.h:
* libguile/load.c (scm_init_load_should_autocompile): At the end of
init, check GUILE_AUTO_COMPILE.
* libguile/script.c (scm_compile_shell_switches): Instead of making
--autocompile / --no-autocompile render into the s-expression, just
handle them immediately, so that --no-autocompile takes effect for the
expander.
Diffstat (limited to 'libguile/script.c')
-rw-r--r-- | libguile/script.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/libguile/script.c b/libguile/script.c index 3ba656fcf..7b606ae9c 100644 --- a/libguile/script.c +++ b/libguile/script.c @@ -457,8 +457,6 @@ scm_compile_shell_switches (int argc, char **argv) int use_emacs_interface = 0; int turn_on_debugging = 0; int dont_turn_on_debugging = 0; - int turn_on_autocompile = 0; - int dont_turn_on_autocompile = 0; int i; char *argv0 = guile; @@ -595,17 +593,15 @@ scm_compile_shell_switches (int argc, char **argv) turn_on_debugging = 0; } + /* Do autocompile on/off now, because the form itself might need this + decision. */ else if (! strcmp (argv[i], "--autocompile")) - { - turn_on_autocompile = 1; - dont_turn_on_autocompile = 0; - } + scm_variable_set_x (scm_c_lookup ("%load-should-autocompile"), + SCM_BOOL_T); else if (! strcmp (argv[i], "--no-autocompile")) - { - dont_turn_on_autocompile = 1; - turn_on_autocompile = 0; - } + scm_variable_set_x (scm_c_lookup ("%load-should-autocompile"), + SCM_BOOL_F); else if (! strcmp (argv[i], "--emacs")) /* use emacs protocol */ use_emacs_interface = 1; @@ -720,14 +716,6 @@ scm_compile_shell_switches (int argc, char **argv) tail = scm_cons (scm_cons (sym_load_user_init, SCM_EOL), tail); } - /* If we are given an autocompilation arg, set %load-should-autocompile. */ - if (turn_on_autocompile || dont_turn_on_autocompile) - { - tail = scm_cons (scm_list_3 (sym_set_x, sym_sys_load_should_autocompile, - scm_from_bool (turn_on_autocompile)), - tail); - } - /* If debugging was requested, or we are interactive and debugging was not explicitly turned off, turn on debugging. */ if (turn_on_debugging || (interactive && !dont_turn_on_debugging)) |