]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-modules.cc
Issue 4503 (3/4) Eliminate Tie::get_position_generic
[lilypond.git] / lily / lily-modules.cc
index f34e7e30416356949bc461e52e38fd27d4d5e0d7..be736615d6e25e1d3f24e64ed4761edbebf86a20 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include "lily-modules.hh"
+#include "lily-imports.hh"
 
 struct Scm_module::Variable_record
 {
@@ -67,15 +68,21 @@ void
 Scm_module::import ()
 {
   assert (SCM_UNBNDP (module_));
-  module_ = scm_c_resolve_module (name_);
+  SCM intrface = scm_c_resolve_module (name_);
+  // Using only the public interface is a voluntary form of access
+  // control in GUILE.  It would be cumbersome to do so until
+  // Guile_user itself is imported.
+  if (SCM_MODULEP (Guile_user::module.module_))
+    intrface = Guile_user::module_public_interface (intrface);
   for (Variable_record *p = variables_; p;)
     {
       Variable_record *next = p->next_;
-      p->var_->import (module_, p->name_);
+      p->var_->import (intrface, p->name_);
       delete p;
       p = next;
     }
   variables_ = 0;
+  module_ = intrface;
 }
 
 void