]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.115.jcn2
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 8 Dec 2000 13:26:00 +0000 (14:26 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 8 Dec 2000 13:26:00 +0000 (14:26 +0100)
1.3.115.jcn2
============

* Bugfix: lilypond-book.py: only include exisisting .texidoc files.

* Lilypond: don't write empty header field file if header field does
not exist (ie, empty .texidoc files).

* Turn on info generation.

* Fixes to dynamic placement and crescendo spanners.  Incomprehensible
``width-correct'' hack remains.

---
Generated by janneke@gnu.org,
From = lilypond-1.3.115.jcn1, To = lilypond-1.3.115.jcn2

usage

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.3.115.jcn2.diff

Patches do not contain automatically generated files
or (urg) empty directories,
i.e., you should rerun autoconf, configure

16 files changed:
CHANGES
Documentation/GNUmakefile
Documentation/regression-test.tely
Documentation/user/GNUmakefile
Documentation/user/refman.itely
VERSION
lily/crescendo.cc [deleted file]
lily/dynamic-engraver.cc
lily/hairpin.cc [new file with mode: 0644]
lily/include/crescendo.hh [deleted file]
lily/include/hairpin.hh [new file with mode: 0644]
lily/paper-outputter.cc
lily/text-spanner.cc
scm/element-descriptions.scm
scm/translator-description.scm
scripts/lilypond-book.py

diff --git a/CHANGES b/CHANGES
index 274109bda4f87a5af245c71a1da30f68b079cabe..f88149221f94cae9fba8ced47833fc60252af1a4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,22 @@
---- ../lilypond-1.3.115/CHANGES        Mon Dec  4 17:42:18 2000
+--- ../lilypond-1.3.115.jcn1/CHANGES   Thu Dec  7 22:22:26 2000
+++ b/CHANGES   Fri Dec  8 14:26:00 2000
+@@ -1,3 +1,16 @@
+1.3.115.jcn2
+============
+
+* Bugfix: lilypond-book.py: only include exisisting .texidoc files.
+
+* Lilypond: don't write empty header field file if header field does
+not exist (ie, empty .texidoc files).
+
+* Turn on info generation.
+
+* Fixes to dynamic placement and crescendo spanners.  Incomprehensible
+``width-correct'' hack remains.
+
+ 1.3.115.jcn1
+ ============
+ --- ../lilypond-1.3.115/CHANGES       Mon Dec  4 17:42:18 2000
 ++ b/CHANGES   Thu Dec  7 22:22:26 2000
 @@ -1,3 +1,9 @@
 1.3.115.jcn1
index 1b3462f69348b99ee79cf160b73745f460c22fcf..3a21d70c30803dbf34b97cf9396c1277b77b7418 100644 (file)
@@ -12,6 +12,10 @@ include $(depth)/make/stepmake.make
 
 default: local-doc
 
+test-reg:
+       rm -f out-www/regression-test.html out-www/regression-test.texi 
+       $(MAKE) out=www out-www/regression-test.html
+
 local-WWW: copy-for-me txt-to-html $(outdir)/regression-test.ps.gz $(outdir)/regression-test.html footify
 
 copy-for-me:
index b1b43938ac984825e6afa82b06f6f8326a2e5363..98d6a1b34d899c03003184f5dc3fff2e740cb61e 100644 (file)
@@ -87,6 +87,8 @@ and documenting bugfixes.
 
 @lilypondfile{auto-beam-bar.ly}
 
+@lilypondfile{beam-rest.ly}
+
 @lilypondfile{slur-nice.ly}
 @lilypondfile{slur-symmetry.ly}
 @lilypondfile{slur-symmetry-1.ly}
index 906ea48fb58a09f5fcd4cb8010e1ee6277ed5f7e..e1b1d32f0d0e5d5ce2c461129d2b7688068bc5f2 100644 (file)
@@ -18,7 +18,7 @@ PS_FILES = $(DVI_FILES:.dvi=.ps)  $(OUTDOC_FILES:.doc=.ps) $(OUTTEX_FILES:.tex=.
 
 PS_GZ_FILES= $(addsuffix .gz, $(PS_FILES))
 
-INFO_FILES = $(addprefix $(outdir)/, lilypond.info lilypond-internals.info)
+INFO_FILES = $(addprefix $(outdir)/, lilypond.info lilypond-internals.info)
 
 STEPMAKE_TEMPLATES=tex texinfo documentation
 LOCALSTEPMAKE_TEMPLATES=lilypond ly
index 92b5299069095185e802473f3b35b8d77221d935..42a19282cf48ae5197f25526c97432ccdd7e1469 100644 (file)
@@ -40,6 +40,7 @@
 * Sound output::                   Sound output
 * midilist::                       midilist
 * Grobs::                          Graphical objects
+* Molecule::                       Molecule
 * Pre-defined Identifiers::        Pre-defined Identifiers
 @c May be fragile.  Better make single link to generated doco?
 * Interpretation contexts:(lilypond-internals)LilyPond interpretation contexts.
diff --git a/VERSION b/VERSION
index e47a31ef021fe741c37f74597123e9b4ad83a69b..7b2c184b5bebbac79316bdfce6034b7f8b20e86c 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=115
-MY_PATCH_LEVEL=jcn1
+MY_PATCH_LEVEL=jcn2
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/lily/crescendo.cc b/lily/crescendo.cc
deleted file mode 100644 (file)
index 897f686..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-  crescendo.cc -- implement Hairpin
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "molecule.hh"
-#include "crescendo.hh"
-#include "spanner.hh"
-#include "font-interface.hh"
-#include "dimensions.hh"
-#include "paper-def.hh"
-#include "debug.hh"
-#include "paper-column.hh"
-
-MAKE_SCHEME_CALLBACK (Hairpin, brew_molecule, 1);
-
-SCM
-Hairpin::brew_molecule (SCM smob) 
-{
-  Grob *me= unsmob_grob (smob);
-  Spanner *span = dynamic_cast<Spanner*>(me);
-
-  Real line = me->paper_l ()->get_var ("stafflinethickness");  
-  
-  Real broken_left =  span->get_broken_left_end_align ();
-
-  SCM s = me->get_grob_property("grow-direction");
-  if (!isdir_b (s))
-    {
-      me->suicide ();
-      return SCM_EOL;
-    }
-  
-  Direction grow_dir = to_dir (s);
-  Real padding = gh_scm2double (me->get_grob_property ("padding"));
-  Real width = span->spanner_length ();
-  width -= span->get_broken_left_end_align ();
-
-  if (width < 0)
-    {
-      warning (_ ((grow_dir < 0) ? "decrescendo too small"
-                 : "crescendo too small"));
-      width = 0;
-    }
-
-  Drul_array<bool> broken;
-  Drul_array<Real> extra_off;
-  Direction d = LEFT;
-  do
-    {
-      Item *b = span->get_bound (d);
-      broken[d] = b->break_status_dir () != CENTER;
-
-      if (!broken [d])
-       {
-
-         Interval e =b->extent (b, X_AXIS);
-         Real r = 0.0;
-         if (!e.empty_b ())
-           r = e[-d] + padding;
-         width += d * r;
-         extra_off[d] = r;
-       }
-    }
-  while (flip (&d) != LEFT);
-  
-  bool continued = broken[Direction (-grow_dir)];
-  Real height = gh_scm2double (me->get_grob_property ("height"));
-  Real thick = line * gh_scm2double (me->get_grob_property ("thickness"));
-  
-  const char* type = (grow_dir < 0) ? "decrescendo" :  "crescendo";
-  SCM hairpin = gh_list (ly_symbol2scm (type),
-                   gh_double2scm (thick),
-                   gh_double2scm (width),
-                   gh_double2scm (height),
-                   gh_double2scm (continued ? height/2 : 0.0),
-                   SCM_UNDEFINED);
-
-  Box b (Interval (0, width), Interval (-2*height, 2*height));
-  Molecule mol (b, hairpin);
-  mol.translate_axis (broken_left + extra_off[LEFT], X_AXIS);
-
-  return mol.smobbed_copy ();
-}
-
-
index 15b6561b1be3a1dc86fac8475b9319e5220e1c9b..98e7d17c5f3ad37b271d88562b8f8b929adfdbe5 100644 (file)
@@ -7,7 +7,7 @@
 */
 #include "debug.hh"
 #include "dimensions.hh"
-#include "crescendo.hh"
+#include "hairpin.hh"
 #include "musical-request.hh"
 #include "paper-column.hh"
 #include "note-column.hh"
@@ -163,16 +163,7 @@ Dynamic_engraver::create_grobs ()
        and a line-spanner will always be created, as \< \! are already
        two requests.
 
-       Maybe always creating a line-spanner for a (de)crescendo (see
-       below) is not a good idea:
-
-           a\< b\p \!c
-
-       the \p will be centred on the line-spanner, and thus clash
-       with the hairpin.  When axis-group code is in place, the \p
-       should move below the hairpin, which is probably better?
-
-       Urg, but line-spanner must always have at least same duration
+       Note: line-spanner must always have at least same duration
        as (de)crecsendo, b.o. line-breaking.
        */
 
@@ -187,6 +178,10 @@ Dynamic_engraver::create_grobs ()
       script_p_ = new Item (get_property ("DynamicText"));
       script_p_->set_grob_property ("text",
                                   script_req_l_->get_mus_property ("text"));
+      
+      Side_position::set_direction (script_p_, LEFT);
+      Side_position::set_axis (script_p_, X_AXIS);
+      
       if (Direction d = script_req_l_->get_direction ())
        Directional_element_interface::set (line_spanner_, d);
 
@@ -205,9 +200,10 @@ Dynamic_engraver::create_grobs ()
       else
        {
          assert (!finished_cresc_p_);
-         Grob* cc = unsmob_grob (get_property ("currentMusicalColumn"));
-         
-         cresc_p_->set_bound (RIGHT, cc);
+
+         cresc_p_->set_bound (RIGHT, script_p_
+                          ? script_p_
+                          : unsmob_grob (get_property ("currentMusicalColumn")));
 
          finished_cresc_p_ = cresc_p_;
          cresc_p_ = 0;
@@ -240,7 +236,7 @@ Dynamic_engraver::create_grobs ()
          SCM s = get_property ((start_type + "Spanner").ch_C());
          if (!gh_symbol_p (s) || s == ly_symbol2scm ("hairpin"))
            {
-             cresc_p_  = new Spanner (get_property ("Crescendo"));
+             cresc_p_  = new Spanner (get_property ("Hairpin"));
              cresc_p_->set_grob_property ("grow-direction",
                                          gh_int2scm ((start_type == "crescendo")
                                                      ? BIGGER : SMALLER));
@@ -255,6 +251,11 @@ Dynamic_engraver::create_grobs ()
            {
              cresc_p_  = new Spanner (get_property ("TextSpanner"));
              cresc_p_->set_grob_property ("type", s);
+             
+             // urg.  Can't set this into Text_spanner, because we
+             // only want this for (de)crescendi spanners.
+             cresc_p_->set_grob_property ("padding", gh_double2scm (1));
+             
              daddy_trans_l_->set_property (start_type
                                            + "Spanner", SCM_UNDEFINED);
              s = get_property ((start_type + "Text").ch_C());
@@ -266,10 +267,11 @@ Dynamic_engraver::create_grobs ()
                                                SCM_UNDEFINED);
                }
            }
+
          cresc_p_->set_bound (LEFT, script_p_
                               ? script_p_
                               : unsmob_grob (get_property ("currentMusicalColumn")));
-         
+
          Axis_group_interface::add_element (line_spanner_, cresc_p_);
          announce_grob (cresc_p_, accepted_spanreqs_drul_[START]);
        }
@@ -308,10 +310,11 @@ Dynamic_engraver::typeset_all ()
 {  
   if (finished_cresc_p_)
     {
+#if 1
       finished_cresc_p_->set_bound (RIGHT, script_p_
                           ? script_p_
                           : unsmob_grob (get_property ("currentMusicalColumn")));
-               
+#endif         
       typeset_grob (finished_cresc_p_);
       finished_cresc_p_ =0;
     }
diff --git a/lily/hairpin.cc b/lily/hairpin.cc
new file mode 100644 (file)
index 0000000..cf81fd6
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+  hairpin.cc -- implement Hairpin
+
+  source file of the GNU LilyPond music typesetter
+
+  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "molecule.hh"
+#include "hairpin.hh"
+#include "spanner.hh"
+#include "font-interface.hh"
+#include "dimensions.hh"
+#include "paper-def.hh"
+#include "debug.hh"
+#include "paper-column.hh"
+
+MAKE_SCHEME_CALLBACK (Hairpin, brew_molecule, 1);
+
+SCM
+Hairpin::brew_molecule (SCM smob) 
+{
+  Grob *me= unsmob_grob (smob);
+  Spanner *spanner = dynamic_cast<Spanner*>(me);
+
+  Real line = me->paper_l ()->get_var ("stafflinethickness");  
+  
+  SCM s = me->get_grob_property("grow-direction");
+  if (!isdir_b (s))
+    {
+      me->suicide ();
+      return SCM_EOL;
+    }
+  
+  Direction grow_dir = to_dir (s);
+
+
+  /* Ugh, must be same as Text_spanner::brew_molecule.  */  
+  Real padding = gh_scm2double (me->get_grob_property ("padding"));
+  Real broken_left =  spanner->get_broken_left_end_align ();
+  Real width = spanner->spanner_length ();
+  width -= broken_left;
+
+  Drul_array<bool> broken;
+  Drul_array<Real> extra_off;
+  Direction d = LEFT;
+  do
+    {
+      Item *b = spanner->get_bound (d);
+      broken[d] = b->break_status_dir () != CENTER;
+
+      if (!broken [d])
+       {
+
+         Interval e =b->extent (b, X_AXIS);
+         Real r = 0.0;
+         if (!e.empty_b ())
+           r = e[-d] + padding;
+         width += d * r;
+         extra_off[d] = r;
+       }
+    }
+  while (flip (&d) != LEFT);
+
+  // FIXME: ecs tells us
+  width += gh_scm2double (me->get_grob_property ("width-correct"));
+  /* /Ugh */
+
+
+
+
+  
+  if (width < 0)
+    {
+      warning (_ ((grow_dir < 0) ? "decrescendo too small"
+                 : "crescendo too small"));
+      width = 0;
+    }
+
+  bool continued = broken[Direction (-grow_dir)];
+  Real height = gh_scm2double (me->get_grob_property ("height"));
+  Real thick = line * gh_scm2double (me->get_grob_property ("thickness"));
+  
+  const char* type = (grow_dir < 0) ? "decrescendo" :  "crescendo";
+  SCM hairpin = gh_list (ly_symbol2scm (type),
+                   gh_double2scm (thick),
+                   gh_double2scm (width),
+                   gh_double2scm (height),
+                   gh_double2scm (continued ? height/2 : 0.0),
+                   SCM_UNDEFINED);
+
+  Box b (Interval (0, width), Interval (-2*height, 2*height));
+  Molecule mol (b, hairpin);
+  mol.translate_axis (broken_left + extra_off[LEFT], X_AXIS);
+
+  return mol.smobbed_copy ();
+}
+
+
diff --git a/lily/include/crescendo.hh b/lily/include/crescendo.hh
deleted file mode 100644 (file)
index 37f36f6..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-  crescendo.hh -- declare Hairpin
-
-  source file of the GNU LilyPond music typesetter
-
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef CRESCENDO_HH
-#define CRESCENDO_HH
-
-#include "lily-guile.hh"
-/**
-  The hairpin symbol. 
- */
-struct Hairpin
-{
-public:
-  DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
-  static bool has_interface (Grob*);
-};
-
-#endif // CRESCENDO_HH
diff --git a/lily/include/hairpin.hh b/lily/include/hairpin.hh
new file mode 100644 (file)
index 0000000..30578b6
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+  hairpin.hh -- declare Hairpin
+
+  source file of the GNU LilyPond music typesetter
+
+  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef HAIRPIN_HH
+#define HAIRPIN_HH
+
+#include "lily-guile.hh"
+/**
+  The hairpin symbol. 
+ */
+struct Hairpin
+{
+public:
+  DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
+  static bool has_interface (Grob*);
+};
+
+#endif // HAIRPIN_HH
index 781215c2002df99c6e0fe170a3716b53eb1cbf23..0bf6c9db9811a304153d23baa483a79288991c7b 100644 (file)
@@ -273,12 +273,15 @@ Paper_outputter::output_score_header_fields (Paper_def *paper)
       for (int i = 0; i < global_score_header_fields.size (); i++)
        {
          String key = global_score_header_fields[i];
-         //      SCM val = gh_assoc (ly_str02scm (key.ch_C ()), fields);
          SCM val = gh_assoc (ly_symbol2scm (key.ch_C ()), fields);
          String s;
+         /* Only write header field to file if it exists */
          if (gh_pair_p (val))
-           s = ly_scm2string (gh_cdr (val));
-         output_score_header_field (base, key, s);
+           {
+             s = ly_scm2string (gh_cdr (val));
+             /* Always write header field file, even if string is empty ... */
+             output_score_header_field (base, key, s);
+           }
        }
     }
 }
