]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4462/2: For Scm_module::import, only look at exported variables
authorDavid Kastrup <dak@gnu.org>
Fri, 26 Jun 2015 09:39:54 +0000 (11:39 +0200)
committerDavid Kastrup <dak@gnu.org>
Thu, 2 Jul 2015 10:40:33 +0000 (12:40 +0200)
lily/lily-modules.cc

index f34e7e30416356949bc461e52e38fd27d4d5e0d7..b5b61ee6bb27d0ae2638a5ebeda5e100291c4a0d 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 interface = 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_))
+    interface = Guile_user::module_public_interface (interface);
   for (Variable_record *p = variables_; p;)
     {
       Variable_record *next = p->next_;
-      p->var_->import (module_, p->name_);
+      p->var_->import (interface, p->name_);
       delete p;
       p = next;
     }
   variables_ = 0;
+  module_ = interface;
 }
 
 void