Generated by hanwen@cs.uu.nl,
From = lilypond-1.5.53, To = lilypond-1.5.54

usage 

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

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

diff -purN ../lilypond-1.5.53/ChangeLog ./ChangeLog
--- ../lilypond-1.5.53/ChangeLog	Sun Apr 21 16:26:14 2002
+++ ./ChangeLog	Tue Apr 23 20:35:41 2002
@@ -1,3 +1,55 @@
+2002-04-23  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+	* VERSION: 1.5.54 released
+
+	* mf/feta-nummer-code.mf (code): tweaks for three, fixes for 6
+	bulb. 
+
+	* Documentation/index.texi: add PDF links.
+
+	* Documentation/user/GNUmakefile (PDF_FILES): add PDF files to website.
+
+	* lily/system-start-delimiter-engraver.cc (acknowledge_grob):
+	compare #'glyph as strings. 
+
+	* scripts/lilypond-book.py: fix by Mats. Try to import pre if available.
+
+	* scripts/ly2dvi.py (setup_environment): fix by Mats.
+
+	* lily/stem.cc (head_count): Change function name. Change property
+	to #'note-heads i.s.o.  #'heads.
+	(position_noteheads): Kern noteheads for invisible stems.
+	(before_line_breaking): Do position_noteheads() for whole note
+	heads too.
+
+	* lily/accidental-placement.cc (position_accidentals): First
+	determine refpoints, only then determine extents.  
+
+2002-04-22  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+	* lily/accidental-placement.cc (position_accidentals): use all
+	note heads for note head-skyline. 
+
+	* scripts/lilypond-book.py (re_dict): remove all *? regexps.
+
+2002-04-22  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+	* Documentation/windows/setup.hint (requires): Add gsview dependency.
+
+	* scripts/lilypond-book.py (re_dict): Fix for python 2.x.
+
+	* lilypond-mode.el (LilyPond-xdvi-command): Default to plain xdvi.
+
+	* input/mozart-hrn3-allegro.ly: Bugfix: include defs.
+
+2002-04-22  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+	* mf/feta-schrift.mf: lighter staccato.
+
+2002-04-22  Han-Wen  <hanwen@cs.uu.nl>
+
+	* mf/feta-nummer-code.mf (code): fixes for 3 glyph.
+
 2002-04-21  Han-Wen  <hanwen@cs.uu.nl>
 
 	* VERSION: 1.5.53 released
@@ -16,14 +68,15 @@
 	* lily/accidental-placement.cc (alignment_callback): position
 	accidentals in a better way.
 
-	* lily/skyline.cc: new file. Compute distances for collections  of boxes. 
+	* lily/skyline.cc: new file. Compute distances for collections of
+	boxes.
 
 	* lily/include/skyline.hh: new file
 
 2002-04-20  Han-Wen  <hanwen@cs.uu.nl>
 
-	* lily/accidental.cc (class Accidental_interface): grob for single
-	accidental.
+	* lily/accidental.cc (class Accidental_interface): grob for a
+	single accidental.
 
 	* lily/accidental-engraver.cc (number_accidentals): Cleanups. Lots
 	of reformatting
@@ -1727,7 +1780,7 @@
 
 	* Rewrote new conditional guile >= 1.5 compilation switches, to keep
 	  code clean from conditionals and have a concentrated sets of
-	  compatitility fixes for old guile versions.
+	  compatibility fixes for old guile versions.
 
 	* Fixes for guile 1.4, including embedded ps.
 
diff -purN ../lilypond-1.5.53/Documentation/GNUmakefile ./Documentation/GNUmakefile
--- ../lilypond-1.5.53/Documentation/GNUmakefile	Tue Feb 26 20:36:30 2002
+++ ./Documentation/GNUmakefile	Tue Apr 23 15:48:12 2002
@@ -16,7 +16,11 @@ 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
+PS_FILES=$(outdir)/regression-test.ps
+PDF_FILES=$(PS_FILES:.ps=.pdf)
+PS_GZ_FILES=$(addsuffix  .gz, $(PS_FILES))
+
+local-WWW: copy-for-me txt-to-html $(PS_GZ_FILES) $(PDF_FILES) $(outdir)/regression-test.html footify
 
 copy-for-me:
 	$(foreach a, $(README_TOP_FILES), cp ../$(a) $(outdir)/$(a).txt && ) true
diff -purN ../lilypond-1.5.53/Documentation/index.texi ./Documentation/index.texi
--- ../lilypond-1.5.53/Documentation/index.texi	Thu Mar 14 02:05:15 2002
+++ ./Documentation/index.texi	Tue Apr 23 15:46:42 2002
@@ -94,13 +94,16 @@ the mailing lists.
 The reference manual.
 
 @item @uref{../user/out-www/lilypond/lilypond.html,lilypond} The complete
-user manual, (in @uref{../user/out-www/lilypond.ps.gz,PostScript}). This
+user manual, (in @uref{../user/out-www/lilypond.ps.gz,PostScript} and
+@uref{../user/out-www/lilypond.pdf,PDF}). This
 manual contains among others the tutorial, the reference manual.
 
 @c glossary maybe for new users?
 @item @uref{../user/out-www/glossary.html,glossary} A glossary of musical
 terms, including translations.  (in
-@uref{../user/out-www/glossary.ps.gz,Postscript})  Read this if you're not
+@uref{../user/out-www/glossary.ps.gz,Postscript}
+and
+@uref{../user/out-www/glossary.pdf,PDF})  Read this if you're not
 familiar with English terms for notation.
 
 @item @uref{../user/out-www/lilypond-internals/lilypond-internals.html,lilypond-internals}