index c83551e5569856327078f1e18cbd47f8dd15447d..5280703bad0312a91a0439951c513f12959b9249 100644 (file)
@@ -24,7 +24,6 @@
     - contination types (vert. star, vert. end)  |-> eat volta-spanner
     - more styles
     - more texts/positions
-    - style: hairpin ?
  */
 
 MAKE_SCHEME_CALLBACK (Text_spanner, brew_molecule, 1);
@@ -35,22 +34,42 @@ Text_spanner::brew_molecule (SCM smob)
   Grob *me= unsmob_grob (smob);
   Spanner *spanner = dynamic_cast<Spanner*> (me);
 
-  Real staff_space = Staff_symbol_referencer::staff_space (me);
-  
+
+
+  /* Ugh, must be same as Hairpin::brew_molecule.  */
+  Real padding = gh_scm2double (me->get_grob_property ("padding"));
+  Real broken_left =  spanner->get_broken_left_end_align ();
+  Real width = spanner->spanner_length ();
+  width -= broken_left;
+
   Drul_array<bool> broken;
+  Drul_array<Real> extra_off;
   Direction d = LEFT;
   do
     {
-      Paper_column* s = dynamic_cast<Paper_column*>(spanner->get_bound (d)); // UGH
-      if (s && s->musical_b ())
-       broken[d] = false;
-      else
-       broken[d] = true;
+      Item *b = spanner->get_bound (d);
+      broken[d] = b->break_status_dir () != CENTER;
+
+      if (!broken [d])
+       {
+
+         Interval e = b->extent (b, X_AXIS);
+         Real r = 0.0;
+         if (!e.empty_b ())
+           r = e[-d] + padding;
+         width += d * r;
+         extra_off[d] = r;
+       }
     }
   while (flip (&d) != LEFT);
