about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--011load.cc2
-rw-r--r--081run_interactive.cc6
2 files changed, 7 insertions, 1 deletions
diff --git a/011load.cc b/011load.cc
index 6216c7be..e1977383 100644
--- a/011load.cc
+++ b/011load.cc
@@ -34,7 +34,7 @@ vector<recipe_ordinal> load(istream& in) {
         Recipe_ordinal[recipe_name] = Next_recipe_ordinal++;
       }
       if (Recipe.find(Recipe_ordinal[recipe_name]) != Recipe.end()) {
-        raise << "redefining recipe " << Recipe[Recipe_ordinal[recipe_name]].name << "\n";
+        if (!Loading_interactive) raise << "redefining recipe " << Recipe[Recipe_ordinal[recipe_name]].name << "\n";
         Recipe.erase(Recipe_ordinal[recipe_name]);
       }
       // todo: save user-defined recipes to mu's memory
diff --git a/081run_interactive.cc b/081run_interactive.cc
index e9f42041..76a7e2f4 100644
--- a/081run_interactive.cc
+++ b/081run_interactive.cc
@@ -218,6 +218,10 @@ long long int warnings_from_trace() {
 
 //: simpler version of run-interactive: doesn't do any running, just loads
 //: recipes and reports warnings.
+:(before "End Globals")
+bool Loading_interactive = false;
+:(before "End Setup")
+Loading_interactive = false;
 :(before "End Primitive Recipe Declarations")
 RELOAD,
 :(before "End Primitive Recipe Numbers")
@@ -225,10 +229,12 @@ Recipe_ordinal["reload"] = RELOAD;
 :(before "End Primitive Recipe Implementations")
 case RELOAD: {
   assert(scalar(ingredients.at(0)));
+  Loading_interactive = true;
   Hide_warnings = true;
   load(to_string(ingredients.at(0).at(0)));
   transform_all();
   Hide_warnings = false;
+  Loading_interactive = false;
   products.resize(1);
   products.at(0).push_back(warnings_from_trace());
   break;