@@ -122,10 +125,17 @@ want to fine-tune output, you need the i
 @itemize @bullet
 @item @uref{../out-www/regression-test.html,Regression Test}
 A large document that tests all kinds of features (also as
-@uref{../out-www/regression-test.ps.gz,Postscript}).
+@uref{../out-www/regression-test.ps.gz,Postscript}
+and
+@uref{../out-www/regression-test.pdf,PDF}).
 @item @uref{../../input/bugs/out-www/bugs.html,Bugs}
-A document that shows bugs (also as
-@uref{../../input/bugs/out-www/bugs.ps.gz,Postscript}).
+A document that shows bugs
+
+
+@c  (also as
+@c @uref{../../input/bugs/out-www/bugs.ps.gz,Postscript}
+@c and @uref{../../input/bugs/out-www/bugs.pdf,PDF}).
+
 @item
 @uref{http://www2.iro.umontreal.ca/~pinard/po/registry.cgi?domain=lilypond">Translations,lilypond
 textual domain
diff -purN ../lilypond-1.5.53/Documentation/regression-test.tely ./Documentation/regression-test.tely
--- ../lilypond-1.5.53/Documentation/regression-test.tely	Sun Apr 21 15:55:21 2002
+++ ./Documentation/regression-test.tely	Tue Apr 23 15:21:56 2002
@@ -23,6 +23,8 @@ documenting bugfixes.
 
 @section Notes and rests
 
+@lilypondfile[printfilename]{note-head-chord.ly}
+
 @lilypondfile[printfilename]{note-head-style.ly}
 
 @lilypondfile[printfilename]{mensural.ly}
@@ -335,6 +337,8 @@ Grace note do weird things with timing. 
 
 @lilypondfile[printfilename]{system-extents.ly}
 
+@lilypondfile[printfilename]{system-start-bracket.ly}
+
 @lilypondfile[printfilename,nofragment]{size11.ly}
 
 @lilypondfile[printfilename,nofragment]{size13.ly}
diff -purN ../lilypond-1.5.53/Documentation/user/GNUmakefile ./Documentation/user/GNUmakefile
--- ../lilypond-1.5.53/Documentation/user/GNUmakefile	Tue Nov  6 17:10:26 2001
+++ ./Documentation/user/GNUmakefile	Tue Apr 23 15:37:49 2002
@@ -13,6 +13,7 @@ EXTRA_DIST_FILES= $(LATEX_FILES)
 HTML_FILES = $(addprefix $(outdir)/, $(TELY_FILES:.tely=.html))
 
 PS_FILES = $(DVI_FILES:.dvi=.ps)
+PDF_FILES = $(DVI_FILES:.dvi=.pdf)
 
 PS_GZ_FILES= $(addsuffix .gz, $(PS_FILES))
 
@@ -85,7 +86,7 @@ deep-symlinks:
 endif
 
 
-local-WWW: $(HTML_FILES) $(datafiles) $(PS_GZ_FILES) $(DEEP_HTML_FILES) info-dir
+local-WWW: $(HTML_FILES) $(datafiles) $(PDF_FILES) $(PS_GZ_FILES) $(DEEP_HTML_FILES) info-dir
 
 local-WWW-clean: deep-WWW-clean
 
diff -purN ../lilypond-1.5.53/Documentation/windows/setup.hint ./Documentation/windows/setup.hint
--- ../lilypond-1.5.53/Documentation/windows/setup.hint	Thu Jan 31 13:17:54 2002
+++ ./Documentation/windows/setup.hint	Tue Apr 23 11:51:43 2002
@@ -1,6 +1,6 @@
 sdesc: "A program for printing sheet music"
 category: Publishing
-requires: ash bash guile python tetex-beta texmf-tiny
+requires: ash bash guile gsview python tetex-beta texmf-tiny
 #suggests: rxvt xdvi texmf-base
 ldesc: "A program for printing sheet music.
 LilyPond is a music typesetter.  It produces beautiful sheet music
diff -purN ../lilypond-1.5.53/GNUmakefile.in ./GNUmakefile.in
--- ../lilypond-1.5.53/GNUmakefile.in	Tue Mar 19 22:03:44 2002
+++ ./GNUmakefile.in	Tue Apr 23 20:33:43 2002
@@ -42,7 +42,7 @@ fonts:
 doc: lily fonts
 	$(MAKE) -C Documentation
 
-web-doc: 
+web-doc: pfa-fonts
 	$(MAKE) out=www -C Documentation WWW
 	$(MAKE) footify
 
diff -purN ../lilypond-1.5.53/VERSION ./VERSION
--- ../lilypond-1.5.53/VERSION	Sun Apr 21 16:04:23 2002
+++ ./VERSION	Tue Apr 23 20:33:20 2002
@@ -1,7 +1,7 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
-PATCH_LEVEL=53
+PATCH_LEVEL=54
 MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
diff -purN ../lilypond-1.5.53/flower/include/interval.hh ./flower/include/interval.hh
--- ../lilypond-1.5.53/flower/include/interval.hh	Tue Apr  2 00:48:01 2002
+++ ./flower/include/interval.hh	Tue Apr 23 11:22:30 2002
@@ -24,7 +24,7 @@ struct Interval_t : public Drul_array<T>
     
   static T infinity () ;
   static String T_to_str (T arg);
-  T center () {
+  T center () const {
     assert (!empty_b ());
     return (elem (LEFT) + elem (RIGHT)) / T (2);
   }
diff -purN ../lilypond-1.5.53/input/mozart-hrn3-allegro.ly ./input/mozart-hrn3-allegro.ly
--- ../lilypond-1.5.53/input/mozart-hrn3-allegro.ly	Tue Apr  2 00:48:01 2002
+++ ./input/mozart-hrn3-allegro.ly	Mon Apr 22 17:55:59 2002
@@ -1,4 +1,5 @@
 \version "1.3.146"
+\include  "mozart-hrn3-defs.ly"
 
 allegro =
 	\notes
diff -purN ../lilypond-1.5.53/input/regression/accidental-placement.ly ./input/regression/accidental-placement.ly
--- ../lilypond-1.5.53/input/regression/accidental-placement.ly	Sun Apr 21 15:53:01 2002
+++ ./input/regression/accidental-placement.ly	Tue Apr 23 11:18:03 2002
@@ -10,6 +10,8 @@ Accidentals in corresponding octaves are
     <bes'! fis!>     
     <bes! cis!>
     <c! es ges beses>
+    <bes! c d f >    
+    <bes,! c d f >
 }
 \paper { linewidth = -1. }
      }