-  
-  SCM properties = Font_interface::font_alist_chain (me);
 
+  // FIXME: ecs tells us
+  width += gh_scm2double (me->get_grob_property ("width-correct"));
+  /* /Ugh */
+
+
+  SCM properties = Font_interface::font_alist_chain (me);
+  
   SCM edge_text = me->get_grob_property ("edge-text");
   Drul_array<Molecule> edge;
   if (gh_pair_p (edge_text))
@@ -65,6 +84,8 @@ Text_spanner::brew_molecule (SCM smob)
        }
       while (flip (&d) != LEFT);
     }
+  width -= edge[LEFT].extent (X_AXIS).length ()
+    + edge[RIGHT].extent (X_AXIS).length ();
 
   Drul_array<Real> shorten;
   shorten[LEFT] = 0;
@@ -73,19 +94,12 @@ Text_spanner::brew_molecule (SCM smob)
   SCM s = me->get_grob_property ("shorten");
   if (gh_pair_p (s))
     {
-      shorten[LEFT] = gh_scm2double (gh_car (s)) * staff_space;
-      shorten[RIGHT] = gh_scm2double (gh_cdr (s)) * staff_space;
+      shorten[LEFT] = gh_scm2double (gh_car (s));
+      shorten[RIGHT] = gh_scm2double (gh_cdr (s));
     }
 
