]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/parse-scm.cc (internal_ly_parse_scm)[PAGE_LAYOUT]: Import
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 14 Mar 2004 22:37:19 +0000 (22:37 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 14 Mar 2004 22:37:19 +0000 (22:37 +0000)
lily functions in safe mode.

* lily/paper-outputter.cc (Paper_outputter): Eval output-ps in
safe mode.

ChangeLog
lily/lily-guile.cc
lily/paper-outputter.cc
lily/parse-scm.cc

index dbef003a20a620aa1e36a57ef73353fa9e15ed6c..509fa53e1b1adfdbbcb69137cd4239b375b0c9c7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-03-14  Jan Nieuwenhuizen  <janneke@gnu.org>
 
+       * lily/parse-scm.cc (internal_ly_parse_scm)[PAGE_LAYOUT]: Import
+       lily functions in safe mode.
+
        * scripts/lilypond-book.py (Lilypond_snippet.output_texinfo):
        Print filename for HTML, LATEX, before texidoc.
 
@@ -8,8 +11,8 @@
 
        * scm/lily.scm: Do not load output-ps module.
 
-       * lily/paper-outputter.cc (Paper_outputter): Attempt to eval
-       output-ps in safe mode.
+       * lily/paper-outputter.cc (Paper_outputter): Eval output-ps in
+       safe mode.
 
 2004-03-14  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
index 4b2584fc3c6e661796e63ebf61be34e0ff3577bc..ecde4495f28634b7cd1a34c8e3dc8eedead8f540 100644 (file)
@@ -102,10 +102,10 @@ gulp_file_to_string (String fn)
   return result;
 }
 
-LY_DEFINE (ly_gulp_file, "ly:gulp-file", 1,0, 0,
-         (SCM name),
-         "Read the file @var{name}, and return its contents in a string. The "
-" file is looked up using the search path.")
+LY_DEFINE (ly_gulp_file, "ly:gulp-file",
+          1, 0, 0, (SCM name),
+         "Read the file @var{name}, and return its contents in a string.  "
+          "The file is looked up using the search path.")
 {
   return scm_makfrom0str (gulp_file_to_string (ly_scm2string (name)).to_str0 ());
 }
index 134b19bc4c01f30d6c1f545d431bfc8219b1e5a4..0f88314df8c90aef8c00fa86f40289818a967381 100644 (file)
@@ -53,6 +53,7 @@ Paper_outputter::Paper_outputter (String name)
       else
        output_module_ = scm_c_resolve_module (name.to_str0 ());
 
+      /* FIXME: output-lib should be module, that can be imported.  */
 #define IMPORT_LESS 1 // only import the list of IMPORTS
 #if IMPORT_LESS
       scm_c_use_module ("lily");
@@ -64,10 +65,12 @@ Paper_outputter::Paper_outputter (String name)
        "ly:output-def-scope",
        "ly:gulp-file",
        "ly:number->string",
-       "assoc-get",
-       "number-pair->string",
-       "inexact->string",
+       
+       "number-pair->string",       /* output-lib.scm */
        "numbers->string",
+       
+       "assoc-get",
+       "inexact->string",           /* insecure guile? */
 #if IMPORT_LESS        
        "string-index",              /* from srfi srfi-13 */
        "regexp-substitute/global",  /* from (ice9 regex) */
index a5de3e9866121d64c23051fb1a227679382c1b45..255d5c03f994bc7d47e9708c0a297e49c12a524d 100644 (file)
@@ -1,5 +1,6 @@
 #include <stdio.h>
 
+#include "ly-module.hh"
 #include "lily-guile.hh"
 #include "parse-scm.hh"
 #include "string.hh"
@@ -30,7 +31,11 @@ internal_ly_parse_scm (Parse_start * ps, bool safe)
        {
          static SCM safe_module;
          if (!safe_module)
-           safe_module = scm_primitive_eval (ly_symbol2scm ("safe-module"));
+           {
+             safe_module = scm_primitive_eval (ly_symbol2scm ("safe-module"));
+             if (output_format_global == PAGE_LAYOUT)
+               ly_import_module (safe_module, scm_c_resolve_module ("lily"));
+           }
          answer = scm_eval (form, safe_module);
        }
       else