]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-guile.cc
* lily/align-interface.cc (align_elements_to_extents): warn if
[lilypond.git] / lily / lily-guile.cc
index 55f5de5a239ae1038e4737bbb78ca0395268b9e6..a7b3511a63ad929afed7ed18ac452a3fa04c7681 100644 (file)
@@ -7,25 +7,27 @@
   Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include "lily-guile.hh"
+
 #include <cstdio>
 #include <cstdlib>
 #include <cstring> /* strdup, strchr */
 #include <cctype>
-#include <libintl.h>           // gettext on macos x
 
 #include "config.hh"
-#include "version.hh"
-#include "lily-guile.hh"
+
+#include "dimensions.hh"
+#include "direction.hh"
+#include "file-path.hh"
+#include "international.hh"
 #include "libc-extension.hh"
 #include "main.hh"
-#include "file-path.hh"
-#include "warn.hh"
-#include "direction.hh"
+#include "misc.hh"
 #include "offset.hh"
 #include "pitch.hh"
-#include "dimensions.hh"
 #include "source-file.hh"
-#include "misc.hh"
+#include "version.hh"
+#include "warn.hh"
 
 // #define TEST_GC
 
@@ -200,9 +202,7 @@ ly_init_ly_module (void *)
 
 #if KPATHSEA
   if (is_TeX_format_global)
-    {
-      initialize_kpathsea ();
-    }
+    initialize_kpathsea ();
 #endif
 
   scm_primitive_load_path (scm_makfrom0str ("lily.scm"));
@@ -327,35 +327,7 @@ ly_deep_copy (SCM src)
   return src;
 }
 
-SCM
-ly_chain_assoc_get (SCM key, SCM achain, SCM dfault)
-{
-  if (scm_is_pair (achain))
-    {
-      SCM handle = scm_assoc (key, scm_car (achain));
-      if (scm_is_pair (handle))
-       return scm_cdr (handle);
-      else
-       return ly_chain_assoc (key, scm_cdr (achain));
-    }
-  else
-    return dfault;
-}
 
-SCM
-ly_chain_assoc (SCM key, SCM achain)
-{
-  if (scm_is_pair (achain))
-    {
-      SCM handle = scm_assoc (key, scm_car (achain));
-      if (scm_is_pair (handle))
-       return handle;
-      else
-       return ly_chain_assoc (key, scm_cdr (achain));
-    }
-  else
-    return SCM_BOOL_F;
-}
 
 /* looks the key up in the cdrs of the alist-keys
    - ignoring the car and ignoring non-pair keys.
@@ -483,16 +455,16 @@ type_check_assignment (SCM sym, SCM val, SCM type_symbol)
 
   if (type != SCM_EOL && !ly_c_procedure_p (type))
     {
-      warning (_f ("Can't find property type-check for `%s' (%s).",
+      warning (_f ("can't find property type-check for `%s' (%s).",
                   ly_symbol2string (sym).to_str0 (),
                   ly_symbol2string (type_symbol).to_str0 ())
-              + "  " + _ ("Perhaps you made a typing error?"));
+              + "  " + _ ("perhaps a typing error?"));
 
       /* Be strict when being anal :) */
       if (do_internal_type_checking_global)
        abort ();
 
-      warning (_ ("Doing assignment anyway."));
+      warning (_ ("doing assignment anyway"));
     }
   else
     {
@@ -500,17 +472,15 @@ type_check_assignment (SCM sym, SCM val, SCM type_symbol)
          && ly_c_procedure_p (type)
          && scm_call_1 (type, val) == SCM_BOOL_F)
        {
-         SCM errport = scm_current_error_port ();
          ok = false;
          SCM typefunc = ly_lily_module_constant ("type-name");
          SCM type_name = scm_call_1 (typefunc, type);
 
-         scm_puts (_f ("Type check for `%s' failed; value `%s' must be of type `%s'",
-                       ly_symbol2string (sym).to_str0 (),
-                       print_scm_val (val),
-                       ly_scm2string (type_name).to_str0 ()).to_str0 (),
-                   errport);
-         scm_puts ("\n", errport);
+         message (_f ("type check for `%s' failed; value `%s' must be of type `%s'",
+                      ly_symbol2string (sym).to_str0 (),
+                      print_scm_val (val),
+                      ly_scm2string (type_name).to_str0 ()));
+         progress_indication ("\n");
        }
     }
   return ok;