-  Real broken_left =  spanner->get_broken_left_end_align ();
-  Real width = spanner->spanner_length ();
-  Grob *bnd = spanner->get_bound (RIGHT);
-  width += bnd->extent (bnd, X_AXIS).length ();
-  width -= broken_left;
   width -= shorten[LEFT] + shorten[RIGHT];
-  width -= edge[LEFT].extent (X_AXIS).length ()
-    + edge[RIGHT].extent (X_AXIS).length ();
-
+  
   if (width < 0)
     {
       warning (_ ("Text_spanner too small"));
@@ -138,7 +152,7 @@ Text_spanner::brew_molecule (SCM smob)
     m.add_at_edge (X_AXIS, RIGHT, edge_line[RIGHT], 0);
   if (!edge[RIGHT].empty_b ())
     m.add_at_edge (X_AXIS, RIGHT, edge[RIGHT], 0);
-  m.translate_axis (broken_left, X_AXIS);
+  m.translate_axis (broken_left + extra_off[LEFT], X_AXIS);
 
   return m.smobbed_copy ();
 }
index af2869cbffd054611bb41ebd8263d960a47f6725..ade660a1eb45bd24af8c11c1ac3daebc912c9681 100644 (file)
                (meta . ,(element-description "Custos" custos-interface staff-symbol-interface break-aligned-interface) )
        ))
        
