From 3c6f351ea95b75e7a1a675b44142d5a7481d61ee Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 10 Jul 2004 10:25:57 +0000 Subject: [PATCH] * lily/lily-guile.cc (LY_DEFINE): use format on ly:warn arguments. * lily/repeat-acknowledge-engraver.cc (process_music): look at main timing, not grace timing. Fixes volta-repeat-grace. * lily/kpath.cc (LY_DEFINE): ly:kpathsea-expand-path, new function remove ly:kpathsea-gulp-file. * scm/define-grobs.scm (all-grob-descriptions): noone --- ChangeLog | 9 +++++++++ lily/kpath.cc | 24 +++++++++++++++++++----- lily/lily-guile.cc | 9 ++++++--- lily/repeat-acknowledge-engraver.cc | 5 +++-- scm/define-grobs.scm | 4 ++-- scm/encoding.scm | 2 +- scm/framework-ps.scm | 23 +++++++++++++++++++++-- 7 files changed, 61 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8726291358..ab153cfc93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2004-07-10 Han-Wen Nienhuys + * lily/lily-guile.cc (LY_DEFINE): use format on ly:warn arguments. + + * lily/repeat-acknowledge-engraver.cc (process_music): look at + main timing, not grace timing. Fixes volta-repeat-grace. + + + * lily/kpath.cc (LY_DEFINE): ly:kpathsea-expand-path, new function + remove ly:kpathsea-gulp-file. + * scm/translation-functions.scm (format-metronome-markup): make note smaller, align to bottom. diff --git a/lily/kpath.cc b/lily/kpath.cc index 63b288bea2..85e1d14127 100644 --- a/lily/kpath.cc +++ b/lily/kpath.cc @@ -147,16 +147,30 @@ kpathsea_gulp_file_to_string (String name) return string; } -LY_DEFINE (ly_kpathsea_gulp_file, "ly:kpathsea-gulp-file", + + +LY_DEFINE (ly_kpathsea_expand_path, "ly:kpathsea-expand-path", 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 and kpathsea.") + "Read the file @var{name}, and return its expanded path, or " + "@code{#f} if not found.") { SCM_ASSERT_TYPE (ly_c_string_p (name), name, SCM_ARG1, __FUNCTION__, "string"); - return scm_makfrom0str - (kpathsea_gulp_file_to_string (ly_scm2string (name)).to_str0 ()); + + String nm = ly_scm2string (name); + String filename = global_path.find (nm); + if (filename.is_empty ()) + { + char *p = kpse_find_file (nm.to_str0 (), kpathsea_find_format (nm), + true); + if (p) + return scm_makfrom0str (p); + else + return SCM_BOOL_F; + } + return scm_makfrom0str (filename.to_str0 ()); } + void initialize_kpathsea (char *av0) { diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 47be547d79..07d3266d9c 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -169,13 +169,16 @@ index_set_cell (SCM s, Direction d, SCM v) } LY_DEFINE (ly_warn, "ly:warn", - 1, 0, 0, (SCM str), - "Scheme callable function to issue the warning @code{msg}.") + 1, 0, 1, (SCM str, SCM rest), + "Scheme callable function to issue the warning @code{msg}. " + "The message is formatted with @code{format} and @code{rest}.") { SCM_ASSERT_TYPE (ly_c_string_p (str), str, SCM_ARG1, __FUNCTION__, "string"); progress_indication ("\n"); + + str = scm_simple_format (SCM_BOOL_F, str, rest); warning ("lily-guile: " + ly_scm2string (str)); - return SCM_BOOL_T; + return SCM_UNSPECIFIED; } LY_DEFINE (ly_dir_p, "ly:dir?", diff --git a/lily/repeat-acknowledge-engraver.cc b/lily/repeat-acknowledge-engraver.cc index ad4082962c..dc302eca5e 100644 --- a/lily/repeat-acknowledge-engraver.cc +++ b/lily/repeat-acknowledge-engraver.cc @@ -27,8 +27,9 @@ class Repeat_acknowledge_engraver : public Engraver { public: + TRANSLATOR_DECLARATIONS (Repeat_acknowledge_engraver); - +protected: virtual void start_translation_timestep (); virtual void process_music (); virtual void initialize (); @@ -62,7 +63,7 @@ Repeat_acknowledge_engraver::process_music () /* At the start of a piece, we don't print any repeat bars. */ - if (now_mom () == Moment (0)) + if (!now_mom ().main_part_) return ; SCM cs = get_property ("repeatCommands"); diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index ba92517312..a4c431b8fe 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -698,7 +698,7 @@ (before-line-breaking-callback . ,Paper_column::before_line_breaking) (X-extent-callback . ,Axis_group_interface::group_extent_callback) -;ppp (print-function . ,Paper_column::print) (font-name . "cmr8") (Y-extent-callback . #f) +; (print-function . ,Paper_column::print) (font-name . "ecrm8") (Y-extent-callback . #f) (meta . ((interfaces . (paper-column-interface axis-group-interface spaceable-grob-interface item-interface )))) )) @@ -734,7 +734,7 @@ (before-line-breaking-callback . ,Paper_column::before_line_breaking) (breakable . #t) ;; debugging stuff: print column number. -; (print-function . ,Paper_column::print) (font-name . "cmr8") (Y-extent-callback . #f) +; (print-function . ,Paper_column::print) (font-name . "ecrm8") (Y-extent-callback . #f) (meta . ((interfaces . (paper-column-interface axis-group-interface spaceable-grob-interface item-interface )))) diff --git a/scm/encoding.scm b/scm/encoding.scm index ec0736f236..baec2cd2cb 100644 --- a/scm/encoding.scm +++ b/scm/encoding.scm @@ -12,7 +12,7 @@ (define-public (read-encoding-file filename) "Read .enc file, return (COMMAND-NAME . VECTOR-OF-SYMBOLS)." - (let* ((raw (ly:kpathsea-gulp-file filename)) + (let* ((raw (ly:gulp-file (ly:kpathsea-expand-path filename))) (string (regexp-substitute/global #f "%[^\n]*" raw 'pre "" 'post)) (command (match:substring (string-match "/([^ \t\n\r]*)[ \t\n\r]+[[]" string) 1)) diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index 7753ec07ed..3f72f59049 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -51,8 +51,27 @@ (font-names (uniq-list (sort (map ly:font-filename fonts) string