diff -purN ../lilypond-1.5.53/input/regression/note-head-chord.ly ./input/regression/note-head-chord.ly
--- ../lilypond-1.5.53/input/regression/note-head-chord.ly	Thu Jan  1 01:00:00 1970
+++ ./input/regression/note-head-chord.ly	Tue Apr 23 11:40:04 2002
@@ -0,0 +1,16 @@
+
+\header {
+    texidoc = "Note heads are flipped on the stem to prevent collisions.
+It also works for whole heads that have invisible stems.
+"
+
+}
+
+\score { \notes \relative c''
+	 \context Thread {
+	     <g4 a c>
+	     <c d g a>
+	     <c d e >
+	     <c c g>
+	     <c1 d f g>
+    }}
diff -purN ../lilypond-1.5.53/input/regression/system-start-bracket.ly ./input/regression/system-start-bracket.ly
--- ../lilypond-1.5.53/input/regression/system-start-bracket.ly	Thu Jan  1 01:00:00 1970
+++ ./input/regression/system-start-bracket.ly	Tue Apr 23 15:51:49 2002
@@ -0,0 +1,17 @@
+\header {
+    texidoc =
+"
+The piano brace should be shifted horizontally if it  is enclosed in a bracket.
+"
+}
+
+
+\score { \notes  {
+    \context StaffGroup <
+	c4
+	\context PianoStaff <
+	    d4
+	    e4
+	   >
+    >
+    }\paper {linewidth = -1. }}
diff -purN ../lilypond-1.5.53/lily/accidental-placement.cc ./lily/accidental-placement.cc
--- ../lilypond-1.5.53/lily/accidental-placement.cc	Sun Apr 21 15:52:03 2002
+++ ./lily/accidental-placement.cc	Tue Apr 23 11:29:33 2002
@@ -15,7 +15,8 @@ source file of the GNU LilyPond music ty
 #include "pitch.hh"
 #include "warn.hh"
 #include "accidental-placement.hh"
-
+#include "note-column.hh"
+#include "group-interface.hh"
 
 MAKE_SCHEME_CALLBACK(Accidental_placement,extent_callback, 2);
 SCM
@@ -99,11 +100,27 @@ struct Accidental_placement_entry
   }
 };
 
+static Interval all_accidental_vertical_extent;
+Real ape_priority (Accidental_placement_entry const * a)
+{
+  Real c = a->vertical_extent_.center();
+
+  /*
+    far from center means we can fold more. Hopefully.
+   */
+  Real center_distance =
+    fabs(c - all_accidental_vertical_extent[LEFT]) >?
+    fabs(c - all_accidental_vertical_extent[RIGHT]);
+  
+  return 20 * a->vertical_extent_.length  ()  + center_distance;
+}
+
+  
 
 int ape_compare (Accidental_placement_entry *const &a,
 		 Accidental_placement_entry *const &b)
 {
-  return sign (a->vertical_extent_.length () - b->vertical_extent_.length());
+  return sign (ape_priority (a) - ape_priority(b));
 }
 
 /*
@@ -157,10 +174,42 @@ Accidental_placement::position_accidenta
 
 
   Grob *commony =0 ;
+
+  /*
+    First we must extract *all* pointers. We can only determine
+    extents if we're sure that we've found the right common refpoint
+   */
+  Link_array<Grob> note_cols, heads;
   for (int i= apes.size (); i--;)