-       (Crescendo . (
+       (Hairpin . (
                (molecule-callback . ,Hairpin::brew_molecule)
                (thickness . 1.0)
-               (padding . 1.0)
+               (padding . 1.0) 
+               (width-correct . -1) ;ughr
                (height . 0.6666)
                (dash-thickness . 1.2)
                (dash-length . 4.0)
                (self-alignment-Y . 0)
                (Y-offset-callbacks . (,Side_position::aligned_on_self))
-               (meta . ,(element-description "Crescendo" hairpin-interface))
+               (meta . ,(element-description "Hairpin" hairpin-interface))
        ))
 
        (DotColumn . (
                (molecule-callback . ,Text_spanner::brew_molecule)
                 (font-shape . italic)
                (type . "line")
+               ;;; urg
+               ;;;(padding . 1.0)
+               (width-correct . -1) ;ughr
                (direction . 1)
                (meta . ,(element-description "TextSpanner" text-spanner-interface  font-interface))            
        ))
index 879b4ff09037fd16a426b4f0577975a8a75a0e2c..ffb0e485e19d410deb0d9efa4a8b24e2370f762a 100644 (file)
@@ -285,7 +285,7 @@ If omitted, then dots appear on top of the notes.
      "Dynamic_engraver"
      ""
      '(DynamicLineSpanner
-       DynamicText Crescendo
+       DynamicText Hairpin
        TextSpanner)
      '(
       )))
