X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Flily-guile.cc;h=9646364087cab8b71c95dbfe3a867a243de716c0;hb=1753b1a73742a5b0893037116bb6f2febba277f3;hp=ef50c52027c79c92694bcd18521314030696a170;hpb=75e31df11f879be81a489a4dd9cba837d4d6bebf;p=lilypond.git diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index ef50c52027..9646364087 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1998--2002 Jan Nieuwenhuizen + (c) 1998--2003 Jan Nieuwenhuizen Han-Wen Nienhuys */ @@ -85,7 +85,7 @@ gulp_file_to_string (String fn) { String e = _f ("can't find file: `%s'", fn); e += " "; - e += _f ("(load path: `%s')", global_path.string ()); + e += _f ("(load path: `%s')", global_path.to_string ()); error (e); } else if (verbose_global_b) @@ -102,12 +102,10 @@ gulp_file_to_string (String fn) return result; } -LY_DEFINE(ly_gulp_file, "ly-gulp-file", 1,0, 0, +LY_DEFINE(ly_gulp_file, "ly:gulp-file", 1,0, 0, (SCM name), - "Read the file named @var{name}, and return its contents in a string. The -file is looked up using the lilypond search path. - -") + "Read the file named @var{name}, and return its contents in a string. The " +" file is looked up using the lilypond search path.") { return scm_makfrom0str (gulp_file_to_string (ly_scm2string (name)).to_str0 ()); } @@ -151,7 +149,7 @@ index_set_cell (SCM s, Direction d, SCM v) return s; } -LY_DEFINE(ly_warning,"ly-warn", 1, 0, 0, +LY_DEFINE(ly_warning,"ly:warn", 1, 0, 0, (SCM str),"Scheme callable function to issue the warning @code{msg}.") { SCM_ASSERT_TYPE (gh_string_p (str), str, SCM_ARG1, __FUNCTION__, "string"); @@ -159,10 +157,9 @@ LY_DEFINE(ly_warning,"ly-warn", 1, 0, 0, return SCM_BOOL_T; } -LY_DEFINE(ly_isdir, "dir?", 1,0, 0, (SCM s), - "type predicate. A direction is a -1, 0 or 1, where -1 represents left or -down and 1 represents right or up. -") +LY_DEFINE(ly_dir_p, "ly:dir?", 1,0, 0, (SCM s), + "type predicate. A direction is a -1, 0 or 1, where -1 represents " + "left or down and 1 represents right or up. ") { if (gh_number_p (s)) { @@ -173,7 +170,7 @@ down and 1 represents right or up. } bool -ly_number_pair_p (SCM p) +is_number_pair (SCM p) { return gh_pair_p (p) && gh_number_p (ly_car (p)) && gh_number_p (ly_cdr (p)); } @@ -198,6 +195,7 @@ ly_init_ly_module (void *data) if (verbose_global_b) progress_indication ("\n"); + scm_primitive_load_path (scm_makfrom0str ("lily.scm")); } @@ -219,7 +217,7 @@ unsigned int ly_scm_hash (SCM s) bool -ly_dir_p (SCM s) +is_direction (SCM s) { if (gh_number_p (s)) { @@ -231,7 +229,7 @@ ly_dir_p (SCM s) bool -ly_axis_p (SCM s) +is_axis (SCM s) { if (gh_number_p (s)) { @@ -308,11 +306,10 @@ ly_scm2offset (SCM s) } -LY_DEFINE(ly_number2string, "ly-number->string", 1, 0,0, +LY_DEFINE(ly_number2string, "ly:number->string", 1, 0,0, (SCM s), - " converts @var{num} to a string without generating many decimals. It -leaves a space at the end. -") + " converts @var{num} to a string without generating many decimals. It " +"leaves a space at the end.") { SCM_ASSERT_TYPE (gh_number_p (s), s, SCM_ARG1, __FUNCTION__, "number"); @@ -362,26 +359,27 @@ wave_sweep_goodbye (void *dummy1, void *dummy2, void *dummy3) #include "version.hh" -LY_DEFINE(ly_version, "ly-version", 0, 0, 0, (), - "Return the current lilypond version as a list, e.g. -@code{(1 3 127 uu1)}. -") +LY_DEFINE(ly_version, "ly:version", 0, 0, 0, (), + "Return the current lilypond version as a list, e.g. @code{(1 3 127 uu1)}. ") { - char const* vs = "\' (" MAJOR_VERSION " " MINOR_VERSION " " PATCH_LEVEL " " MY_PATCH_LEVEL ")" ; + char const* vs = "\'(" MAJOR_VERSION " " MINOR_VERSION " " PATCH_LEVEL " " MY_PATCH_LEVEL ")" ; return gh_eval_str ((char*)vs); } -LY_DEFINE(ly_unit, "ly-unit", 0, 0, 0, (), +LY_DEFINE(ly_unit, "ly:unit", 0, 0, 0, (), "Return the unit used for lengths as a string.") { return scm_makfrom0str (INTERNAL_UNIT); } -LY_DEFINE(ly_verbose, "ly-verbose", 0, 0, 0, (), - "Return whether lilypond is being run in verbose mode.") + + +LY_DEFINE(ly_dimension_p, "ly:dimension?", 1, 0, 0, (SCM d), + "Return @var{d} is a number. Used to distinguish length " + "variables from normal numbers.") { - return gh_bool2scm (verbose_global_b); + return scm_number_p (d); } static void @@ -554,11 +552,20 @@ type_check_assignment (SCM sym, SCM val, SCM type_symbol) if (val == SCM_EOL || val == SCM_BOOL_F) return ok; - - SCM type = SCM_EOL; + if (!gh_symbol_p (sym)) +#if 0 + return false; +#else + /* + This is used for autoBeamSettings. - if (gh_symbol_p (sym)) - type = scm_object_property (sym, type_symbol); + TODO: deprecate the use of \override and \revert for + autoBeamSettings? + */ + return true; +#endif + + SCM type = scm_object_property (sym, type_symbol); if (type != SCM_EOL && !gh_procedure_p (type)) {