]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-parser-scheme.cc
*** empty log message ***
[lilypond.git] / lily / lily-parser-scheme.cc
index 030b55ce091aeea01eb098c669272dd8e9fed995..0563d403c058a5e36e8c7124f6a1b02134e9d722 100644 (file)
@@ -27,7 +27,7 @@ LY_DEFINE (ly_set_point_and_click, "ly:set-point-and-click",
           "Deprecated.")
 {
   (void) what;
-  warning ("ly:set-point-and-click called");
+  warning (_f ("deprecated function called: %s", "ly:set-point-and-click"));
   return SCM_UNSPECIFIED;
 }
 
@@ -54,7 +54,25 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
   out_file_name.dir_ = "";
 
   if (!output_name_global.is_empty ())
-    out_file_name = File_name (output_name_global);
+    {
+      if (is_dir (output_name_global))
+       {
+         char cwd[PATH_MAX];
+         getcwd (cwd, PATH_MAX);
+
+         if (output_name_global != cwd)
+           {
+             global_path.prepend (cwd);
+             message (_f ("Changing working directory to `%s'",
+                          output_name_global.to_str0 ()));
+             chdir (output_name_global.to_str0 ());
+             
+           }
+         output_name_global = "";
+       }
+      else      
+       out_file_name = File_name (output_name_global);
+    }
 
   String init;
   if (!init_name_global.is_empty ())
@@ -84,7 +102,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
       sources.set_path (&global_path);
 
       String mapped_fn = map_file_name (file_name);
-      progress_indication (_f ("Processing `%s'", mapped_fn.to_str0 ()));
+      message (_f ("Processing `%s'", mapped_fn.to_str0 ()));
       progress_indication ("\n");
 
       Lily_parser *parser = new Lily_parser (&sources);
@@ -194,7 +212,8 @@ LY_DEFINE (ly_parser_print_score, "ly:parser-print-score",
   SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG1, __FUNCTION__, "parser");
   SCM_ASSERT_TYPE (score, score_smob, SCM_ARG2, __FUNCTION__, "score");
 
-  SCM header = ly_c_module_p (score->header_) ? score->header_
+  SCM header = ly_c_module_p (score->header_)
+    ? score->header_
     : parser->lexer_->lookup_identifier ("$globalheader");
 
   File_name outname (parser->output_basename_);
@@ -212,12 +231,15 @@ LY_DEFINE (ly_parser_print_score, "ly:parser-print-score",
   if (score->defs_.is_empty ())
     {
       Output_def *layout = get_layout (parser);
-      default_rendering (score->get_music (), layout->self_scm (),
-                        get_paper (parser)->self_scm (),
+      default_rendering (score->get_music (),
+                        layout->self_scm (),
+                        paper,
                         header, os, key->self_scm ());
+      
       scm_gc_unprotect_object (layout->self_scm ());
     }
 
+  scm_gc_unprotect_object (paper);
   scm_gc_unprotect_object (key->self_scm ());
   return SCM_UNSPECIFIED;
 }