index 763aa79fa148b90ab29e586aafe4df11946d9f46..4d6b0e58f83601d6ea478becec9584244d4f7851 100644 (file)
@@ -348,7 +348,6 @@ output_dict= {
 # should also support fragment in
                  
                  'output-all': r"""
-@include %(fn)s.texidoc
 @tex
 \catcode`\@=12
 \input lilyponddefs
@@ -776,7 +775,7 @@ def schedule_lilypond_block (chunk):
                needed_filetypes.append('png')
        if 'eps' in opts and not ('eps' in needed_filetypes):
                needed_filetypes.append('eps')
-       outname = os.path.join(g_outdir, basename)
+       pathbase = os.path.join (g_outdir, basename)
        def f(base, ext1, ext2):
                a = os.path.isfile(base + ext2)
                if (os.path.isfile(base + ext1) and
@@ -786,11 +785,11 @@ def schedule_lilypond_block (chunk):
                                not os.path.isfile(base + ext2):
                        return 1
        todo = []
-       if 'tex' in needed_filetypes and f(outname, '.ly', '.tex'):
+       if 'tex' in needed_filetypes and f(pathbase, '.ly', '.tex'):
                todo.append('tex')
-       if 'eps' in needed_filetypes and f(outname, '.tex', '.eps'):
+       if 'eps' in needed_filetypes and f(pathbase, '.tex', '.eps'):
                todo.append('eps')
-       if 'png' in needed_filetypes and f(outname, '.eps', '.png'):
+       if 'png' in needed_filetypes and f(pathbase, '.eps', '.png'):
                todo.append('png')
        newbody = ''
        if 'verbatim' in opts:
@@ -806,8 +805,10 @@ def schedule_lilypond_block (chunk):
                else:
                        s = 'output-tex'
        else: # format == 'texi'
-               s = 'output-all'
-       newbody = newbody + get_output(s) % {'fn': basename }
+               if os.path.isfile (pathbase + '.texidoc'):
+                       newbody = newbody + '\n@include %s.texidoc' % basename
+               s = 'output-all'
+       newbody = newbody + get_output (s) % {'fn': basename }
        return ('lilypond', newbody, opts, todo, basename)
 
 def process_lilypond_blocks(outname, chunks):#ugh rename