-    commony = common_refpoint_of_array  (apes[i]->grobs_, commony, Y_AXIS);
+    { 
+      Accidental_placement_entry * ape = apes[i];
+      for (int j = ape->grobs_.size(); j--;)
+	{
+	  Grob * a = ape->grobs_[j];
+	  
+	  commony = commony->common_refpoint (a, Y_AXIS);
+	  Grob *head = a->get_parent (Y_AXIS);
 
-  Link_array<Grob> heads;
+	  Grob * col = head->get_parent (X_AXIS);
+	  if (Note_column::has_interface (col))
+	    note_cols.push (col);
+	  else
+	    heads.push (head);
+	}
+    }
+  
+  for (int i = note_cols.size() ; i--;)
+    {
+      heads.concat (Pointer_group_interface__extract_grobs (note_cols[i],
+							    (Grob*)0,
+							    "note-heads"));
+      
+    }
+  heads.default_sort();
+  heads.uniq();
+  commony = common_refpoint_of_array (heads, commony, Y_AXIS);
+
+  
   for (int i= apes.size (); i--;)
     {
       Accidental_placement_entry * ape = apes[i];
@@ -174,12 +223,7 @@ Accidental_placement::position_accidenta
 	  b[X_AXIS] = a->extent (me, X_AXIS);
 	  b[Y_AXIS] = a->extent (commony, Y_AXIS);
 
-	  Grob *head = a->get_parent (Y_AXIS);
-	  heads.push (head);
-	  commony = commony->common_refpoint (head, Y_AXIS);
-	  
 	  ape->extents_.push (b);
-
 	  
 	  /*
 	    TODO: replace the extents of a flat by combination of two
@@ -190,6 +234,8 @@ Accidental_placement::position_accidenta
 	}
     }
 
+
+  Interval total;
   for (int i = apes.size(); i--;)
     {
       Interval y ;
@@ -199,8 +245,9 @@ Accidental_placement::position_accidenta
 	  y.unite (apes[i]->extents_[j][Y_AXIS]);
 	}
       apes[i]->vertical_extent_ = y;
+      total.unite (y);
     }
-  
+  all_accidental_vertical_extent = total;
   apes.sort (&ape_compare);  
 
   Accidental_placement_entry * head_ape = new Accidental_placement_entry;
@@ -228,20 +275,10 @@ Accidental_placement::position_accidenta
     {
       Accidental_placement_entry *ape = apes[i];
       Real d = 0.0;
-      /*
-	confusing naming: left_skyline is a skyline pointing to the
-	left. It is on the right of the curent entry.
-       */
-
       int j = i+1;
       do {
-	Array<Skyline_entry> const *right_sky =
-	  (j < apes.size())
-	  ? &apes[j]->left_skyline_
-	  : &head_skyline;
-
 	d = - skyline_meshing_distance (ape->right_skyline_,
-					     *right_sky);
+					apes[j]->left_skyline_);
 
 	if (!isinf(d)
 	    || j + 1 == apes.size())
diff -purN ../lilypond-1.5.53/lily/auto-beam-engraver.cc ./lily/auto-beam-engraver.cc
--- ../lilypond-1.5.53/lily/auto-beam-engraver.cc	Tue Apr  2 00:48:01 2002
+++ ./lily/auto-beam-engraver.cc	Tue Apr 23 11:35:03 2002
@@ -370,7 +370,7 @@ Auto_beam_engraver::acknowledge_grob (Gr
       /*
 	Don't (start) auto-beam over empty stems; skips or rests
 	*/
-      if (!Stem::heads_i (stem_l))
+      if (!Stem::head_count (stem_l))
 	{
 	  if (stem_l_arr_p_)
 	    end_beam ();
diff -purN ../lilypond-1.5.53/lily/include/stem.hh ./lily/include/stem.hh
--- ../lilypond-1.5.53/lily/include/stem.hh	Sat Apr 13 14:03:47 2002
+++ ./lily/include/stem.hh	Tue Apr 23 11:34:48 2002
@@ -33,7 +33,7 @@ public:
   static void set_stemend (Grob *,Real);
   static Direction get_default_dir (Grob *) ;
 
-  static int heads_i (Grob *) ;
+  static int head_count (Grob *) ;
   static bool invisible_b (Grob *) ;
   static Interval head_positions (Grob *) ;
   static Real get_default_stem_end_position (Grob*me) ;
diff -purN ../lilypond-1.5.53/lily/skyline.cc ./lily/skyline.cc
--- ../lilypond-1.5.53/lily/skyline.cc	Sun Apr 21 15:52:03 2002
+++ ./lily/skyline.cc	Tue Apr 23 11:04:25 2002
@@ -26,7 +26,7 @@
   This file deals with building such skyline structure, and computing
   the minimum distance between two opposing skylines.
   
-  
+   
   Invariants for a skyline:
 
   skyline[...].width_ forms a partition of the real interval, where
diff -purN ../lilypond-1.5.53/lily/slur.cc ./lily/slur.cc
--- ../lilypond-1.5.53/lily/slur.cc	Sun Apr 21 15:55:24 2002
+++ ./lily/slur.cc	Mon Apr 22 11:10:29 2002
@@ -477,7 +477,6 @@ Slur::get_encompass_offset_arr (Grob *me
   /*
     left is broken edge
   */
-
   if (encompass_arr[0] != sp->get_bound (LEFT))
     {
       first--;
diff -purN ../lilypond-1.5.53/lily/stem.cc ./lily/stem.cc
--- ../lilypond-1.5.53/lily/stem.cc	Sat Apr 13 14:03:47 2002
+++ ./lily/stem.cc	Tue Apr 23 11:43:49 2002
@@ -56,7 +56,7 @@ Stem::beam_count (Grob*me,Direction d)
 Interval
 Stem::head_positions (Grob*me) 
 {
-  if (!heads_i (me))
+  if (!head_count (me))
     {
       Interval iv;
       return iv;
@@ -135,13 +135,13 @@ Stem::support_head (Grob*me)
   Grob * nh = unsmob_grob (h);
   if (nh)
     return nh;
-  else if (heads_i (me) == 1)
+  else if (head_count (me) == 1)
     {
       /*
 	UGH.
        */
       
-      return unsmob_grob (ly_car (me->get_grob_property ("heads")));
+      return unsmob_grob (ly_car (me->get_grob_property ("note-heads")));
     }
   else
     return first_head (me);
@@ -149,9 +149,9 @@ Stem::support_head (Grob*me)
 
 
 int
-Stem::heads_i (Grob*me)
+Stem::head_count (Grob*me)
 {
-  return  Pointer_group_interface::count (me, "heads");
+  return  Pointer_group_interface::count (me, "note-heads");
 }
 
 /*
@@ -177,7 +177,7 @@ Stem::extremal_heads (Grob*me) 
   Drul_array<Grob *> exthead;
   exthead[LEFT] = exthead[RIGHT] =0;
   
-  for (SCM s = me->get_grob_property ("heads"); gh_pair_p (s); s = ly_cdr (s))
+  for (SCM s = me->get_grob_property ("note-heads"); gh_pair_p (s); s = ly_cdr (s))
     {
       Grob * n = unsmob_grob (ly_car (s));
 
@@ -207,7 +207,7 @@ Array<int>
 Stem::note_head_positions (Grob *me)
 {
   Array<int> ps ;
-  for (SCM s = me->get_grob_property ("heads"); gh_pair_p (s); s = ly_cdr (s))
+  for (SCM s = me->get_grob_property ("note-heads"); gh_pair_p (s); s = ly_cdr (s))
     {
       Grob * n = unsmob_grob (ly_car (s));
       int p = int (Staff_symbol_referencer::position_f (n));
@@ -228,14 +228,14 @@ Stem::add_head (Grob*me, Grob *n)
 
   if (Note_head::has_interface (n))
     {
-      Pointer_group_interface::add_grob (me, ly_symbol2scm ("heads"), n);
+      Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-heads"), n);
     }
 }
 
 bool
 Stem::invisible_b (Grob*me)
 {
-  return ! (heads_i (me) && Rhythmic_head::balltype_i (support_head (me)) >= 1);
+  return ! (head_count (me) && Rhythmic_head::balltype_i (support_head (me)) >= 1);
 }
 
 Direction
@@ -380,11 +380,11 @@ Stem::duration_log (Grob*me) 
 void
 Stem::position_noteheads (Grob*me)
 {
-  if (!heads_i (me))
+  if (!head_count (me))
     return;
   
   Link_array<Grob> heads =
-    Pointer_group_interface__extract_grobs (me, (Grob*)0, "heads");
+    Pointer_group_interface__extract_grobs (me, (Grob*)0, "note-heads");
 
   heads.sort (compare_position);
   Direction dir =get_direction (me);
@@ -393,6 +393,13 @@ Stem::position_noteheads (Grob*me)
     heads.reverse ();
 
 
+  bool invisible = invisible_b (me);
+  Real thick = 0.0;
+  if (invisible)
+        thick = gh_scm2double (me->get_grob_property ("thickness"))
+	  * me->paper_l ()->get_var ("linethickness");
+      
+
   Grob *hed = support_head (me);
   Real w = Note_head::head_extent (hed,X_AXIS)[dir];
   for (int i=0; i < heads.size (); i++)
@@ -414,7 +421,26 @@ Stem::position_noteheads (Grob*me)
 	    {
 	      Real l = Note_head::head_extent (heads[i], X_AXIS).length ();
 
-	      heads[i]->translate_axis (l * get_direction (me), X_AXIS);
+	      Direction d = get_direction (me);
+	      heads[i]->translate_axis (l * d, X_AXIS);
+
+	      if (invisible_b(me))
+		heads[i]->translate_axis (-thick *2* d , X_AXIS);
+
+	      
+	     /* TODO:
+		 
+	      For some cases we should kern some more: when the
+	      distance between the next or prev note is too large, we'd 
+	      get large white gaps, eg.
+	      
+               |
+              X|
+	       |X  <- kern this.
+	       |
+	      X
+	      
+	      */
 	    }
 	  parity = !parity;
 	}
@@ -431,7 +457,12 @@ Stem::before_line_breaking (SCM smob)
 {
   Grob*me = unsmob_grob (smob);
 
-  if (!invisible_b (me))
+
+  /*
+    Do the calculations for visible stems, but also for invisible stems
+    with note heads (i.e. half notes.)
+   */
+  if (head_count (me))
     {
       stem_end_position (me);	// ugh. Trigger direction calc.
       position_noteheads (me);
@@ -809,5 +840,5 @@ Stem::calc_stem_info (Grob*me) 
 
 ADD_INTERFACE (Stem,"stem-interface",
   "A stem",
-  "adjust-if-on-staffline thickness stem-info beamed-lengths beamed-minimum-lengths lengths beam stem-shorten duration-log beaming neutral-direction stem-end-position support-head heads direction length style no-stem-extend flag-style dir-forced");
+  "adjust-if-on-staffline thickness stem-info beamed-lengths beamed-minimum-lengths lengths beam stem-shorten duration-log beaming neutral-direction stem-end-position support-head note-heads direction length style no-stem-extend flag-style dir-forced");
 
diff -purN ../lilypond-1.5.53/lily/system-start-delimiter-engraver.cc ./lily/system-start-delimiter-engraver.cc
--- ../lilypond-1.5.53/lily/system-start-delimiter-engraver.cc	Tue Feb 26 20:09:52 2002
+++ ./lily/system-start-delimiter-engraver.cc	Tue Apr 23 15:20:30 2002
@@ -49,11 +49,11 @@ System_start_delimiter_engraver::acknowl
       /*
 	UGH UGH
        */
-      if (gh_string_p (gl) && gh_equal_p (gl, ly_symbol2scm ("brace"))
-	  && gh_string_p (my_gl) && gh_equal_p (my_gl, ly_symbol2scm ("bracket")))
+      if (gh_string_p (gl) && gh_equal_p (gl, gh_str02scm  ("brace"))
+	  && gh_string_p (my_gl) && gh_equal_p (my_gl, gh_str02scm  ("bracket")))
 	inf.grob_l_->translate_axis (-0.8, X_AXIS); // ugh
-      else if (gh_string_p (gl) && gh_equal_p (gl, ly_symbol2scm ("bracket"))
-	       && gh_string_p (my_gl) && gh_equal_p (my_gl, ly_symbol2scm ("bracket")))
+      else if (gh_string_p (gl) && gh_equal_p (gl, gh_str02scm  ("bracket"))
+	       && gh_string_p (my_gl) && gh_equal_p (my_gl, gh_str02scm  ("bracket")))
        {
          inf.grob_l_->translate_axis ( -0.8, X_AXIS); // ugh
          inf.grob_l_->set_grob_property ("arch-height",
diff -purN ../lilypond-1.5.53/lily/tie.cc ./lily/tie.cc
--- ../lilypond-1.5.53/lily/tie.cc	Wed Apr 10 19:11:39 2002
+++ ./lily/tie.cc	Mon Apr 22 11:25:51 2002
@@ -133,12 +133,11 @@ Tie::get_control_points (SCM smob)
   Real left_x;
 
   /*
-    this is a kludge: the tie has to be long enough to be
-    visible, but should not go through key sigs.
-
- (please fixme)
+     the tie has to be long enough to be visible, but should not go
+    through key sigs. In the 1.5 series the pref.matter - note
+    distance is fixed , so this won't be a problem anymore.
    */
-  Real lambda = 0.5;		
+  Real lambda = 0.9;		
   
   if (Note_head::has_interface (l))
     left_x = l->extent (l, X_AXIS)[RIGHT] + x_gap_f;
diff -purN ../lilypond-1.5.53/lilypond-mode.el ./lilypond-mode.el
--- ../lilypond-1.5.53/lilypond-mode.el	Thu Apr 18 14:27:46 2002
+++ ./lilypond-mode.el	Mon Apr 22 17:55:58 2002
@@ -137,7 +137,7 @@ in LilyPond-include-path."
 ;; variable instead of quering the user. 
 (defvar LilyPond-command-force nil)
 
-(defcustom LilyPond-xdvi-command "xdvik"
+(defcustom LilyPond-xdvi-command "xdvi"
   "Command used to display DVI files."
 
   :group 'LilyPond
diff -purN ../lilypond-1.5.53/make/ly-rules.make ./make/ly-rules.make
--- ../lilypond-1.5.53/make/ly-rules.make	Tue Feb 26 20:28:53 2002
+++ ./make/ly-rules.make	Tue Apr 23 15:40:08 2002
@@ -47,3 +47,8 @@ $(outdir)/%.tex: $(outdir)/%.ly
 $(outdir)/%-book.ps: $(outdir)/%.ps
 	psbook $< $<.tmp
 	pstops  '2:0L@.7(21cm,0)+1L@.7(21cm,14.85cm)' $<.tmp $@
+
+$(outdir)/%.pdf: $(outdir)/%.dvi
+	dvips -u lilypond.map -o $@.pdfps  -Ppdf $<
+	ps2pdf $@.pdfps $@
+
diff -purN ../lilypond-1.5.53/mf/feta-nummer-code.mf ./mf/feta-nummer-code.mf
--- ../lilypond-1.5.53/mf/feta-nummer-code.mf	Thu Apr 11 11:39:02 2002
+++ ./mf/feta-nummer-code.mf	Tue Apr 23 20:32:29 2002
@@ -35,21 +35,22 @@ define_pixels(kuulleke);
 % direction = is ink on left or right side (1 or -1)
 %
 
+% 
+% move_away_to = amount left (for 2) 
+% turn_to  = amount down (for  2 )
+% 
 def number_flare_path(expr pos,alpha,beta,line,flare,
 
 			move_away_to,
-			turn_to,
-			away_from_start_pos, direction) =
+			turn_to, taille, taille_ratio,
+			direction) =
 	begingroup;
 	clearxy;
 
-	z5 = z2 + 0.43* flare *dir (alpha - 1.5 beta);
+%	z5 = z2 + 0.43* flare *dir (alpha - 1.5 beta);
 
-	save taille;
-
-	taille = 0.06;
 	z4 = (0.75 - taille)  [z2r, z2l] + whatever* dir (alpha - beta) ;
-	z4 = (0.00 + .4 taille) [z3l, z3r] + whatever* dir(alpha);
+	z4 = (taille_ratio * taille) [z3l, z3r] + whatever* dir(alpha);
 	penpos1(line,180+beta+alpha);
 	z1r=pos;
 
@@ -120,7 +121,7 @@ def draw_foot(expr xpos) = 
 	enddef;
 
 def draw_six =
-	set_char_box(0, 2/3height#*widen, 0, height#);
+	set_char_box(0, .68  height#*widen, 0, height#);
 	message "w:"&decimal w;
 	message "h:"&decimal h;
 
@@ -129,28 +130,44 @@ def draw_six =
 	penpos2(hair,90);
 	
 	z2=(w/2,y1);
-	penpos3(7/8thick,0);
+
+	penpos3( 15/16 thick,0);
 	% yup, should use the path fract [] "everywhere"
-	z3r=(w,1/2[0,y1]);
+	x3r=w;
+	y3r = .48 [y4r, y2r];
 	penpos4(hair,-90);
 	z4r=(x2,0);
 	penpos6(hair,90);
-	z6r=(w-flare,h);
-	penpos7(7/8thick,180);
-	z7r=(0,h/2);
-	penpos10(7/8thick,180);
+	x6r = .56 w;
+	y6r = h;
+	penpos7(thick,180);
+
+	x7r=0;
+	y7r = .50 h;
+
+	penpos10(thick,180);
 	z10r=(0,y3);
 	penlabels(1,2,3,4,5,6,7,8,9,10,11);
 
 
-	save t; t=tense;
-	fill z7{right}..z2r{right}..tension t..z3r{down}
-		..tension t..z4r{left}
-		..tension t..z7r{up}
-		.. super_curvelet(z7r, z6r, 0.76, 1)
-		.. flare_path (z6r,0,-90,hair,flare, 1)
-
-		..tension t..z7l{down}..z10l{up}..cycle;
+	save outer_t; outer_t= 0.88;
+	save t ; t := tense; 
+	fill
+%	draw
+		z7{right}..z2r{right}
+		..tension outer_t
+		..z3r{down}
+		..tension outer_t
+		..z4r{left}
+%		..tension t
+		..z7r{up}
+%		.. flare_path (z6r,0,-90,hair,flare, 1)
+		.. number_flare_path (z6r, 0,-90,hair,flare,
+			w - x6r -hair/2, .16 h, 0.05, 2.5, 1)
+
+%		..tension t
+		..z7l{down}
+		 .. {down}z10l -- cycle;
 
 	unfill z2l{right}..tension t..z3l{down}..tension t
 		..z4l{left}..tension t..z10l{up}..tension t..cycle;
@@ -204,8 +221,7 @@ fet_endchar;
 code := 47; % 0 = 48
 
 fet_beginchar("Numeral 0", "0", "zero")
-%	set_char_box(0, 4/5height#*widen, 0, height#);
-	set_char_box(0, 11/15height#*widen, 0, height#);
+	set_char_box(0, 11/15height# * widen, 0, height#);
 	message "w:"&decimal w;
 	message "h:"&decimal h;
 	penpos1(thin,90);
@@ -256,7 +272,7 @@ fet_beginchar("Numeral 1", "1", "one")
 fet_endchar;
 
 fet_beginchar("Numeral 2", "2", "two")
-	set_char_box(0, 11/15height#*widen, 0, height#);
+	set_char_box(0, 22/30 height#*widen, 0, height#);
 	message "w:"&decimal w;
 	message "h:"&decimal h;
 	clearxy;
@@ -278,11 +294,11 @@ fet_beginchar("Numeral 2", "2", "two")
 		..z3l{dir(180+gamma)}..{dir(180+alpha - 5)}z2l
 		..{dir(180+beta)}z1l..cycle;
 
-	penpos4(0.85 thick,0);
+	penpos4(thick,0);
 	z4r=(w-thin/2, .71 h);
 	penpos5(hair,90);
 	y5r = h;
-	x5r = 1/2 hair + 1.0 flare + flare_start* flare;
+	x5r = 9/20 w ;
 
 	penlabels(1,2,3,4);
 	penlabels(5,6);
@@ -291,10 +307,9 @@ fet_beginchar("Numeral 2", "2", "two")
 	save p;
 	path p ;
 	p := z1l{dir(beta)}..tension t..z4r{up}
- 		.. number_flare_path(z5r,180,90,hair, flare,
+ 		.. number_flare_path(z5r,180,90,hair, 1.05 flare,
 				x5r  - 1/2 hair,
-				.20 h, 
-				flare_start* flare, 1)
+				.21 h, 0.006, 0.4, 1)
 		.. z4l{down}..tension t
 		..{dir(180+beta)}z1r..cycle;
 
@@ -309,7 +324,12 @@ fet_beginchar("Numeral 3", "3", "three")
 	message "w:"&decimal w;
 	message "h:"&decimal h;
 	penpos1(hair,-90);
-	z1l=(17/16thick,h);
+
+%	flare_start = 0.25 ;
+	x1l = 35/80 w;
+	y1l = h;
+	
+%	z1l=(17/16thick,h);
 	penpos2(7/8thick,180);
 	z2l=(w-thick/8,3/4h+thick/16);
 	penpos3(thin,90);
@@ -317,28 +337,46 @@ fet_beginchar("Numeral 3", "3", "three")
 	penpos4(thin,90);
 	z4=(5/8thick+1/2thin,y3);
 	penpos5(thick,0);
-	z5r=(w,1/4h+thick/16);
+	x5r=w;
+	y5r = 17/64 h + thick/16;
+
 	penpos6(hair,-90);
-	z6r=(9/8thick,0);
+
+	x6r= 37/80 w;
+	y6r = 0;
 	penpos7(3/2thin,90);
 	z7=(x5,y3);
 	penlabels(1,2,3,4,5,6,7);
 	save alpha; alpha=25;
 	save t; t=tense;
+	save outer_t; outer_t := 0.93;
 	pickup pencircle scaled 1;
+
 %	draw
 	fill
-		flare_path (z1l, 180, 90, hair, 7/8 flare, -1) 
-		.. super_curvelet(z1l, z2l, 0.76, -1)
-		.. z2l{down}..z7r{dir(180+alpha)}
-		..z7l{dir(-alpha)}..z5r{down}..tension t..
-
-		flare_path (z6r, 180, -90, hair, flare, 1) ..tension t..
-
-		z5l{up}
-		..tension t..z3l{left}..z4l{left}
-		..z4r{right}..z3r{right}..tension t..z2r{up}
-		..tension t.. cycle
+		number_flare_path (z1l, 180, 90, hair,  7/8 flare, x1l - .5 hair,
+			.16 h, 0.06, 1.5,  -1)
+		..tension outer_t
+		.. z2l{down}
+		.. tension outer_t
+		..z7r{dir(180+alpha)}
+		..z7l{dir(-alpha)}
+		.. tension outer_t 
+		..z5r{down}
+		.. tension outer_t
+		.. number_flare_path (z6r, 180, -90, hair,  flare, x6l,
+			.18 h, 0.06, 1.5,  1)
+
+		.. z5l{up}
+		..tension t
+		..z3l{left}
+		..z4l{left}
+		..z4r{right}
+		..z3r{right}
+		..tension t
+		..z2r{up}
+		..tension t
+		.. cycle
 ;
 fet_endchar;
 
diff -purN ../lilypond-1.5.53/mf/feta-schrift.mf ./mf/feta-schrift.mf
--- ../lilypond-1.5.53/mf/feta-schrift.mf	Mon Apr  8 11:49:21 2002
+++ ./mf/feta-schrift.mf	Mon Apr 22 11:26:45 2002
@@ -123,13 +123,9 @@ fet_beginchar("> accent", "sforzato", "s
 	labels(4);
 fet_endchar;
 
-%
-% Hmm. Should not meddle with darkness of font. Check out the 
-% correct value for radius. Maybe we'd better change padding --hwn
-%
 fet_beginchar("staccato dot", "staccato", "staccato")
 	save radius;
-	radius# =   3/(8 * 1.75) * staff_space#;
+	radius# =   0.20 * staff_space#;
 	define_whole_pixels(radius);
 	pickup pencircle scaled 2 radius;
 	drawdot (0,0);
@@ -152,9 +148,6 @@ fet_beginchar("staccatissimo/martellato 
 	draw_staccatissimo;
 fet_endchar;
 
-%
-% FIXEM: scale labels too.
-%
 fet_beginchar("staccatissimo/martellato down", "dstaccatissimo", "dstaccatissimo")
 	draw_staccatissimo;
 	y_mirror_char;
diff -purN ../lilypond-1.5.53/scm/grob-property-description.scm ./scm/grob-property-description.scm
--- ../lilypond-1.5.53/scm/grob-property-description.scm	Sun Apr 21 15:55:27 2002
+++ ./scm/grob-property-description.scm	Tue Apr 23 11:34:08 2002
@@ -188,11 +188,7 @@ is used by @ref{note-collision-interface
 
 (grob-property-description 'grow-direction dir? "crescendo or decrescendo?.")
 (grob-property-description 'hair-thickness number? "thickness, measured in stafflinethickness.")
-(grob-property-description 'heads pair? "list of note heads,
-
-FIXME: in Tie this is a pair of grob pointers, pointing to the two heads of the  tie.
-
-.")
+(grob-property-description 'heads pair? "Pair of grob pointers, pointing to the two heads of the  tie.")
 (grob-property-description 'height number? "in staffspace.")
 (grob-property-description 'horizontal-shift integer? "integer that identifies ranking of note-column for horizontal shifting. This is used by @ref{note-collision-interface}.")
 (grob-property-description 'ideal-distances list? "(OBJ . (DIST . STRENGTH)) pairs.")
diff -purN ../lilypond-1.5.53/scripts/lilypond-book.py ./scripts/lilypond-book.py
--- ../lilypond-1.5.53/scripts/lilypond-book.py	Thu Apr 11 11:15:41 2002
+++ ./scripts/lilypond-book.py	Tue Apr 23 12:23:27 2002
@@ -40,16 +40,29 @@
 import os
 import stat
 import string
-import re
+
+
 import getopt
 import sys
 import __main__
 import operator
 
+# Handle bug in Python 1.6-2.1
+#
+# there are recursion limits for some patterns in Python 1.6 til 2.1. 
+# fix this by importing pre instead. Fix by Mats.
+
+# todo: should check Python version first.
+try:
+	import pre
+	re = pre
+	del pre
+except ImportError:
+	import re
 
 program_version = '@TOPLEVEL_VERSION@'
 if program_version == '@' + 'TOPLEVEL_VERSION' + '@':
-	program_version = '1.5.18'
+	program_version = '1.5.53'
 
 # if set, LILYPONDPREFIX must take prevalence
 # if datadir is not set, we're doing a build and LILYPONDPREFIX 
@@ -411,7 +424,8 @@ output_dict= {
 \verb+%s+:''',
 		'output-lilypond': r"""\begin[%s]{lilypond}
 %s
-\end{lilypond}""",
+\end{lilypond}
+""",
 		'output-verbatim': "\\begin{verbatim}%s\\end{verbatim}",
 		'output-default-post': "\\def\postLilypondExample{}\n",
 		'output-default-pre': "\\def\preLilypondExample{}\n",
@@ -420,6 +434,7 @@ output_dict= {
 		'output-tex': '{\\preLilypondExample \\input %(fn)s.tex \\postLilypondExample\n}',
 		'pagebreak': r'\pagebreak',
 		},
+	
 	'texi' : {'output-lilypond': """@lilypond[%s]
 %s
 @end lilypond 
@@ -467,6 +482,11 @@ def output_verbatim (body):
 	return get_output ('output-verbatim') % body
 
 
+#warning: this uses extended regular expressions. Tread with care.
+
+# legenda (?P  name parameter
+# *? match non-greedily.
+
 re_dict = {
 	'latex': {'input': r'(?m)^[^%\n]*?(?P<match>\\mbinput{?([^}\t \n}]*))',
 		  'include': r'(?m)^[^%\n]*?(?P<match>\\mbinclude{(?P<filename>[^}]+)})',
diff -purN ../lilypond-1.5.53/scripts/ly2dvi.py ./scripts/ly2dvi.py
--- ../lilypond-1.5.53/scripts/ly2dvi.py	Sun Apr 14 23:28:06 2002
+++ ./scripts/ly2dvi.py	Tue Apr 23 12:21:53 2002
@@ -372,7 +372,9 @@ non_path_environment = {
 
 def setup_environment ():
 	# $TEXMF is special, previous value is already taken care of
-	del os.environ['TEXMF']
+	if os.environ.has_key ('TEXM'):
+		del os.environ['TEXMF']
+ 
 
 	for key in environment.keys ():
 		val = environment[key]
