]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/lily-guile.cc (LY_DEFINE): use format on ly:warn arguments.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 10 Jul 2004 10:25:57 +0000 (10:25 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 10 Jul 2004 10:25:57 +0000 (10:25 +0000)
* 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
lily/kpath.cc
lily/lily-guile.cc
lily/repeat-acknowledge-engraver.cc
scm/define-grobs.scm
scm/encoding.scm
scm/framework-ps.scm

index 8726291358f2dabd5a155e813846c6481d0a84d4..ab153cfc93d15ba4894df3a5550d0ccfa9d0efcf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2004-07-10  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * 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.
 
index 63b288bea2d4daff8d737f4278c7c1bc013b804d..85e1d14127c6410998173cf9644ba54b5592c3f8 100644 (file)
@@ -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)
 {
index 47be547d79184b367e474f9abada0777f0df1f73..07d3266d9c62d90b9b50854f46cc42af9b776f83 100644 (file)
@@ -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?",
index ad4082962c5074506da3e2cbad2f220bb19b8a37..dc302eca5e2e2ebf2cf3f99da0d8deffbdee7216 100644 (file)
@@ -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");
index ba92517312e0239df8ec7d77af730998cf1628d0..a4c431b8febef9e250dbd9820b27d4b01a36e394 100644 (file)
        (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 ))))
        ))
 
        (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 ))))
index ec0736f23683fcb2a78e67fc77aa46a484a525c4..baec2cd2cb9f74c9dcfb88f5103b1011e23e9fcd 100644 (file)
@@ -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))
index 7753ec07edf84281c570ba6e2ea0c6e8289abb27..3f72f590491c7cfc8686934fedab0feb5fdf08ae 100644 (file)
         (font-names (uniq-list (sort (map ly:font-filename fonts) string<?)))
         (pfas (map
                (lambda (x)
-                 (ly:kpathsea-gulp-file (string-append x ".pfa")))
+               
+               (let*
+                   ((aname (string-append x ".pfa"))
+                    (apath (ly:kpathsea-expand-path aname))
+
+;                   (bpath (if (not apath)
+;                              (ly:kpathsea-expand-path (string-append x ".pfb"))
+;                              #f)))
+
+                    )
+                           
+                 (cond
+                  (apath (ly:gulp-file apath))
+
+                  ; oops , can't plonk PFB in, must convert to ASCII.
+                  ;(bpath (ly:gulp-file bpath))
+                  (else
+                   (ly:warn "Can't find PFA font ~S" x)
+                   ""))))
                (filter string? font-names))))
+  
     (string-join pfas "\n")))
 
 (define (define-fonts bookpaper)
 
   (define (font-load-encoding encoding)
     (let ((filename (get-coding-filename encoding)))
-      (ly:kpathsea-gulp-file filename)))
+      (ly:gulp-file (ly:kpathsea-expand-path filename))))
 
   (let* ((encoding-list (map (lambda (x)
                               (assoc-get 'input-name