Generated by hanwen@cs.uu.nl,
From = lilypond-1.5.56, To = lilypond-1.5.57

usage 

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

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

diff -purN ../lilypond-1.5.56/.cvsignore ./.cvsignore
--- ../lilypond-1.5.56/.cvsignore	Mon Apr  1 18:31:15 2002
+++ ./.cvsignore	Sun May 19 02:11:53 2002
@@ -1,11 +1,11 @@
 GNUmakefile
 TAGS
+configure
 config.cache
 config.h
 config.log
 config.make
 config.status
-configure
 .dstreamrc
 .gdbinit
 *~
diff -purN ../lilypond-1.5.56/ChangeLog ./ChangeLog
--- ../lilypond-1.5.56/ChangeLog	Fri May 17 00:38:00 2002
+++ ./ChangeLog	Sun May 19 02:16:28 2002
@@ -1,5 +1,87 @@
+2002-05-18  Juergen Reuter  <reuter@ipd.uka.de>
+
+	* mf/parmesan-heads.mf, scm/grob-description.scm,
+	scm/grob-property-description.scm, scm/interface-description,
+	lily/include/my-lily-parser.hh, lily/include/ligature-head.hh,
+	lily/include/mensural-ligature.hh, lily/include/lily-proto.hh,
+	lily/include/ligature-engraver.hh,
+	lily/include/ligature-bracket.hh, lily/parser.yy,
+	lily/ligature-bracket-engraver.cc, lily/mensural-ligature.cc,
+	lily/mensural-ligature-engraver.cc, lily/note-heads-engraver.cc,
+	lily/ligature-head.cc, lily/ligature-engraver.cc,
+	lily/ligature-bracket.cc, input/test/mensural-ligatures.ly:
+	implemented white mensural ligatures (still with a big list of
+	TODOs)
+
+
+2002-05-19  Han-Wen  <hanwen@cs.uu.nl>
+
+	* lily/*.cc: use LY_DEFINE everywhere. Move doc strings from
+	Documentation/user/internals.itely.
+
+	* lily/function-documentation.cc: new file. Infrastructure for
+	self documenting Scheme functions.
+
+2002-05-18  Han-Wen  <hanwen@cs.uu.nl>
+
+	* lily/stem.cc (calc_stem_info): bugfix for less ugly knees.
+
+2002-05-17  Han-Wen  <hanwen@cs.uu.nl>
+
+	* scripts/lilypond-book.py (re_dict): fix regexps; don't combine ?
+	and * (as in "([^>]*)?")
+
+2002-05-17  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+	* Documentation/topdocs/INSTALL.texi: Update GCC, Flex and GUILE info.
+	Add info about CVS.  Stable/development are currently 1.4/1.5,
+	both at lilypond.org.
+
+	* autogen.sh: Generate.
+
+	* stepmake/configure:
+	* configure: Regenerate.
+	
+	* stepmake/stepmake/automatically-generated.sub.make: Keep
+	original first line.
+
+	* stepmake/stepmake/toplevel-targets.make (autogen.sh): Add rule.
+
+	* stepmake/stepmake/generic-targets.make (configure): Generate
+	using autogen.sh.
+
+	* GNUmakefile.in (SCRIPTS):
+	* stepmake/GNUmakefile.in (SCRIPTS): Add autogen.sh
+
+	* stepmake/autogen.sh: New file.
+
+	* configure: Check for g++ >= 2.95.
+
+	* stepmake/aclocal.m4: Fixes for FlexLexer.h, Python headers.  GNU
+	c/c++ version checking.
+
+	* flower/include/string.hh: Typo fix.
+
+	* lily/include/midi-item.hh: Remove stray i.
+
+	* Documentation/windows/GNUmakefile: Avoid collapsed directory
+	constructs '//'.
+	
+	* stepmake/bin/install-dot-exe.sh: Filter collapsed directory
+	constructs '//' from arguments.
+
 2002-05-17  Han-Wen  <hanwen@cs.uu.nl>
 
+	* scm/lily.scm (ly-load): show SCM filenames if verbose.
+
+	* lily/lily-guile.cc (init_functions): add ly-verbose function.
+
+	* lily/main.cc (setup_paths): remove LILYINCLUDE support. 
+
+	* flower/include/{pointer,tuple}*: removed.
+
+	* VERSION: released 1.5.56
+	
 	* scm/music-functions.scm (check-start-chords): function to check
 	for chords without \context. Apply automatically from parser.
 
diff -purN ../lilypond-1.5.56/Documentation/topdocs/INSTALL.texi ./Documentation/topdocs/INSTALL.texi
--- ../lilypond-1.5.56/Documentation/topdocs/INSTALL.texi	Mon May 13 17:47:17 2002
+++ ./Documentation/topdocs/INSTALL.texi	Sun May 19 02:11:54 2002
@@ -15,10 +15,10 @@
 @chapter INSTALL - compiling and installing GNU LilyPond
 
 
-This document describes how to build LilyPond on Unix platforms.  It is
-also known to run and compile on Windows NT/95/98 as well.  More
-information on this topic can be found at the
-@uref{http://www.lilypond.org/gnu-windows/, LilyPond on Windows page}.
+This document describes how to build LilyPond on Unix platforms.  It
+is also known to run and compile on Windows NT/95/98/ME/XP as well.
+More information on this topic can be found at the
+@uref{http://www.lilypond.org/cygwin/, LilyPond on Windows page}.
 
 
 @html
@@ -28,9 +28,9 @@ information on this topic can be found a
 @section Downloading
 
 Even numbered versions are `stable'. The webpages for the stable version
-(1.2) reside @uref{http://www.gnu.org/software/lilypond, on the GNU
+(1.4) reside @uref{http://www.gnu.org/software/lilypond, on the GNU
 servers}. Big enhancements go into the latest odd numbered version
-(1.3), whose webpages are on @uref{http://www.lilypond.org/,the lilypond
+(1.5), whose webpages are on @uref{http://www.lilypond.org/,the lilypond
 site}.
 
 @subsection Source code
@@ -48,6 +48,7 @@ If you want to compile LilyPond from sou
 @uref{http://www.lilypond.org/ftp/} by HTTP.
 @end itemize
 
+
 Of course, if your platform supports LilyPond, such as Debian GNU/Linux,
 FreeBSD, OpenBSD or NetBSD, you're encouraged to use the native build
 from source drill.
@@ -55,6 +56,20 @@ from source drill.
 For Red Hat Linux and SuSE Linux, @file{.spec} files are included in the
 tarball; see instructions below.
 
+
+@subsubsection Anonymous CVS access
+
+Short version:
+
+@quotation
+@example
+cvs -d :pserver:anoncvs@@lilypond.org:/home/lilypond login
+cvs -d :pserver:anoncvs@@lilypond.org:/home/lilypond co -P lilypond
+@end example
+@end quotation
+
+See @uref{http://lilypond.org/wiki/?CVS} for more information.
+
 @html
 <a name="download-binaries">
 @end html
@@ -117,13 +132,18 @@ on the FTP site.
 You need the following packages to compile Lilypond.
 
 @itemize
-@item A reasonably new version of the GNU C++ compiler:  EGCS 1.1, GCC 2.95.2 or
-newer. Check out @uref{ftp://ftp.gnu.org/gnu/gcc/, the gcc site}.
+@item The GNU c++ compiler (version 2.95.2 or newer).
+EGCS 1.1 may work, but is no longer supported.
+Check out @uref{ftp://ftp.gnu.org/gnu/gcc/, the gcc site}.
+
+WARNING: if you choose to upgrade to GCC 3.x, enquire if your
+distribution supports g++ 3.x and flex.
 
 @item Python (version 1.5 or newer).
 Check out @uref{http://www.python.org, the python website}.
 
 @item GUILE (version 1.4 or newer).
+GUILE-1.3.4 may work but is no longer supported.
 Check out
 @uref{http://www.gnu.org/software/guile/guile.html,the GUILE webpage}.
 
@@ -135,6 +155,11 @@ make FTP directory}.
 @item Flex (version 2.5.4a or newer). 
 Check out @uref{http://www.gnu.org/software/flex/,the Flex webpage}.
 
+WARNING: plain Flex 2.5.4(a) generates invalid C++ code.  GCC 3.x
+chokes on this.  If you wish to use GCC 3.x, make sure that your
+distribution supports g++ 3.x and flex.  For a workaround, see
+lexer-gcc-3.0 below.
+
 @item Bison (version 1.25 or newer).
 Check out @uref{http://www.gnu.org/software/bison/,the bison  webpage}
 
@@ -168,9 +193,11 @@ UNIX), you can compile LilyPond without 
 you'll probably have to indicate where @TeX{}'s tfm files live.  Invoke
 configure something like:
 
+@quotation
 @example
 ./configure --without-kpathsea --enable-tfm-path=/usr/share/texmf/fonts/tfm/public/cm/:/usr/share/texmf/fonts/tfm/ams/symbols
 @end example
+@end quotation
 
 @end itemize
 
@@ -182,7 +209,7 @@ following software
 @itemize @bullet
 @item @TeX{}.
 @item Xdvi and Ghostscript
-@item GUILE 1.3.4, or newer.  Check out
+@item GUILE 1.4, or newer.  Check out
 @uref{http://www.gnu.org/software/guile.html,the GUILE webpage}
 @end itemize
 
@@ -255,7 +282,9 @@ If you want to build multiple versions o
 configuration settings, you can use the @code{--enable-config=CONF}
 option of configure.  You should use @samp{make conf=CONF} to generate
 the output in @file{out-CONF}.  Example: suppose I want to build with
-and without profiling.  Then I'd use the following for the normal build,
+and without profiling.  Then I'd use the following for the normal
+build,
+@c prefix=~ ?
 @example 
 
       ./configure --prefix=~ --enable-checking
@@ -309,7 +338,9 @@ file.
 @subsection Red Hat Linux
 
 Red Hat 7.x i386 RPMS are available from
-@uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/binaries/}.
+@uref{ftp://ftp.cs.uu.nl/pub/GNU/LilyPond/binaries/}.  For running on
+a Red Hat system you need these packages: guile, tetex, tetex-latex,
+tetex-dvips, libstdc++, python, ghostscript.
 
 You can also compile them yourself.  A spec file is in
 @file{make/out/lilypond.redhat.spec}. This file is distributed along
@@ -322,9 +353,6 @@ with the sources.  You can make the rpm 
 
 @end example 
 
-For running on a Red Hat system you need these packages: guile, tetex,
-tetex-latex, tetex-dvips, libstdc++, python, ghostscript.
-
 For compilation on a Red Hat system you need these packages, in
 addition to the those needed for running: glibc-devel, gcc-c++,
 libstdc++-devel, guile-devel, flex, bison, texinfo, groff, pktrace,
diff -purN ../lilypond-1.5.56/Documentation/user/internals.itely ./Documentation/user/internals.itely
--- ../lilypond-1.5.56/Documentation/user/internals.itely	Fri May 17 00:38:01 2002
+++ ./Documentation/user/internals.itely	Sun May 19 02:11:55 2002
@@ -76,176 +76,10 @@ The data types that are mentioned here a
 section.
 
 @menu
-* Input location::              
-* Moment::                      
-* Duration::                    
-* Pitch data type::             
-* Music::                       
-* Music_iterator::              
-* Translator::                  
 * Grobs::                       Graphical object  
 * Molecules::                   Molecules are stand-alone descriptions of output
-* Font metrics::                Font metrics
-* Miscellaneous Scheme functions::  
 @end menu
 
-@ignore
-  Why not use Scheme syntax for the functions below, such as
-  (ly-input-location? obj) and (ly-get-mus-property m sym) ?
-
-  /MB
-@end ignore
-
-@node Input location
-@section Input location
-
-@c The parser generates
-
-Input location objects point to a location in the input file. This
-location is used to generate error messages and to enable the point and
-click output.
-
-@defun ly-input-location? obj
-Type predicate, return true if @var{obj} is an input location.
-@end defun
-
-
-
-
-@node Moment
-@section Moment
-
-Moment is a point in musical time. It is consists of a pair of
-rationals (@var{m},@var{g}), where @var{m} is the timing for the  main
-notes, and @var{g} the timing for  grace notes. In absence of grace
-notes, @var{g} is zero.
-
-@defun moment? obj
-Type predicate, return true if @var{obj} is a moment.
-@end defun
-
-@defun make-moment num den
-create the rational number with main timing @var{num}/@var{den}. 
-@end defun
-
-@node Duration
-@section Duration
-
-A duration is a musical duration, i.e. a length of time described by a
-power of two (whole, half, quarter, etc.) and a number of augmentation
-dots. 
-
-@defun make-duration length dotcount
-
-@var{length} is the negative logarithm (base 2) of the duration:
-1 is a half note, 2 is a quarter note, 3 is an eighth
-note, etc.  The number of dots after the note is given by
-@var{dotcount}.
-@end defun
-
-
-@defun duration? obj
-Type predicate, return true if @var{obj} is a duration.
-@end defun
-
-@node Pitch data type
-@section Pitch data type
-
-
-
-@defun make-pitch octave note shift
-
-@var{octave} is specified by an integer, zero for the octave containing
-middle C.  @var{note} is a number from 0 to 6, with 0 corresponding to C
-and 6 corresponding to B.  The shift is zero for a natural, negative for
-flats, or positive for sharps.
-@end defun
-
-@defun pitch-octave p 
-extract the octave from pitch @var{p}.
-@end defun
-
-@defun pitch-notename p
-extract the note name from pitch  @var{p}.
-@end defun
-
-@defun pitch-alteration p
-extract the alteration from pitch  @var{p}.
-@end defun
-
-@defun pitch-semitones p
-calculate the number of semitones of @var{p} from central C.
-@end defun
-
-@defun Pitch@code{:}@code{:}transpose t p
-Transpose @var{p} by the amount @var{t}, where @var{t} is the pitch that
-central C is transposed to. 
-@end defun
-
-
-@node Music
-@section Music
-
-Music is the data type that music expressions are stored in. The data
-type does not yet offer many manipulations.
-
-@defun ly-get-mus-property m sym
-Get the property @var{sym} of music expression @var{m}.
-@end defun
-
-@defun ly-set-mus-property m sym val
-Set property @var{sym} in music expression @var{m} to @var{val}.
-@end defun
-
-@defun ly-make-music name
-Make a music object/expression of type @var{name}. Warning: this
-interface will likely change in the near future.
-@end defun
-
-@defun music? obj
-Type predicate,  return true if @var{obj} is a music object.
-@end defun
-
-@defun ly-music-name music
-Print the name of @var{music}.
-@end defun
-
-
-@node Music_iterator
-@section Music_iterator
-
-Music_iterator is an object type that traverses the Music structure and
-reports the events it finds to interpretation contexts. It is not yet
-user-serviceable.
-
-@defun c++-function? obj
-Type predicate, return true if @var{obj} is a  c++-function.
-Music_iterator are created from schemified C++ constructors. Such a
-constructor is a @code{c++-function}.
-@end defun
-
-@node Translator
-@section Translator
-
-Translators are the building blocks of contexts. They are not yet user
-accessible.
-
-@defun ly-get-trans-property tr sym
-retrieve the value of @var{sym} from context @var{tr}
-@end defun
-
-@defun ly-set-trans-property tr sym val
-set value of property @var{sym} in context @var{tr} to @var{val}.
-@end defun
-
-@defun Translator@code{:}@code{:}name tr
-Return the type name of the translator @var{tr}.
-@end defun 
-
-@defun Translator@code{:}@code{:}description tr
-Return an alist of properties of  translator @var{tr}.
-@end defun
-
 @node Grobs
 @section Grobs
 
@@ -519,25 +353,6 @@ no extent.
 Grob properties can be manipulated from Scheme. In practice, most
 manipulations are coded in C++ because of tradition.
 
-@defun ly-get-grob-property g sym
-  Get the value of a value in grob @var{g} of property @var{sym}. It
-will return @code{'()} (end-of-list) if @var{g} doesn't have @var{sym} set.
-@end  defun
-
-@defun ly-set-grob-property g sym val
-Set @var{sym} in grob @var{g} to value @var{val}
-@end defun
-
-@defun ly-get-spanner-bound spanner dir
-Get one of the bounds of @var{spanner}. @var{dir} may be @code{-1} for
-left, and @code{1} for right.
-@end defun
-
-@defun ly-grob? g
-Typecheck: is @var{g} a grob?
-@end defun
-
-
 
 
 @node Molecules
@@ -588,92 +403,5 @@ returning a Molecule.  Most molecule cal
 you can also write them in Scheme. An example is provided in
 @code{input/regression/molecule-hacking.ly}.
 
-
-@defun molecule? m
-type predicate.
-@end defun
-
-@defun ly-combine-molecule-at-edge  mol1 axis dir mol2 padding
-Construct a molecule by putting @var{mol2} next to
-@var{mol1}. @var{axis} can be 0 (x-axis) or 1 (y-axis), @var{dir} can be
--1 (left or down) or 1 (right or up).  @var{padding} specifies extra
-space to add in between measured in global staff space.
-@end defun
-
-@defun ly-get-molecule-extent! mol axis
-Return a pair of numbers signifying the extent of @var{mol} in
-@var{axis} direction (0 or 1 for x and y axis respectively).
-@end defun
-
-@defun ly-set-molecule-extent! mol axis extent
-Set the extent (@var{extent} must be a pair of numbers) of @var{mol} in 
-@var{axis} direction (0 or 1 for x- and y-axis respectively).
-
-Note that an extent @code{(A . B)} is an interval and hence @code{A} is
-smaller than @code{B}, and is often negative.
-
-@end defun
-
-@node Font metrics
-@section Font metrics
-
-The font object represents the metric information of a font. Every font
-that is loaded into LilyPond can be accessed via Scheme. 
-
-LilyPond only needs to know the dimension of glyph to be able to process
-them. This information is stored in font metric files. LilyPond can read
-two types of font-metrics: @TeX{} Font Metric files (TFM files) and
-Adobe Font Metric files (AFM files).  LilyPond will always try to load
-AFM files first since they are more versatile.
-
-@defun ly-get-default-font gr
-This returns the default font for grob @var{gr}.
-@end defun
-
-@defun ly-find-glyph-by-name font name
-This function retrieves a Molecule for the glyph named @var{name} in
-@var{font}.  The font must be available as an AFM file.
-@cindex afm file
-
-@end defun
-
-@node Miscellaneous Scheme functions
-@section Miscellaneous Scheme functions
-
  
-@defun ly-warn msg
-Scheme callable function to issue the warning @code{msg}.
-@end defun
-
-@defun ly-version
-Return the current lilypond version as a list, e.g.
-@code{(1 3 127 uu1)}. 
-@end defun
-
-@defun ly-gulp-file name
-Read the file named @var{name}, and return its contents in a string. The
-file is looked up using the lilypond search path.
-
-@end defun
-
-@defun dir?
-type predicate. A direction is a -1, 0 or 1, where -1 represents left or
-down and 1 represents right or up.
-@end defun
-
-@defun ly-number->string num
- converts @var{num} to a string without generating many decimals. It
-leaves a space at the end.
-@end defun
-
-@defun set-lily-option sym val
- Set a global option for the program. Supported options  include
-@table @code
-@item midi-debug
-If set to true, generate human  readable MIDI
-@end table
-
-This function is useful to call from the command line: @code{lilypond -e
-"(set-lily-option 'midi-debug #t)"}
 
-@end defun 
diff -purN ../lilypond-1.5.56/Documentation/user/invoking.itexi ./Documentation/user/invoking.itexi
--- ../lilypond-1.5.56/Documentation/user/invoking.itexi	Sat May  4 14:57:28 2002
+++ ./Documentation/user/invoking.itexi	Sun May 19 02:11:55 2002
@@ -97,9 +97,6 @@ settings from within Scheme .}
 @section Environment variables
 
 @table @code
-@item LILYINCLUDE
-additional directories for finding lilypond data.  The
-format is like the format of @file{PATH}.
 @item LILYPONDPREFIX
 This specifies a directory where locale messages and
 data files will be looked up by default. The directory should contain
diff -purN ../lilypond-1.5.56/Documentation/user/refman.itely ./Documentation/user/refman.itely
--- ../lilypond-1.5.56/Documentation/user/refman.itely	Sun Apr 28 01:02:00 2002
+++ ./Documentation/user/refman.itely	Sun May 19 02:11:55 2002
@@ -196,7 +196,7 @@ The verbose syntax for pitch specificati
   \pitch @var{scmpitch}
 @end example
 
-@var{scmpitch} is a pitch scheme object, see @ref{Pitch data type}.
+@var{scmpitch} is a pitch scheme object.
 
 In Note and Chord mode, pitches may be designated by names.  The default
 names are the Dutch note names.  The notes are specified by the letters
@@ -320,8 +320,7 @@ The syntax for a verbose duration specif
 @example
  \duration @var{scmduration}
 @end example
-Here, @var{scmduration} is a Scheme object of type @code{Duration}. See
-@ref{Duration} for more information.
+Here, @var{scmduration} is a Scheme object of type @code{Duration}.
 
 
 In Note, Chord, and Lyrics mode, durations may be designated by numbers
@@ -4676,8 +4675,7 @@ including dimensions.  Produced by some 
 See @ref{Molecules}
 @item Translator: object that produces audio objects or Grobs. This is
 not yet user accessible.
-@item Font_metric: object representing a font. (See @ref{Font metrics})
-
+@item Font_metric: object representing a font.
 @end itemize
 
 
diff -purN ../lilypond-1.5.56/Documentation/windows/GNUmakefile ./Documentation/windows/GNUmakefile
--- ../lilypond-1.5.56/Documentation/windows/GNUmakefile	Wed Dec  5 14:53:28 2001
+++ ./Documentation/windows/GNUmakefile	Sun May 19 02:11:55 2002
@@ -40,10 +40,12 @@ INSTALLATION_OUT_SUFFIXES=1 2
 # LilyPond on windows is configured with --prefix=/usr/lilypond-x.y.x
 # The cygwin profile.d dir, however, is in /etc
 
-INSTALLATION_DIR=$(shell dirname $(shell dirname $(prefix)))/etc/postinstall
+# avoid collapsed directory constructs '//'
+etc=$(dir $(patsubst %/, %, $(dir $(prefix))))etc
+INSTALLATION_DIR=$(etc)/postinstall
 INSTALLATION_FILES=$(OUT_POST_INSTALLS)
 
-INSTALLATION_OUT_DIR1=$(shell dirname $(shell dirname $(prefix)))/etc/profile.d
+INSTALLATION_OUT_DIR1=$(etc)/profile.d
 INSTALLATION_OUT_FILES1=$(OUT_PROFILES)
 
 INSTALLATION_OUT_DIR2=$(datadir)/tex
diff -purN ../lilypond-1.5.56/GNUmakefile.in ./GNUmakefile.in
--- ../lilypond-1.5.56/GNUmakefile.in	Sun May  5 15:44:49 2002
+++ ./GNUmakefile.in	Sun May 19 02:11:53 2002
@@ -16,7 +16,7 @@ SUBDIRS = buildscripts scripts flower li
 	mutopia 
 #
 
-SCRIPTS = configure aclocal.m4
+SCRIPTS = configure aclocal.m4 autogen.sh
 README_FILES =  ChangeLog CHANGES COPYING DEDICATION NEWS README.mandrake ROADMAP
 README_TXT_FILES = AUTHORS.txt README.txt INSTALL.txt FAQ.txt
 IN_FILES := $(wildcard *.in)
diff -purN ../lilypond-1.5.56/VERSION ./VERSION
--- ../lilypond-1.5.56/VERSION	Fri May 17 01:00:11 2002
+++ ./VERSION	Sun May 19 02:23:13 2002
@@ -1,7 +1,7 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
-PATCH_LEVEL=56
+PATCH_LEVEL=57
 MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
diff -purN ../lilypond-1.5.56/aclocal.m4 ./aclocal.m4
--- ../lilypond-1.5.56/aclocal.m4	Fri May 17 01:00:12 2002
+++ ./aclocal.m4	Sun May 19 02:23:17 2002
@@ -1,4 +1,5 @@
-dnl WARNING WARNING WARNING WARNING
+dnl aclocal.m4   -*-shell-script-*-
+dnl WARNING WARNING WARNING
 dnl do not edit! this is aclocal.m4, generated from stepmake/aclocal.m4
 dnl aclocal.m4   -*-shell-script-*-
 dnl StepMake subroutines for configure.in
@@ -108,7 +109,6 @@ AC_DEFUN(STEPMAKE_BISON, [
 	STEPMAKE_CHECK_VERSION(BISON, $1, $2)
     fi
 ])
-    
 
 
 AC_DEFUN(STEPMAKE_COMPILE, [
@@ -194,9 +194,6 @@ AC_DEFUN(STEPMAKE_CXX, [
     AC_PROG_CXX
     STEPMAKE_OPTIONAL_REQUIRED(CXX, c++, $1)
 
-    AC_CHECK_HEADER(FlexLexer.h, true,
-	STEPMAKE_WARN(cannot find flex header.  Please install Flex headers correctly))
-
     CPPFLAGS="$CPPFLAGS $DEFINES"
     CXXFLAGS="$CXXFLAGS $OPTIMIZE"
     LDFLAGS="$LDFLAGS $EXTRA_LIBES"
@@ -301,6 +298,24 @@ AC_DEFUN(STEPMAKE_FLEX, [
 ])
 
 
+AC_DEFUN(STEPMAKE_FLEXLEXER, [
+    AC_HAVE_HEADERS(FlexLexer.h, true, false)
+    if test $? -ne 0; then
+	warn='FlexLexer.h (flex package)'
+	STEPMAKE_ADD_ENTRY($1, $warn)
+    fi
+])
+
+
+AC_DEFUN(STEPMAKE_GCC, [
+    if test "$GCC" = "yes"; then
+        STEPMAKE_CHECK_VERSION(CC, $1, $2)
+    else
+	warn="$CC (Please install *GNU* cc)"
+	STEPMAKE_ADD_ENTRY($1, $warn)
+    fi
+])
+
 
 AC_DEFUN(STEPMAKE_GETTEXT, [
     DIR_LOCALEDIR=${localedir}
@@ -371,7 +386,6 @@ AC_DEFUN(STEPMAKE_GUILE_DEVEL, [
 	fi
     done
     STEPMAKE_OPTIONAL_REQUIRED(GUILE_CONFIG, $guile_config, $1)
-    #if expr "$GUILE_CONFIG" : '.*\(echo\)' >/dev/null; then
     if test $? -ne 0; then
         STEPMAKE_ADD_ENTRY($1, 'guile-config (guile-devel, guile-dev or libguile-dev package)')
     fi 
@@ -396,25 +410,15 @@ AC_DEFUN(STEPMAKE_GUILE_DEVEL, [
 
 
 AC_DEFUN(STEPMAKE_GXX, [
-    AC_MSG_CHECKING("g++ version")
-    cxx_version=`$CXX --version`
-    AC_MSG_RESULT("$cxx_version")
-    changequote(<<, >>)dnl
-    # urg, egcs: how to check for egcs >= 1.1?
-    if expr "$cxx_version" : '.*2\.[89]' > /dev/null ||
-	expr "$cxx_version" : '.*egcs' > /dev/null ||
-	expr "$cxx_version" : '3\.[0-9]' > /dev/null
-    changequote([, ])dnl
-    then
-	    true
+    if test "$GXX" = "yes"; then
+        STEPMAKE_CHECK_VERSION(CXX, $1, $2)
     else
-	STEPMAKE_WARN(cannot find g++ 2.8, 2.9, 3.x or egcs 1.1)
-        STEPMAKE_ADD_ENTRY($1, 'g++ >= 2.95 (gcc package)')
+	warn="$CXX (Please install *GNU* c++)"
+	STEPMAKE_ADD_ENTRY($1, $warn)
     fi
 ])
 
 
-
 AC_DEFUN(STEPMAKE_INIT, [
 
     . $srcdir/VERSION
@@ -564,7 +568,7 @@ AC_DEFUN(STEPMAKE_INIT, [
  	$MAKE -v 2> /dev/null | grep GNU > /dev/null
 	if test "$?" = 1; then
 	    warn='make (Please install *GNU* make)'
-	    STEPMAKE_WARN($warn)
+	    # STEPMAKE_WARN($warn)
 	    STEPMAKE_ADD_ENTRY(REQUIRED, $warn)
         fi
     fi 
@@ -765,9 +769,10 @@ AC_DEFUN(STEPMAKE_PERL, [
 
 
 AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [
-    AC_HAVE_HEADERS(python2.2/Python.h python2.1/Python.h python2.0/Python.h python2/Python.h python/Python.h python1.5/Python.h Python.h)
-    if test $? -ne 0; then
-	STEPMAKE_ADD_ENTRY($1, 'python.h (python-devel, python-dev or libpython-dev package)')
+    AC_HAVE_HEADERS(python2.2/Python.h python2.1/Python.h python2.0/Python.h python2/Python.h python/Python.h python1.5/Python.h Python.h, PYTHON_HEADER=yes)
+    if test -z "$PYTHON_HEADER"; then
+	warn='python.h (python-devel, python-dev or libpython-dev package)'
+	STEPMAKE_ADD_ENTRY($1, $warn)
     fi
 ])
 
diff -purN ../lilypond-1.5.56/autogen.sh ./autogen.sh
--- ../lilypond-1.5.56/autogen.sh	Thu Jan  1 01:00:00 1970
+++ ./autogen.sh	Fri May 17 14:09:11 2002
@@ -0,0 +1,47 @@
+#!/bin/sh
+# WARNING WARNING WARNING
+# do not edit! this is autogen.sh, generated from stepmake/autogen.sh
+#!/bin/sh
+# Run this to generate configure and initial GNUmakefiles
+
+srcdir=`dirname $0`
+DIE=0
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+  echo
+  echo "ERROR: You must have \`autoconf' installed to."
+  echo "Download the appropriate package for your distribution,"
+  echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+  DIE=1
+}
+
+if test "$DIE" -eq 1; then
+  exit 1
+fi
+
+
+if test -z "$*"; then
+  echo "WARNING: I am going to run \`configure' with no arguments."
+  echo "If you wish to pass any to it, please specify them on the"
+  echo \`$0\'" command line."
+  echo
+fi
+
+for coin in `find $srcdir -name configure.in -print`
+do 
+  dr=`dirname $coin`
+  echo processing $dr
+  (
+      cd $dr
+      echo "Running autoconf ..."
+      autoconf
+  )
+done
+
+#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
+if test -z "$NOCONFIGURE"; then
+  echo Running $srcdir/configure $conf_flags "$@" ...
+  $srcdir/configure $conf_flags "$@"
+else
+  echo Skipping configure process.
+fi
diff -purN ../lilypond-1.5.56/config.make.in ./config.make.in
--- ../lilypond-1.5.56/config.make.in	Fri May 17 00:38:01 2002
+++ ./config.make.in	Sun May 19 02:11:53 2002
@@ -34,8 +34,10 @@ srcdir = @srcdir@
 stepmake = @stepmake@
 
 CC = @CC@
+GCC = @GCC@
 CROSS = @cross_compiling@
 CXX = @CXX@
+GXX = @GXX@
 LD = @LD@
 CONFIGSUFFIX = @CONFIGSUFFIX@
 MAKEINFO = @MAKEINFO@
@@ -56,7 +58,6 @@ FIND = @FIND@
 FLEX = @FLEX@
 GUILE = @GUILE@
 GUILE_CONFIG = @GUILE_CONFIG@
-GUILE_CONFIG = @GUILE_CONFIG@
 GUILE_CFLAGS = @GUILE_CFLAGS@
 GUILE_LDFLAGS = @GUILE_LDFLAGS@
 INIMETAFONT = @INIMETAFONT@
diff -purN ../lilypond-1.5.56/configure.in ./configure.in
--- ../lilypond-1.5.56/configure.in	Fri May 17 00:38:01 2002
+++ ./configure.in	Sun May 19 02:11:54 2002
@@ -12,17 +12,18 @@ STEPMAKE_INIT
 AC_CONFIG_SUBDIRS(stepmake)
 
 # Uncomment the configuration options your package needs.
+
+# must come before any header checks
 STEPMAKE_COMPILE
-# AC_HAVE_HEADERS(limits.h malloc.h string.h unistd.h values.h)
-AC_HAVE_HEADERS(assert.h sys/stat.h)
-AC_HEADER_STAT
 
+STEPMAKE_GCC(REQUIRED, 2.8)
 STEPMAKE_CXX(REQUIRED)
-STEPMAKE_GXX(REQUIRED)
+STEPMAKE_GXX(REQUIRED, 2.95)
 STEPMAKE_CXXTEMPLATE
+STEPMAKE_LIB(REQUIRED)
 STEPMAKE_BISON(REQUIRED, 1.25)
 STEPMAKE_FLEX(REQUIRED)
-STEPMAKE_LIB(REQUIRED)
+STEPMAKE_FLEXLEXER(REQUIRED)
 STEPMAKE_LOCALE
 STEPMAKE_GETTEXT
 STEPMAKE_MSGFMT(REQUIRED)
@@ -34,6 +35,15 @@ STEPMAKE_MAKEINFO(REQUIRED)
 STEPMAKE_PYTHON_DEVEL(REQUIRED)
 
 
+# AC_HAVE_HEADERS(limits.h malloc.h string.h unistd.h values.h)
+AC_HAVE_HEADERS(assert.h sys/stat.h)
+AC_HEADER_STAT
+
+AC_FUNC_MEMCMP
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS(memmem snprintf vsnprintf gettext isinf)
+
+
 ## Optional tools for building documentation, website, extra fonts.
 
 # guile executable for some scripts
@@ -52,10 +62,6 @@ if test "$optimise_b" = yes; then
 fi
 
 
-AC_FUNC_MEMCMP
-AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(memmem snprintf vsnprintf gettext isinf)
-
 AC_DEFINE_UNQUOTED(TOPLEVEL_VERSION, "${FULL_VERSION}")
 AC_DEFINE_UNQUOTED(FLOWER_VERSION, "${FULL_FLOWER_VERSION}")
 
diff -purN ../lilypond-1.5.56/flower/include/dictionary.hh ./flower/include/dictionary.hh
--- ../lilypond-1.5.56/flower/include/dictionary.hh	Mon Apr 16 23:17:45 2001
+++ ./flower/include/dictionary.hh	Sun May 19 02:11:57 2002
@@ -30,7 +30,7 @@ struct Dict_initialiser
 /*
   interface to STL function.
  */
-#include "cons.hh"
+
 template <class V>
 class Dictionary : public std::map<String, V> //map<String, V>
 {
diff -purN ../lilypond-1.5.56/flower/include/pointer.hh ./flower/include/pointer.hh
--- ../lilypond-1.5.56/flower/include/pointer.hh	Sun Mar 11 19:10:32 2001
+++ ./flower/include/pointer.hh	Thu Jan  1 01:00:00 1970
@@ -1,76 +0,0 @@
-/*
-  pointer.hh -- declare P
-
-  source file of the Flower Library
-
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef POINTER_HH
-#define POINTER_HH
-
-#error
-
-/** P<T> is a handy template to use iso T*. It inits to 0, deletes on
-  destruction, deep copies upon copying
-
-  It is probably not feasible to use P<T> as template argument, since
-  a lot of auto conversion wouldn't work. new T would be called too
-  much anyway.
-  
-  Sorry for the silly naming */
-template <class T>
-class P {
-  /**
-     Set contents to a copy of #t_l#
-  */
-  void copy (T const*t_l);
-  T* t_p;
-
-    /**
-      junk contents and set to 0
-     */
-  void junk ();
-public:
-    
-  P (P const &src);
-  /**
-      Remove  the pointer, and return it.
-     */
-    
-  T *get_p () { T*p = t_p; t_p=0; return p; }
-  /**
-      return the pointer
-     */
-  T *get_l ()  { return t_p; }
-
-  T const *get_C () const { return t_p; }
-  /**
-      copy the contents of pointer, and return it
-     */
-  T *copy_p () const;
-  /**
-      swallow new_p, and set contents t new_p
-     */
-  void set_p (T *new_p); 
-  /**
-      junk contents, and  copy contents of t_l
-     */
-  void set_l (T const *t_C); 
-    
-  P &operator = (P const &);
-  ~P ();
-  P () { t_p = 0; }
-  //P (T *p) { t_p = p; }
-    
-  T *operator -> () { return t_p; }
-  operator T * () {  return t_p; }
-  const T *operator -> () const { return t_p ; }
-  T &operator * () { return *t_p; }
-  T const  &operator * () const { return *t_p; }
-  operator const T * () const { return t_p; }
-};
-#endif // POINTER_HH
-
-    
diff -purN ../lilypond-1.5.56/flower/include/pointer.tcc ./flower/include/pointer.tcc
--- ../lilypond-1.5.56/flower/include/pointer.tcc	Sun Mar 11 19:10:32 2001
+++ ./flower/include/pointer.tcc	Thu Jan  1 01:00:00 1970
@@ -1,88 +0,0 @@
-/*
-  pointer.tcc -- implement P
-
-  source file of the Flower Library
-
-  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-
-#ifndef POINTER_TCC
-#define POINTER_TCC
-
-template<class T>
-inline
-T *
-P<T>::copy_p () const
-{
-  return t_p? new T (*t_p) : 0;
-}
-
-template<class T>
-inline
-void
-P<T>::copy (T const *l_C)
-{
-  t_p = l_C ? new T (*l_C) : 0;
-}
-
-template<class T>
-inline
-void
-P<T>::junk ()
-{
-  delete t_p;
-  t_p =0;
-}
-
-template<class T>
-inline
-P<T>::P (P<T> const &s) 
-{
-  t_p = s.copy_p ();
-}
-
-template<class T>
-inline
-P<T> &
-P<T>::operator = (P const&s)
-{
-  junk ();
-  copy (s.t_p);
-  return *this;
-}
-
-template<class T>
-inline
-P<T>::~P () {
-  junk ();
-}
-
-template<class T>
-inline
-void
-P<T>::set_p (T * np) 
-{
-  if (np == t_p)
-    return;
-  delete t_p;
-  
-  t_p = np;
-}
-
-
-template<class T>
-inline
-void
-P<T>::set_l (T const * l_C) 
-{
-  if (t_p == l_C)
-    return;
-  
-  junk ();
-  copy (l_C);
-}
-
-
-
-#endif // POINTER_TCC
diff -purN ../lilypond-1.5.56/flower/include/string.hh ./flower/include/string.hh
--- ../lilypond-1.5.56/flower/include/string.hh	Fri May 17 00:38:02 2002
+++ ./flower/include/string.hh	Sun May 19 02:11:57 2002
@@ -53,7 +53,7 @@ class ostream;
 
 \item
   No operator[] is provided, since this would be enormously  slow. If needed,
-k  convert to char const* .
+  convert to char const* .
 \end{itemize}
 
 */
diff -purN ../lilypond-1.5.56/flower/include/tuple.hh ./flower/include/tuple.hh
--- ../lilypond-1.5.56/flower/include/tuple.hh	Thu May 11 23:34:15 2000
+++ ./flower/include/tuple.hh	Thu Jan  1 01:00:00 1970
@@ -1,34 +0,0 @@
-/*   
-  tuple.hh -- declare Tuple
-  
-  source file of the GNU LilyPond music typesetter
-  
-  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
-
-#ifndef TUPLET_HH
-#define TUPLET_HH
-#error
-
-
-template<class T, class U>
-struct Tuple
-{
-  T e1_;
-  U e2_;
-
-  Tuple (T t, U u)
-    {
-      e1_ = t;
-      e2_ = u;
-    }
-  Tuple ()
-    {
-    }
-};
-
-
-
-#endif /* TUPLET_HH */
-
diff -purN ../lilypond-1.5.56/input/bugs/tremolo.ly ./input/bugs/tremolo.ly
--- ../lilypond-1.5.56/input/bugs/tremolo.ly	Thu Jan  1 01:00:00 1970
+++ ./input/bugs/tremolo.ly	Sun May 19 02:06:27 2002
@@ -0,0 +1,12 @@
+
+
+%{
+
+Hi,
+
+In the following example, the tremolo beams are too 
+close to the long beam.
+
+%}
+
+\score{\notes\relative c'{ c8:32 d:32 e:32 f:32 }}
diff -purN ../lilypond-1.5.56/input/test/mensural-ligatures.ly ./input/test/mensural-ligatures.ly
--- ../lilypond-1.5.56/input/test/mensural-ligatures.ly	Thu Jan  1 01:00:00 1970
+++ ./input/test/mensural-ligatures.ly	Sun May 19 02:06:24 2002
@@ -0,0 +1,78 @@
+\version "1.3.146"
+\header {
+    title	= "mensural ligature test"
+    date	= "2002"
+}
+
+\include "paper26.ly"
+
+% Note the horizontal alignment of the fermatas that obeys to the
+% graphical width of the ligatures rather to the musical moment in time.
+% This is intended behaviour.
+
+voice = \notes \transpose c'' {
+  \property Score.timing = ##f
+  \property Score.defaultBarType = "empty"
+  \property Voice.NoteHead \set #'font-family = #'ancient
+  \property Voice.NoteHead \override #'style = #'mensural
+  g\longa c\breve a\breve f\breve d'\longa^\fermata
+  \bar "|"
+  \[
+    g\longa c\breve a\breve f\breve d'\longa^\fermata
+  \]
+  \bar "|"
+  e1 f1 a\breve g\longa^\fermata
+  \bar "|"
+  \[
+    e1 f1 a\breve g\longa^\fermata
+  \]
+  \bar "|"
+  e1 f1 a\breve g\longa^\fermata
+  \bar "||"
+}
+
+upperStaff = \context Staff = upperStaff <
+  \context MensuralVoice <
+    \voice
+  >
+>
+
+lowerStaff = \context Staff = lowerStaff <
+  \context TranscribedVoice <
+    \voice
+  >
+>
+
+\score {
+    \context ChoirStaff <
+	\upperStaff
+	\lowerStaff
+    >
+    \paper {
+	stafflinethickness = \staffspace / 5.0
+	\translator {
+	    \VoiceContext
+	    \name MensuralVoice
+	    \alias Voice
+	    \remove Ligature_bracket_engraver
+	    \consists Mensural_ligature_engraver
+	}
+	\translator {
+	    \VoiceContext
+	    \name TranscribedVoice
+	    \alias Voice
+	    \remove Mensural_ligature_engraver
+	    \consists Ligature_bracket_engraver
+	}
+	\translator {
+	    \StaffContext
+	    \accepts MensuralVoice
+	    \accepts TranscribedVoice
+        }
+	\translator {
+	    \HaraKiriStaffContext
+	    \accepts MensuralVoice
+	    \accepts TranscribedVoice
+        }
+    }
+}
diff -purN ../lilypond-1.5.56/input/tutorial/miniatures.ly ./input/tutorial/miniatures.ly
--- ../lilypond-1.5.56/input/tutorial/miniatures.ly	Sun May  6 03:10:09 2001
+++ ./input/tutorial/miniatures.ly	Fri May 17 01:07:23 2002
@@ -1,4 +1,4 @@
-\version "1.3.138"
+\version "1.5.49"
 \header {
   title = "Two miniatures"
   tagline = "Small is beatiful"
diff -purN ../lilypond-1.5.56/input/tutorial/os-score.ly ./input/tutorial/os-score.ly
--- ../lilypond-1.5.56/input/tutorial/os-score.ly	Mon Apr 16 23:42:19 2001
+++ ./input/tutorial/os-score.ly	Fri May 17 01:07:23 2002
@@ -1,5 +1,5 @@
 
-\version "1.3.138"
+\version "1.5.49"
 
 \include "os-music.ly"
 \include "paper13.ly"
diff -purN ../lilypond-1.5.56/lily/beam.cc ./lily/beam.cc
--- ../lilypond-1.5.56/lily/beam.cc	Wed May 15 11:00:18 2002
+++ ./lily/beam.cc	Sun May 19 02:12:03 2002
@@ -428,7 +428,7 @@ Beam::quanting (SCM smob)
 
   */
 
-  const int REGION_SIZE = 3;
+  const int REGION_SIZE = 2;
   for (int i  = -REGION_SIZE ; i < REGION_SIZE; i++)
     for (int j = 0; j < num_quants; j++)
       {
@@ -492,6 +492,9 @@ Beam::quanting (SCM smob)
   Array<Real> rbase_lengths;  
 
   Array<int> directions;
+  
+  Drul_array<bool> dirs_found(0,0);
+
   for (int i= 0; i < stems.size(); i++)
     {
       Grob*s = stems[i];
@@ -502,16 +505,20 @@ Beam::quanting (SCM smob)
 
       b = calc_stem_y (me, s, Interval (0,1));
       rbase_lengths.push (b);
-      directions.push( Directional_element_interface::get( s));
+
+      Direction d = Directional_element_interface::get( s);
+      directions.push( d);
+      dirs_found [d] = true;
     }
 
+  bool knee_b = dirs_found[LEFT] && dirs_found[RIGHT];
   for (int i = qscores.size (); i--;)
     if (qscores[i].demerits < 100)
       {
 	qscores[i].demerits
 	  += score_stem_lengths (stems, stem_infos,
 				 lbase_lengths, rbase_lengths,
-				 directions,
+				 directions, knee_b,
 				 me, qscores[i].yl, qscores[i].yr);
       }
 
@@ -550,6 +557,7 @@ Beam::score_stem_lengths (Link_array<Gro
 			  Array<Real> left_factor,
 			  Array<Real> right_factor,
 			  Array<int> directions,
+			  bool knee, 
 			  Grob*me, Real yl, Real yr)
 {
   Real demerit_score = 0.0 ;
@@ -565,9 +573,13 @@ Beam::score_stem_lengths (Link_array<Gro
 
       Stem_info info = stem_infos[i];
       Direction d = Direction (directions[i]);
+
+      Real pen = STEM_LENGTH_LIMIT_PENALTY;
+      if (knee)
+	pen = sqrt(pen);
       
-      demerit_score += STEM_LENGTH_LIMIT_PENALTY * ( 0 >? (info.min_y - d * current_y));
-      demerit_score += STEM_LENGTH_LIMIT_PENALTY * ( 0 >? (d * current_y  - info.max_y));
+      demerit_score += pen * ( 0 >? (info.min_y - d * current_y));
+      demerit_score += pen * ( 0 >? (d * current_y  - info.max_y));
 
       demerit_score += STEM_LENGTH_DEMERIT_FACTOR * shrink_extra_weight (d * current_y  - info.ideal_y);
     }
diff -purN ../lilypond-1.5.56/lily/chord.cc ./lily/chord.cc
--- ../lilypond-1.5.56/lily/chord.cc	Sat Mar  2 02:32:50 2002
+++ ./lily/chord.cc	Sun May 19 02:12:03 2002
@@ -23,8 +23,8 @@ Chord::base_pitches (SCM tonic)
   SCM minor = Pitch (0, 2, -1).smobbed_copy ();
 
   base = gh_cons (tonic, base);
-  base = gh_cons (pitch_transpose (ly_car (base), major), base);
-  base = gh_cons (pitch_transpose (ly_car (base), minor), base);
+  base = gh_cons (ly_pitch_transpose (ly_car (base), major), base);
+  base = gh_cons (ly_pitch_transpose (ly_car (base), minor), base);
 
   return scm_reverse_x (base, SCM_EOL);
 }
@@ -38,7 +38,7 @@ Chord::transpose_pitches (SCM tonic, SCM
   SCM transposed = SCM_EOL;
   for (SCM i = pitches; gh_pair_p (i); i = ly_cdr (i))
     {
-      transposed = gh_cons (pitch_transpose (tonic, ly_car (i)),
+      transposed = gh_cons (ly_pitch_transpose (tonic, ly_car (i)),
 			    transposed);
     }
   return scm_reverse_x (transposed, SCM_EOL);
@@ -60,7 +60,7 @@ Chord::lower_step (SCM tonic, SCM pitche
       if (gh_equal_p (step_scm (tonic, ly_car (i)), step)
 	  || gh_scm2int (step) == 0)
 	{
-	  p = pitch_transpose (p, Pitch (0, 0, -1).smobbed_copy ());
+	  p = ly_pitch_transpose (p, Pitch (0, 0, -1).smobbed_copy ());
 	}
       lowered = gh_cons (p, lowered);
     }
@@ -169,7 +169,7 @@ Chord::missing_thirds (SCM pitches)
 	{
 	  int third = (unsmob_pitch (last)->notename_i_
 		       - unsmob_pitch (tonic)-> notename_i_ + 7) % 7;
-	  last = pitch_transpose (last, scm_vector_ref (thirds, gh_int2scm (third)));
+	  last = ly_pitch_transpose (last, scm_vector_ref (thirds, gh_int2scm (third)));
 	}
       
       if (step > gh_scm2int (step_scm (tonic, last)))
@@ -179,7 +179,7 @@ Chord::missing_thirds (SCM pitches)
 	      missing = gh_cons (last, missing);
 	      int third = (unsmob_pitch (last)->notename_i_
 			   - unsmob_pitch (tonic)->notename_i_ + 7) % 7;
-	      last = pitch_transpose (last, scm_vector_ref (thirds,
+	      last = ly_pitch_transpose (last, scm_vector_ref (thirds,
 						      gh_int2scm (third)));
 	    }
 	}
@@ -199,7 +199,7 @@ Chord::add_above_tonic (SCM pitch, SCM p
   /* Should we maybe first make sure that PITCH is below tonic? */
   if (pitches != SCM_EOL)
     while (Pitch::less_p (pitch, ly_car (pitches)) == SCM_BOOL_T)
-      pitch = pitch_transpose (pitch, Pitch (1, 0, 0).smobbed_copy ());
+      pitch = ly_pitch_transpose (pitch, Pitch (1, 0, 0).smobbed_copy ());
    
   pitches = gh_cons (pitch, pitches);
   return scm_sort_list (pitches, Pitch::less_p_proc);
@@ -211,7 +211,7 @@ Chord::add_below_tonic (SCM pitch, SCM p
 {
   if (pitches != SCM_EOL)
     while (Pitch::less_p (ly_car (pitches), pitch) == SCM_BOOL_T)
-      pitch = Pitch::transpose (pitch, Pitch (-1, 0, 0).smobbed_copy ());
+      pitch = ly_pitch_transpose (pitch, Pitch (-1, 0, 0).smobbed_copy ());
   return gh_cons (pitch, pitches);
 }
 
@@ -284,7 +284,7 @@ Chord::tonic_add_sub_to_pitches (SCM ton
 
   /* if additions include any 4, assume sus4 and don't add third implicitely
      C-sus (4) = c f g (1 4 5) */
-  SCM sus = Pitch::transpose (tonic, Pitch (0, 3, 0).smobbed_copy ());
+  SCM sus = ly_pitch_transpose (tonic, Pitch (0, 3, 0).smobbed_copy ());
   if (member_notename (sus, add) != SCM_BOOL_F)
     missing = scm_delete (third, missing);
   
diff -purN ../lilypond-1.5.56/lily/cxx-function-smob.cc ./lily/cxx-function-smob.cc
--- ../lilypond-1.5.56/lily/cxx-function-smob.cc	Fri Feb  1 19:16:15 2002
+++ ./lily/cxx-function-smob.cc	Sun May 19 02:12:04 2002
@@ -31,9 +31,8 @@ free_smob (SCM)
   return 0;
 }
 
-
-SCM
-cxx_function_type_p (SCM x)
+LY_DEFINE(cxx_function_type_p, "c++-function?", 1, 0, 0, (SCM x),
+	  "Is this an encapsulated C++ function ?")
 {
   return (SCM_CELL_TYPE (x)) == callback_tag ? SCM_BOOL_T : SCM_BOOL_F; 
 }
@@ -45,9 +44,6 @@ void init_cxx_function_smobs ()
   scm_set_smob_free (callback_tag, free_smob);
   scm_set_smob_print (callback_tag, print_smob);
   scm_set_smob_equalp (callback_tag, 0);
-
-  scm_c_define_gsubr ("c++-function?", 1, 0, 0,
-		      (Scheme_function_unknown) cxx_function_type_p);
 }
 
 SCM
diff -purN ../lilypond-1.5.56/lily/duration.cc ./lily/duration.cc
--- ../lilypond-1.5.56/lily/duration.cc	Fri Mar  1 01:41:05 2002
+++ ./lily/duration.cc	Sun May 19 02:12:04 2002
@@ -128,25 +128,29 @@ Duration::less_p (SCM p1, SCM p2)
     return SCM_BOOL_F;
 }
 
-static SCM
-make_duration (SCM l, SCM d)
+
+LY_DEFINE(make_duration,
+	  "make-duration", 2, 0, 0, (SCM length, SCM dotcount),
+	  "
+@var{length} is the negative logarithm (base 2) of the duration:
+1 is a half note, 2 is a quarter note, 3 is an eighth
+note, etc.  The number of dots after the note is given by
+@var{dotcount}.
+
+
+A duration is a musical duration, i.e. a length of time described by a
+power of two (whole, half, quarter, etc.) and a number of augmentation
+dots. 
+
+")
 {
-  SCM_ASSERT_TYPE(gh_number_p(l), l, SCM_ARG1, __FUNCTION__, "integer");
-  SCM_ASSERT_TYPE(gh_number_p(d), d, SCM_ARG2, __FUNCTION__, "integer");
+  SCM_ASSERT_TYPE(gh_number_p(length), length, SCM_ARG1, __FUNCTION__, "integer");
+  SCM_ASSERT_TYPE(gh_number_p(dotcount), dotcount, SCM_ARG2, __FUNCTION__, "integer");
   
-  Duration p (gh_scm2int (l), gh_scm2int (d));
+  Duration p (gh_scm2int (length), gh_scm2int (dotcount));
   return p.smobbed_copy ();
 }
 
-static void
-add_funcs ()
-{
-  scm_c_define_gsubr ("make-duration", 2, 0, 0,
-		      (Scheme_function_unknown)make_duration);
-}
-
-ADD_SCM_INIT_FUNC (duration, add_funcs);
-
 SCM
 Duration::smobbed_copy ()const
 {
diff -purN ../lilypond-1.5.56/lily/font-interface.cc ./lily/font-interface.cc
--- ../lilypond-1.5.56/lily/font-interface.cc	Sun Mar 24 21:46:53 2002
+++ ./lily/font-interface.cc	Sun May 19 02:12:04 2002
@@ -65,8 +65,9 @@ Font_interface::get_default_font (Grob*m
 }
 
 
-SCM
-ly_font_interface_get_default_font (SCM grob)
+LY_DEFINE(ly_font_interface_get_default_font,
+	  "ly-get-default-font", 1 , 0, 0,
+	  (SCM grob), "Return the default font for grob @var{gr}.")
 {
   Grob * gr  = unsmob_grob (grob);
   SCM_ASSERT_TYPE(gr, grob, SCM_ARG1, __FUNCTION__, "grob");
@@ -74,8 +75,21 @@ ly_font_interface_get_default_font (SCM 
   return Font_interface::get_default_font (gr)->self_scm ();
 }
 
-SCM
-ly_font_interface_get_font (SCM grob, SCM alist)
+LY_DEFINE(ly_font_interface_get_font,"ly-get-font", 2, 0, 0,
+	  (SCM grob, SCM alist),
+	  "Return a font metric satisfying the font-qualifiers in @var{alist}.
+
+
+The font object represents the metric information of a font. Every font
+that is loaded into LilyPond can be accessed via Scheme. 
+
+LilyPond only needs to know the dimension of glyph to be able to process
+them. This information is stored in font metric files. LilyPond can read
+two types of font-metrics: @TeX{} Font Metric files (TFM files) and
+Adobe Font Metric files (AFM files).  LilyPond will always try to load
+AFM files first since they are more versatile.
+
+")
 {
   Grob * gr  = unsmob_grob (grob);
   SCM_ASSERT_TYPE(gr, grob, SCM_ARG1, __FUNCTION__, "grob");
@@ -162,13 +176,9 @@ init_syms ()
   rel_sz_sym = scm_permanent_object (ly_symbol2scm ("font-relative-size"));
   design_sz_sym = scm_permanent_object (ly_symbol2scm ("font-design-size"));
   wild_sym = scm_permanent_object (ly_symbol2scm ("*"));
-
-  scm_c_define_gsubr ("ly-get-default-font", 1 , 0, 0,
-		      (Scheme_function_unknown) ly_font_interface_get_default_font);
-  scm_c_define_gsubr ("ly-get-font", 2, 0, 0,
-		      (Scheme_function_unknown) ly_font_interface_get_font);
 }
 
+ADD_SCM_INIT_FUNC(fi_init_syms, init_syms);
 
 bool
 Font_interface::wild_compare (SCM field_val, SCM val)
@@ -176,8 +186,6 @@ Font_interface::wild_compare (SCM field_
   return (val == SCM_BOOL_F || field_val == wild_sym || field_val == val);
 }
 
-ADD_SCM_INIT_FUNC (Font_interface_syms,init_syms);
-
 
 MAKE_SCHEME_CALLBACK (Font_interface,properties_to_font_name,2);
 SCM
diff -purN ../lilypond-1.5.56/lily/font-metric.cc ./lily/font-metric.cc
--- ../lilypond-1.5.56/lily/font-metric.cc	Fri Mar  1 01:41:05 2002
+++ ./lily/font-metric.cc	Sun May 19 02:12:04 2002
@@ -134,8 +134,10 @@ Font_metric::find_by_name (String) const
 }
 
 
-SCM
-ly_find_glyph_by_name (SCM font, SCM name)
+LY_DEFINE(ly_find_glyph_by_name, "ly-find-glyph-by-name", 2 , 0, 0,
+	  (SCM font, SCM name),
+	  "This function retrieves a Molecule for the glyph named @var{name} in
+@var{font}.  The font must be available as an AFM file.")
 {
   Font_metric *fm = unsmob_metrics (font);
   SCM_ASSERT_TYPE(fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
@@ -145,8 +147,11 @@ ly_find_glyph_by_name (SCM font, SCM nam
 }
 
 
-SCM
-ly_text_dimension (SCM font, SCM text)
+LY_DEFINE(ly_text_dimension,"ly-text-dimension", 2 , 0, 0,
+	  (SCM font, SCM text),
+	  "Given the font metric in @var{font} and the string @var{text}, compute
+the extents of that text in that font. The return value is a pair of
+number-pairs.")
 {
   Box b;
   Font_metric *fm = unsmob_metrics (font);
@@ -159,13 +164,3 @@ ly_text_dimension (SCM font, SCM text)
 }
 
 
-static void
-font_metric_init ()
-{
-   scm_c_define_gsubr ("ly-find-glyph-by-name", 2 , 0, 0,
-		       (Scheme_function_unknown) ly_find_glyph_by_name);
-   scm_c_define_gsubr ("ly-text-dimension", 2 , 0, 0,
-		       (Scheme_function_unknown) ly_text_dimension);
-}
-
-ADD_SCM_INIT_FUNC (font_metric_init, font_metric_init);
diff -purN ../lilypond-1.5.56/lily/function-documentation.cc ./lily/function-documentation.cc
--- ../lilypond-1.5.56/lily/function-documentation.cc	Thu Jan  1 01:00:00 1970
+++ ./lily/function-documentation.cc	Sun May 19 02:06:24 2002
@@ -0,0 +1,24 @@
+#include "lily-guile.hh"
+#include "protected-scm.hh"
+
+static Protected_scm doc_hash_table ;
+
+void ly_add_function_documentation (char const * fname,
+				    char const * varlist,
+				    char const * doc)
+{
+  if (!gh_vector_p (doc_hash_table ))
+    doc_hash_table = scm_make_vector (gh_int2scm (59), SCM_EOL);
+
+
+  SCM entry = gh_cons (ly_str02scm (varlist), ly_str02scm (doc));
+  scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname), entry);
+}
+
+
+LY_DEFINE(ly_get_all_function_documentation, "ly-get-all-function-documentation",
+	  0,0,0, (),
+	  "Get a hash table with all lilypond Scheme extension functions.")
+{
+  return doc_hash_table;
+}
diff -purN ../lilypond-1.5.56/lily/grob-interface.cc ./lily/grob-interface.cc
--- ../lilypond-1.5.56/lily/grob-interface.cc	Sun May  5 15:44:49 2002
+++ ./lily/grob-interface.cc	Sun May 19 02:12:04 2002
@@ -18,8 +18,9 @@ void add_interface (const char * symbol,
   ly_add_interface(s,d,l);
 }
 
-SCM
-ly_add_interface (SCM a, SCM b, SCM c)
+
+LY_DEFINE(ly_add_interface, "ly-add-interface", 3,0,0, (SCM a, SCM b, SCM c),
+	  "Add an interface description.")
 {
   SCM_ASSERT_TYPE (gh_symbol_p(a), a, SCM_ARG1, __FUNCTION__, "symbol");
   SCM_ASSERT_TYPE (gh_string_p(b), b, SCM_ARG2, __FUNCTION__, "string");  
@@ -38,24 +39,14 @@ ly_add_interface (SCM a, SCM b, SCM c)
 }
 
 
-SCM
-ly_all_grob_interfaces ()
+LY_DEFINE(ly_all_grob_interfaces, "ly-all-grob-interfaces",
+	  0,0,0, (),
+	  "Get a hash table with all interface descriptions.")
 {
   return all_ifaces;
 }
 
 void
-init_iface_funcs ()
-{
-  scm_c_define_gsubr ("ly-add-interface", 3, 0, 0,
-		      (Scheme_function_unknown)ly_add_interface);
-  scm_c_define_gsubr ("ly-all-grob-interfaces", 0, 0, 0,
-		      (Scheme_function_unknown)ly_all_grob_interfaces);
-}
-
-ADD_SCM_INIT_FUNC(giface, init_iface_funcs);
-
-void
 check_interfaces_for_property (Grob const *me, SCM sym)
 {
   if (sym == ly_symbol2scm ("meta"))
diff -purN ../lilypond-1.5.56/lily/grob.cc ./lily/grob.cc
--- ../lilypond-1.5.56/lily/grob.cc	Sun Apr 21 15:52:03 2002
+++ ./lily/grob.cc	Sun May 19 02:12:04 2002
@@ -490,7 +490,7 @@ Grob::handle_broken_dependencies ()
 	dependencies, so let's junk the element itself.
 
 	do not do this for System, since that would remove
-	references to the originals of score-elts, which get then GC'd
+	references to the originals of score-grobs, which get then GC'd
  (a bad thing.)
       */
       suicide ();
@@ -851,12 +851,13 @@ Grob::do_derived_mark ()
   return SCM_EOL;
 }
 
-
-SCM
-ly_set_grob_property (SCM elt, SCM sym, SCM val)
+LY_DEFINE(ly_set_grob_property,"ly-set-grob-property", 3, 0, 0,
+(SCM grob, SCM sym, SCM val),
+"
+Set @var{sym} in grob @var{grob} to value @var{val}")
 {
-  Grob * sc = unsmob_grob (elt);
-  SCM_ASSERT_TYPE(sc, elt, SCM_ARG1, __FUNCTION__, "grob");
+  Grob * sc = unsmob_grob (grob);
+  SCM_ASSERT_TYPE(sc, grob, SCM_ARG1, __FUNCTION__, "grob");
   SCM_ASSERT_TYPE(gh_symbol_p(sym), sym, SCM_ARG2, __FUNCTION__, "symbol");  
 
   if (!type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")))
@@ -866,12 +867,14 @@ ly_set_grob_property (SCM elt, SCM sym, 
   return SCM_UNSPECIFIED;
 }
 
-
-SCM
-ly_get_grob_property (SCM elt, SCM sym)
+LY_DEFINE(ly_get_grob_property,
+	  "ly-get-grob-property", 2, 0, 0, (SCM grob, SCM sym),
+	  "  Get the value of a value in grob @var{g} of property @var{sym}. It
+will return @code{'()} (end-of-list) if @var{g} doesn't have @var{sym} set.
+")
 {
-  Grob * sc = unsmob_grob (elt);
-  SCM_ASSERT_TYPE(sc, elt, SCM_ARG1, __FUNCTION__, "grob");
+  Grob * sc = unsmob_grob (grob);
+  SCM_ASSERT_TYPE(sc, grob, SCM_ARG1, __FUNCTION__, "grob");
   SCM_ASSERT_TYPE(gh_symbol_p(sym), sym, SCM_ARG2, __FUNCTION__, "symbol");  
 
   return sc->internal_get_grob_property (sym);
@@ -884,9 +887,11 @@ Grob::discretionary_processing ()
 }
 
 
-
-SCM
-spanner_get_bound (SCM slur, SCM dir)
+LY_DEFINE(spanner_get_bound, "ly-get-spanner-bound", 2 , 0, 0,
+	  (SCM slur, SCM dir),
+	  "Get one of the bounds of @var{spanner}. @var{dir} may be @code{-1} for
+left, and @code{1} for right.
+")
 {
   Spanner * sl = dynamic_cast<Spanner*> (unsmob_grob (slur));
   SCM_ASSERT_TYPE(sl, slur, SCM_ARG1, __FUNCTION__, "spanner grob");
@@ -894,8 +899,9 @@ spanner_get_bound (SCM slur, SCM dir)
   return sl->get_bound (to_dir (dir))->self_scm ();
 }
 
-SCM
-ly_get_paper_var (SCM grob, SCM sym)
+LY_DEFINE(ly_get_paper_var,"ly-get-paper-variable", 2, 0, 0,
+  (SCM grob, SCM sym),
+  "Get a variable from the \\paper block.")
 {
   Grob * sc = unsmob_grob (grob);
   SCM_ASSERT_TYPE(sc, grob, SCM_ARG1, __FUNCTION__, "grob");
@@ -906,8 +912,10 @@ ly_get_paper_var (SCM grob, SCM sym)
 
 
 
-SCM
-ly_get_extent (SCM grob, SCM refp, SCM axis)
+LY_DEFINE(ly_get_extent, "ly-get-extent", 3, 0, 0,
+	  (SCM grob, SCM refp, SCM axis),
+	  "Get the extent in @var{axis} direction of @var{grob} relative to the
+grob @var{refp}")
 {
   Grob * sc = unsmob_grob (grob);
   Grob * ref = unsmob_grob (refp);
@@ -919,8 +927,9 @@ ly_get_extent (SCM grob, SCM refp, SCM a
   return ly_interval2scm ( sc->extent (ref, Axis (gh_scm2int (axis))));
 }
 
-SCM
-ly_get_parent (SCM grob, SCM axis)
+LY_DEFINE (ly_get_parent,   "ly-get-parent", 2, 0, 0, (SCM grob, SCM axis),
+	   "Get the parent of @var{grob}.  @var{axis} can be 0 for the X-axis, 1
+for the Y-axis.")
 {
   Grob * sc = unsmob_grob (grob);
   SCM_ASSERT_TYPE(sc, grob, SCM_ARG1, __FUNCTION__, "grob");
@@ -930,23 +939,6 @@ ly_get_parent (SCM grob, SCM axis)
 }
 
 
-static void
-init_functions ()
-{
-  scm_c_define_gsubr ("ly-get-grob-property", 2, 0, 0,
-		      (Scheme_function_unknown)ly_get_grob_property);
-  scm_c_define_gsubr ("ly-set-grob-property", 3, 0, 0,
-		      (Scheme_function_unknown)ly_set_grob_property);
-  scm_c_define_gsubr ("ly-get-spanner-bound", 2 , 0, 0,
-		      (Scheme_function_unknown) spanner_get_bound);
-  scm_c_define_gsubr ("ly-get-paper-variable", 2, 0, 0,
-		      (Scheme_function_unknown) ly_get_paper_var);
-  scm_c_define_gsubr ("ly-get-extent", 3, 0, 0,
-		      (Scheme_function_unknown) ly_get_extent);
-  scm_c_define_gsubr ("ly-get-parent", 2, 0, 0,
-		      (Scheme_function_unknown) ly_get_parent);
-}
-
 bool
 Grob::internal_has_interface (SCM k)
 {
@@ -955,8 +947,6 @@ Grob::internal_has_interface (SCM k)
   return scm_memq (k, ifs) != SCM_BOOL_F;
 }
 
-
-ADD_SCM_INIT_FUNC (scoreelt, init_functions);
 IMPLEMENT_TYPE_P (Grob, "ly-grob?");
 
 ADD_INTERFACE (Grob, "grob-interface",
diff -purN ../lilypond-1.5.56/lily/include/beam.hh ./lily/include/beam.hh
--- ../lilypond-1.5.56/lily/include/beam.hh	Wed Apr 24 15:51:57 2002
+++ ./lily/include/beam.hh	Sun May 19 02:12:08 2002
@@ -40,7 +40,7 @@ public:
   static Real score_stem_lengths (Link_array<Grob>,
 				  Array<Stem_info>,
 				  Array<Real>, Array<Real>, Array<int>,
-				  Grob*,Real , Real);
+				  bool,Grob*,Real , Real);
   static Real score_forbidden_quants (Grob*, Real, Real,
 				      Real, Real, Real, Real,
 				      int);
diff -purN ../lilypond-1.5.56/lily/include/ligature-bracket.hh ./lily/include/ligature-bracket.hh
--- ../lilypond-1.5.56/lily/include/ligature-bracket.hh	Wed Apr 17 18:06:52 2002
+++ ./lily/include/ligature-bracket.hh	Sun May 19 02:16:29 2002
@@ -12,14 +12,10 @@
 #include "lily-proto.hh"
 #include "lily-guile.hh"
 
-class Ligature_bracket
+struct Ligature_bracket
 {
-public:
-  Ligature_bracket (SCM);
   DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
   static bool has_interface (Grob*);
-
-private:
 };
 
 #endif /* LIGATURE_BRACKET_HH */
diff -purN ../lilypond-1.5.56/lily/include/ligature-engraver.hh ./lily/include/ligature-engraver.hh
--- ../lilypond-1.5.56/lily/include/ligature-engraver.hh	Thu Jan  1 01:00:00 1970
+++ ./lily/include/ligature-engraver.hh	Sun May 19 02:14:05 2002
@@ -0,0 +1,46 @@
+/*   
+  ligature-engraver.hh -- declare Ligature_engraver
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2002 Juergen Reuter <reuter@ipd.uka.de>
+  
+ */
+#ifndef LIGATUREENGRAVER_HH
+#define LIGATUREEENGRAVER_HH
+
+#include "engraver.hh"
+
+class Ligature_engraver : public Engraver
+{
+protected:
+  virtual void stop_translation_timestep ();
+  virtual void start_translation_timestep ();
+  virtual void finalize ();
+
+  virtual void acknowledge_grob (Grob_info);
+  virtual bool try_music (Music*);
+  virtual void process_music ();
+  virtual void try_stop_ligature ();
+  virtual Spanner *create_ligature_spanner ();
+
+  Spanner *finished_ligature_p_;
+  Spanner *ligature_p_;
+  SCM brew_ligature_primitive_proc;
+
+public:
+  TRANSLATOR_DECLARATIONS(Ligature_engraver);
+
+private:
+  Drul_array<Span_req*> reqs_drul_;
+  
+  Span_req *prev_start_req_;
+
+  // moment where ligature started.
+  Moment ligature_start_mom_;
+
+  Grob *last_bound;
+
+};
+
+#endif // ENGRAVERGROUP_HH
diff -purN ../lilypond-1.5.56/lily/include/ligature-head.hh ./lily/include/ligature-head.hh
--- ../lilypond-1.5.56/lily/include/ligature-head.hh	Thu Jan  1 01:00:00 1970
+++ ./lily/include/ligature-head.hh	Sun May 19 02:06:24 2002
@@ -0,0 +1,28 @@
+/*
+  ligature-head.hh -- part of GNU LilyPond
+
+  (c) 2002 Juergen Reuter <reuter@ipd.uka.de>
+*/
+
+#ifndef LIGATURE_HEAD_HH
+#define LIGATURE_HEAD_HH
+
+#include "lily-guile.hh"
+#include "molecule.hh"
+
+/** ball within a ligature.  Also takes care of ledger lines.
+
+    LigatureHead is a kind of RhythmicHead, see there.
+
+  Read-only:
+*/
+
+class Ligature_head 
+{
+public:
+  DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
+  static bool has_interface (Grob*);
+  
+};
+#endif // LIGATURE_HEAD_HH
+
diff -purN ../lilypond-1.5.56/lily/include/lily-guile.hh ./lily/include/lily-guile.hh
--- ../lilypond-1.5.56/lily/include/lily-guile.hh	Sun May  5 21:46:37 2002
+++ ./lily/include/lily-guile.hh	Sun May 19 02:12:09 2002
@@ -244,6 +244,10 @@ TYPE ## _ ## FUNC ## _init_functions ()	
 ADD_SCM_INIT_FUNC (TYPE ## _ ## FUNC ## _callback, TYPE ## _ ## FUNC ## _init_functions);	\
 
 
+void ly_add_function_documentation (char const * fname,
+				    char const * varlist,
+				    char const * doc);
+
 #define ADD_SCM_INIT_FUNC(name, func)\
 class name ## _scm_initter {			\
 public:\
@@ -254,4 +258,20 @@ public:\
 } _ ## name ## _scm_initter;			\
 /* end define */
 
+#define LY_DEFINE(FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, DOCSTRING) \
+SCM FNAME ARGLIST ; \
+SCM FNAME ## _proc;\
+void \
+FNAME ## init ()\
+{\
+ FNAME ## _proc \
+    = scm_c_define_gsubr (PRIMNAME,REQ, OPT, VAR, (Scheme_function_unknown) FNAME);\
+  ly_add_function_documentation (PRIMNAME, #ARGLIST,  DOCSTRING);\
+}\
+ADD_SCM_INIT_FUNC (FNAME ## init_unique_prefix, FNAME ## init);\
+SCM \
+FNAME ARGLIST\
+
+
+
 #endif // LILY_GUILE_HH
diff -purN ../lilypond-1.5.56/lily/include/lily-proto.hh ./lily/include/lily-proto.hh
--- ../lilypond-1.5.56/lily/include/lily-proto.hh	Sat Mar 23 03:42:23 2002
+++ ./lily/include/lily-proto.hh	Sun May 19 02:16:29 2002
@@ -74,6 +74,8 @@ class Key_change_req;
 class Key_performer;
 class Keyword_ent;
 class Keyword_table;
+class Ligature_engraver;
+class Ligature_bracket_engraver;
 class Line_group_engraver_group;
 class System;
 class Local_key_item;
@@ -88,6 +90,7 @@ class Mark_req;
 class Melisma_playing_req;
 class Melisma_req;
 class Melodic_req;
+class Mensural_ligature_engraver;
 class Midi_chunk;
 class Midi_def;
 class Midi_duration;
diff -purN ../lilypond-1.5.56/lily/include/lookup.hh ./lily/include/lookup.hh
--- ../lilypond-1.5.56/lily/include/lookup.hh	Mon Apr  1 15:48:03 2002
+++ ./lily/include/lookup.hh	Sun May 19 02:12:09 2002
@@ -18,7 +18,7 @@
 
 struct Lookup
 {
-  static Molecule bracket (Axis a, Interval iv, Direction d, Real thick, Real protude);
+  static Molecule bracket (Axis a, Interval iv, Real thick, Real protude);
   static Molecule accordion (SCM arg, Real interline_f, Font_metric*fm);
   static Molecule frame (Box b, Real thick);
   static Molecule slur (Bezier controls, Real cthick, Real thick);
diff -purN ../lilypond-1.5.56/lily/include/ly-smobs.icc ./lily/include/ly-smobs.icc
--- ../lilypond-1.5.56/lily/include/ly-smobs.icc	Sun Oct 14 15:15:44 2001
+++ ./lily/include/ly-smobs.icc	Sun May 19 02:12:09 2002
@@ -17,6 +17,7 @@
 void init_type_p_ ## CL ()\
 {\
   scm_c_define_gsubr (FUNCNAME, 1, 0, 0, (Scheme_function_unknown) CL::smob_p);\
+  ly_add_function_documentation (FUNCNAME, "(SCM x)", "Check if @var{x} is a " #CL " object");\
 }\
 ADD_SCM_INIT_FUNC (init_type_p_ ## CL, init_type_p_ ## CL)
 
diff -purN ../lilypond-1.5.56/lily/include/mensural-ligature.hh ./lily/include/mensural-ligature.hh
--- ../lilypond-1.5.56/lily/include/mensural-ligature.hh	Thu Jan  1 01:00:00 1970
+++ ./lily/include/mensural-ligature.hh	Sun May 19 02:06:24 2002
@@ -0,0 +1,40 @@
+/*
+  mensural-ligature.hh -- part of GNU LilyPond
+
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2002 Juergen Reuter <reuter@ipd.uka.de>
+*/
+
+#ifndef MENSURAL_LIGATURE_HH
+#define MENSURAL_LIGATURE_HH
+
+#include "lily-proto.hh"
+#include "lily-guile.hh"
+
+/*
+ * These are all possible mensural ligature primitives.
+ */
+#define MLP_BB    0x01 // flexa with left downward cauda (for Brevis-Brevis)
+#define MLP_sc    0x02 // last head of asc. sine proprietate cum perfectione
+		       // (i.e. brevis head with downward right cauda)
+#define MLP_ss    0x04 // last head of asc. sine proprietate sine perfectione
+		       // (i.e. pure brevis head)
+#define MLP_cs    0x08 // last head of asc. cum proprietate sine perfectione
+		       // (i.e. brevis head with downward left cauda)
+#define MLP_SS    0x10 // flexa with left upward cauda (for Semibr.-Semibr.)
+#define MLP_LB    0x20 // core flexa (for Longa-Brevis)
+
+#define MLP_NONE  0x00 // no output
+#define MLP_SINGLE_HEAD	(MLP_sc | MLP_ss | MLP_cs)
+#define MLP_FLEXA	(MLP_BB | MLP_SS | MLP_LB)
+#define MLP_ANY		(MLP_FLEXA | MLP_SINGLE_HEAD)
+
+struct Mensural_ligature
+{
+  DECLARE_SCHEME_CALLBACK (brew_ligature_primitive, (SCM ));
+  DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
+  static bool has_interface (Grob*);
+};
+
+#endif /* MENSURAL_LIGATURE_HH */
diff -purN ../lilypond-1.5.56/lily/include/molecule.hh ./lily/include/molecule.hh
--- ../lilypond-1.5.56/lily/include/molecule.hh	Mon Feb 18 00:25:53 2002
+++ ./lily/include/molecule.hh	Sun May 19 02:12:09 2002
@@ -39,7 +39,10 @@
     init the molecule, we assume that
     DIMENSIONS = (Interval (0,0),Interval (0,0)
 */
-class Molecule {
+class Molecule
+{
+  friend SCM ly_set_molecule_extent_x (SCM, SCM, SCM);
+  
   Box dim_;
   SCM expr_;
   
diff -purN ../lilypond-1.5.56/lily/include/music-iterator.hh ./lily/include/music-iterator.hh
--- ../lilypond-1.5.56/lily/include/music-iterator.hh	Fri Feb  1 19:16:23 2002
+++ ./lily/include/music-iterator.hh	Sun May 19 02:12:09 2002
@@ -17,7 +17,16 @@
 #include "interpretation-context-handle.hh"
 #include "cxx-function-smob.hh"
 
-/** 
+/**
+   ---
+
+   Music_iterator is an object type that traverses the Music structure and
+   reports the events it finds to interpretation contexts. It is not yet
+   user-serviceable.
+
+
+   ---
+	
   Conceptually a music-iterator operates on a queue of musical events
   that are pending. This queue does not actually exist, but it is a
   way of viewing and traversing music-expressions.
diff -purN ../lilypond-1.5.56/lily/include/my-lily-parser.hh ./lily/include/my-lily-parser.hh
--- ../lilypond-1.5.56/lily/include/my-lily-parser.hh	Tue Apr 16 13:58:58 2002
+++ ./lily/include/my-lily-parser.hh	Sun May 19 02:16:29 2002
@@ -52,8 +52,6 @@ public:
   SCM last_beam_start_;
   void beam_check (SCM); 
 
-  SCM last_ligature_start_;
-
   Input here_input () const;
   void push_spot ();
   Input pop_spot ();
diff -purN ../lilypond-1.5.56/lily/include/pitch.hh ./lily/include/pitch.hh
--- ../lilypond-1.5.56/lily/include/pitch.hh	Sun Apr 21 01:02:56 2002
+++ ./lily/include/pitch.hh	Sun May 19 02:12:10 2002
@@ -62,7 +62,7 @@ public:
   /// return pitch from central c (in halfnotes)
   int semitone_pitch () const; 
   String str () const;
-  static SCM transpose (SCM,SCM);
+  
 
 
   SCM smobbed_copy () const;
@@ -71,7 +71,7 @@ public:
 
 
 };
-SCM pitch_transpose (SCM p, SCM delta);
+SCM ly_pitch_transpose (SCM p, SCM delta);
 DECLARE_UNSMOB(Pitch,pitch);
 
 #include "compare.hh"
diff -purN ../lilypond-1.5.56/lily/include/translator.hh ./lily/include/translator.hh
--- ../lilypond-1.5.56/lily/include/translator.hh	Fri May 17 00:38:07 2002
+++ ./lily/include/translator.hh	Sun May 19 02:12:10 2002
@@ -46,8 +46,6 @@ public:
 
   
   Translator_group * daddy_trans_l_ ;
-  DECLARE_SCHEME_CALLBACK(name, (SCM trans));
-  DECLARE_SCHEME_CALLBACK(description,(SCM trans));
   void announces ();
 
   void removal_processing ();
diff -purN ../lilypond-1.5.56/lily/input-smob.cc ./lily/input-smob.cc
--- ../lilypond-1.5.56/lily/input-smob.cc	Fri May 17 00:38:05 2002
+++ ./lily/input-smob.cc	Sun May 19 02:12:04 2002
@@ -39,14 +39,16 @@ free_smob (SCM s)
   We don't use IMPLEMENT_TYPE_P, since the smobification part is
   implemented separately from the class.
  */
-SCM
-ly_input_p (SCM x)
+LY_DEFINE(ly_input_p, "ly-input-location?", 1, 0, 0,
+	  (SCM x),
+	  "Return whether @var{x} is an input location")
 {
   return unsmob_input (x) ? SCM_BOOL_T : SCM_BOOL_F ;
 }
 
-SCM
-ly_input_message (SCM sip, SCM msg)
+LY_DEFINE(ly_input_message,  "ly-input-message", 2, 0, 0, (SCM sip, SCM msg),
+	  "Print @var{msg} as a GNU compliant error message, pointing to the
+location in @var{sip}.")
 {
   Input *ip  = unsmob_input(sip);
   
@@ -70,10 +72,6 @@ start_input_smobs ()
   scm_set_smob_equalp (input_tag, 0);
 
   
-  scm_c_define_gsubr ("ly-input-location?", 1, 0, 0,
-		      (Scheme_function_unknown)ly_input_p);
-  scm_c_define_gsubr ("ly-input-message", 2, 0, 0,
-		      (Scheme_function_unknown)ly_input_message);
 }
 
 SCM
diff -purN ../lilypond-1.5.56/lily/ligature-bracket-engraver.cc ./lily/ligature-bracket-engraver.cc
--- ../lilypond-1.5.56/lily/ligature-bracket-engraver.cc	Wed Apr 17 13:12:31 2002
+++ ./lily/ligature-bracket-engraver.cc	Sun May 19 02:16:29 2002
@@ -1,42 +1,18 @@
 /*   
-  ligature-bracket-engraver.cc -- implement Ligature__bracket_engraver
+  ligature-bracket-engraver.cc -- implement Ligature_bracket_engraver
   
   source file of the GNU LilyPond music typesetter
   
   (c) 2002 Juergen Reuter <reuter@ipd.uka.de>
   
  */
-#include "engraver.hh"
-#include "musical-request.hh"
-#include "warn.hh"
-#include "drul-array.hh"
-#include "item.hh"
+#include "ligature-engraver.hh"
 #include "spanner.hh"
-#include "score-engraver.hh"
-#include "note-head.hh"
-#include "stem.hh"
-#include "rest.hh"
 
-class Ligature_bracket_engraver : public Engraver
+class Ligature_bracket_engraver : public Ligature_engraver
 {
-  Drul_array<Span_req*> reqs_drul_;
-  
-  Spanner *finished_ligature_bracket_p_;
-  Spanner *ligature_bracket_p_;
-  Span_req *prev_start_req_;
-
-  // moment where ligature started.
-  Moment ligature_start_mom_;
-  Grob *last_bound;
-
 protected:
-  virtual void stop_translation_timestep ();
-  virtual void start_translation_timestep ();
-  virtual void finalize ();
-
-  virtual void acknowledge_grob (Grob_info);
-  virtual bool try_music (Music*);
-  virtual void process_music ();
+  virtual Spanner *create_ligature_spanner ();
 
 public:
   TRANSLATOR_DECLARATIONS(Ligature_bracket_engraver);
@@ -48,146 +24,17 @@ private:
 
 Ligature_bracket_engraver::Ligature_bracket_engraver ()
 {
-  ligature_bracket_p_ = 0;
-  finished_ligature_bracket_p_ = 0;
-  reqs_drul_[LEFT] = reqs_drul_[RIGHT] = 0;
-  prev_start_req_ = 0;
-  last_bound = 0;
-}
-
-bool
-Ligature_bracket_engraver::try_music (Music *m)
-{
-  if (Span_req *req_ = dynamic_cast<Span_req*> (m))
-    {
-      if (scm_equal_p (req_->get_mus_property ("span-type"),
-		       ly_str02scm ("abort")) == SCM_BOOL_T)
-	{
-	  reqs_drul_[START] = 0;
-	  reqs_drul_[STOP] = 0;
-	  if (ligature_bracket_p_)
-	    ligature_bracket_p_->suicide ();
-	  ligature_bracket_p_ = 0;
-	}
-      else if (scm_equal_p (req_->get_mus_property ("span-type"),
-			    ly_str02scm ("ligature-bracket")) == SCM_BOOL_T)
-	{
-	  Direction d = req_->get_span_dir ();
-	  reqs_drul_[d] = req_;
-	  return true;
-	}
-    }
-  return false;
-}
-
-void
-Ligature_bracket_engraver::process_music ()
-{
-  if (reqs_drul_[STOP])
-    {
-      if (!ligature_bracket_p_)
-	reqs_drul_[STOP]->origin ()->warning (_ ("can't find start of ligature"));
-      else
-	{
-	  if (!last_bound)
-	    {
-	      reqs_drul_[STOP]->origin ()->warning (_ ("no right bound"));
-	    }
-	  else
-	    {
-	      ligature_bracket_p_->set_bound (RIGHT, last_bound);
-	    }
-	}
-      prev_start_req_ = 0;
-      finished_ligature_bracket_p_ = ligature_bracket_p_;
-      ligature_bracket_p_ = 0;
-    }
-  last_bound = unsmob_grob (get_property ("currentMusicalColumn"));
-
-  if (ligature_bracket_p_)
-    {
-      // TODO: maybe forbid breaks only if not transcribing
-      top_engraver ()->forbid_breaks ();
-    }
-  if (reqs_drul_[START])
-    {
-      if (ligature_bracket_p_)
-	{
-	  reqs_drul_[START]->origin ()->warning (_ ("already have a ligature"));
-	  return;
-	}
-
-      prev_start_req_ = reqs_drul_[START];
-      ligature_bracket_p_ = new Spanner (get_property ("LigatureBracket"));
-
-      Grob *bound = unsmob_grob (get_property ("currentMusicalColumn"));
-      if (!bound)
-	{
-	  reqs_drul_[START]->origin ()->warning (_ ("no left bound"));
-	}
-      else
-	{
-	  ligature_bracket_p_->set_bound (LEFT, bound);
-	}
-
-      ligature_start_mom_ = now_mom ();
-      
-      announce_grob(ligature_bracket_p_, reqs_drul_[START]->self_scm());
-    }
-}
-
-void
-Ligature_bracket_engraver::start_translation_timestep ()
-{
-  reqs_drul_[START] = 0;
-  reqs_drul_[STOP] = 0;
-}
-
-void
-Ligature_bracket_engraver::typeset_ligature_bracket ()
-{
-  if (finished_ligature_bracket_p_)
-    {
-      typeset_grob (finished_ligature_bracket_p_);
-      finished_ligature_bracket_p_ = 0;
-    }
-}
-
-void
-Ligature_bracket_engraver::stop_translation_timestep ()
-{
-  typeset_ligature_bracket ();
-}
-
-void
-Ligature_bracket_engraver::finalize ()
-{
-  typeset_ligature_bracket ();
-  if (ligature_bracket_p_)
-    {
-      prev_start_req_->origin ()->warning (_ ("unterminated ligature"));
-      ligature_bracket_p_->suicide ();
-    }
 }
 
-void
-Ligature_bracket_engraver::acknowledge_grob (Grob_info info)
+Spanner *
+Ligature_bracket_engraver::create_ligature_spanner ()
 {
-  if (ligature_bracket_p_)
-    {
-      if (Rest::has_interface (info.grob_l_))
-	{
-	  reqs_drul_[START]->origin ()->warning (_ ("ligature may not contain rest; ignoring rest"));
-	  prev_start_req_->origin ()->warning (_ ("ligature was started here"));
-	  // TODO: maybe better should stop ligature here rather than
-	  // ignoring the rest?
-	}
-    }
+  return new Spanner (get_property ("LigatureBracket"));
 }
 
 ENTER_DESCRIPTION(Ligature_bracket_engraver,
 /* descr */       "Handles Ligature_requests by engraving Ligature brackets.",
 /* creats*/       "LigatureBracket",
-/* acks  */       "rest-interface",
+/* acks  */       "ligature-head-interface rest-interface",
 /* reads */       "",
 /* write */       "");
diff -purN ../lilypond-1.5.56/lily/ligature-bracket.cc ./lily/ligature-bracket.cc
--- ../lilypond-1.5.56/lily/ligature-bracket.cc	Thu Apr 18 14:28:22 2002
+++ ./lily/ligature-bracket.cc	Sun May 19 02:16:29 2002
@@ -145,5 +145,5 @@ Ligature_bracket::brew_molecule (SCM smo
 }
 
 ADD_INTERFACE(Ligature_bracket, "ligature-bracket-interface",
-	      "",
+	      "A bracket indicating a ligature in the original edition",
 	      "width thickness height");
diff -purN ../lilypond-1.5.56/lily/ligature-engraver.cc ./lily/ligature-engraver.cc
--- ../lilypond-1.5.56/lily/ligature-engraver.cc	Thu Jan  1 01:00:00 1970
+++ ./lily/ligature-engraver.cc	Sun May 19 02:06:24 2002
@@ -0,0 +1,196 @@
+/*   
+  ligature-engraver.cc -- implement Ligature_engraver
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2002 Juergen Reuter <reuter@ipd.uka.de>
+  
+ */
+#include "ligature-engraver.hh"
+#include "ligature-head.hh"
+#include "spanner.hh"
+#include "score-engraver.hh"
+#include "rest.hh"
+#include "warn.hh"
+
+/*
+ * TODO: lyrics/melisma/syllables: there should be at most one
+ * syllable of lyrics per ligature (i.e. for the lyrics context, a
+ * ligature should count as a single note, regardless of how many
+ * heads the ligature consists of).
+ *
+ * TODO: currently, you have to add/remove the proper
+ * Ligature_engraver (Ligature_bracket_engraver,
+ * Mensural_ligature_engraver) to the proper translator
+ * (e.g. VoiceContext) to choose between various representations.
+ * Since adding/removing an engraver to a translator is a global
+ * action in the paper block, you can not mix various representations
+ * _within_ the same score.  Hence, for selecting a representation,
+ * one would rather like to have a property that can be set e.g. for
+ * several staves individually.  However, it seems that this approach
+ * would require to have a single, complicated Ligature_engraver that
+ * consists of all the code...  This needs further thoughts.
+ */
+Ligature_engraver::Ligature_engraver ()
+{
+  ligature_p_ = 0;
+  finished_ligature_p_ = 0;
+  reqs_drul_[LEFT] = reqs_drul_[RIGHT] = 0;
+  prev_start_req_ = 0;
+  last_bound = 0;
+  brew_ligature_primitive_proc = SCM_EOL;
+}
+
+bool
+Ligature_engraver::try_music (Music *m)
+{
+  if (Span_req *req_ = dynamic_cast<Span_req*> (m))
+    {
+      if (scm_equal_p (req_->get_mus_property ("span-type"),
+		       ly_str02scm ("abort")) == SCM_BOOL_T)
+	{
+	  reqs_drul_[START] = 0;
+	  reqs_drul_[STOP] = 0;
+	  if (ligature_p_)
+	    ligature_p_->suicide ();
+	  ligature_p_ = 0;
+	}
+      else if (scm_equal_p (req_->get_mus_property ("span-type"),
+			    ly_str02scm ("ligature")) == SCM_BOOL_T)
+	{
+	  Direction d = req_->get_span_dir ();
+	  reqs_drul_[d] = req_;
+	  return true;
+	}
+    }
+  return false;
+}
+
+Spanner *
+Ligature_engraver::create_ligature_spanner ()
+{
+  return new Spanner (SCM_EOL);
+}
+
+void
+Ligature_engraver::process_music ()
+{
+  if (reqs_drul_[STOP])
+    {
+      if (!ligature_p_)
+	reqs_drul_[STOP]->origin ()->warning (_ ("can't find start of ligature"));
+      else
+	{
+	  if (!last_bound)
+	    {
+	      reqs_drul_[STOP]->origin ()->warning (_ ("no right bound"));
+	    }
+	  else
+	    {
+	      ligature_p_->set_bound (RIGHT, last_bound);
+	    }
+	}
+      prev_start_req_ = 0;
+      finished_ligature_p_ = ligature_p_;
+      ligature_p_ = 0;
+    }
+  last_bound = unsmob_grob (get_property ("currentMusicalColumn"));
+
+  if (ligature_p_)
+    {
+      // TODO: maybe forbid breaks only if not transcribing
+      top_engraver ()->forbid_breaks ();
+    }
+  if (reqs_drul_[START])
+    {
+      if (ligature_p_)
+	{
+	  reqs_drul_[START]->origin ()->warning (_ ("already have a ligature"));
+	  return;
+	}
+
+      prev_start_req_ = reqs_drul_[START];
+      ligature_p_ = create_ligature_spanner ();
+      brew_ligature_primitive_proc =
+	ligature_p_->get_grob_property ("ligature-primitive-callback");
+      if (brew_ligature_primitive_proc == SCM_EOL)
+	{
+	  warning ("Ligature_engraver: ligature-primitive-callback undefined");
+	}
+
+      Grob *bound = unsmob_grob (get_property ("currentMusicalColumn"));
+      if (!bound)
+	{
+	  reqs_drul_[START]->origin ()->warning (_ ("no left bound"));
+	}
+      else
+	{
+	  ligature_p_->set_bound (LEFT, bound);
+	}
+
+      ligature_start_mom_ = now_mom ();
+      
+      announce_grob(ligature_p_, reqs_drul_[START]->self_scm());
+    }
+}
+
+void
+Ligature_engraver::start_translation_timestep ()
+{
+  reqs_drul_[START] = 0;
+  reqs_drul_[STOP] = 0;
+}
+
+void
+Ligature_engraver::try_stop_ligature ()
+{
+  if (finished_ligature_p_)
+    {
+      typeset_grob (finished_ligature_p_);
+      finished_ligature_p_ = 0;
+    }
+}
+
+void
+Ligature_engraver::stop_translation_timestep ()
+{
+  try_stop_ligature ();
+}
+
+void
+Ligature_engraver::finalize ()
+{
+  try_stop_ligature ();
+  if (ligature_p_)
+    {
+      prev_start_req_->origin ()->warning (_ ("unterminated ligature"));
+      ligature_p_->suicide ();
+    }
+}
+
+void
+Ligature_engraver::acknowledge_grob (Grob_info info)
+{
+  if (ligature_p_)
+    {
+      if (Ligature_head::has_interface (info.grob_l_))
+	{
+	  info.grob_l_->set_grob_property ("ligature-primitive-callback",
+					   brew_ligature_primitive_proc);
+	}
+      else if (Rest::has_interface (info.grob_l_))
+	{
+	  info.music_cause ()->origin ()->warning (_ ("ligature may not contain rest; ignoring rest"));
+	  prev_start_req_->origin ()->warning (_ ("ligature was started here"));
+	  // TODO: maybe better should stop ligature here rather than
+	  // ignoring the rest?
+	}
+    }
+}
+
+ENTER_DESCRIPTION(Ligature_engraver,
+/* descr */       "Abstract class; a concrete subclass handles Ligature_requests by engraving Ligatures in a concrete style.",
+/* creats*/       "Ligature",
+/* acks  */       "ligature-head-interface rest-interface",
+/* reads */       "",
+/* write */       "");
diff -purN ../lilypond-1.5.56/lily/ligature-head.cc ./lily/ligature-head.cc
--- ../lilypond-1.5.56/lily/ligature-head.cc	Thu Jan  1 01:00:00 1970
+++ ./lily/ligature-head.cc	Sun May 19 02:06:24 2002
@@ -0,0 +1,46 @@
+/*
+  ligature-head.cc -- implement Ligature_head
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2002 Juergen Reuter <reuter@ipd.uka.de>
+*/
+
+#include "ligature-head.hh"
+#include "item.hh"
+#include "note-head.hh"
+#include "warn.hh"
+
+/*
+ * TODO: in scm/grob-description.scm, LigatureHead must contain value
+ * "rhythmic-head-interface" in the interfaces list.  Otherwise, text
+ * scripts (such as fermata) are horizontally aligned with the end of
+ * the ligature rather than with the associated head.  Why?
+ *
+ * TODO: if properties font-family and style are not set properly
+ * (e.g. by a user erronously setting font-family to #'music),
+ * lilypond currently crashes with the message: "lilypond:
+ * ../flower/include/interval.hh:28: Real Interval_t<double>::center()
+ * const: Assertion `!empty_b ()' failed.".  The code of this class
+ * should be clever enough to foresee a potential crash, print a
+ * warning, and supply sensible default values that avoid the crash.
+ */
+MAKE_SCHEME_CALLBACK (Ligature_head,brew_molecule,1);
+SCM
+Ligature_head::brew_molecule (SCM smob)  
+{
+  Grob *me = unsmob_grob (smob);
+  SCM brew_ligature_primitive_proc =
+    me->get_grob_property ("ligature-primitive-callback");
+  if (brew_ligature_primitive_proc != SCM_EOL)
+    {
+      return gh_call1 (brew_ligature_primitive_proc, smob);
+    }
+  else
+    {
+      warning ("Ligature_head: ligature-primitive-callback undefined -> resorting to Note_head::brew_molecule");
+      return Note_head::brew_molecule (smob);
+    }
+}
+
+ADD_INTERFACE (Ligature_head,"ligature-head-interface","Ligature head","");
diff -purN ../lilypond-1.5.56/lily/lily-guile.cc ./lily/lily-guile.cc
--- ../lilypond-1.5.56/lily/lily-guile.cc	Sun May  5 21:46:24 2002
+++ ./lily/lily-guile.cc	Sun May 19 02:12:04 2002
@@ -148,10 +148,14 @@ gulp_file_to_string (String fn)
   return result;
 }
 
-SCM
-ly_gulp_file (SCM fn)
+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.
+
+")
 {
-  return ly_str02scm (gulp_file_to_string (ly_scm2string (fn)).ch_C ());
+  return ly_str02scm (gulp_file_to_string (ly_scm2string (name)).ch_C ());
 }
 
 
@@ -206,16 +210,19 @@ index_set_cell (SCM s, Direction d, SCM 
   return s;
 }
   
-SCM
-ly_warning (SCM str)
+LY_DEFINE(ly_warning,"ly-warn", 1, 0, 0,
+  (SCM str),"Scheme callable function to issue the warning @code{msg}.
+")
 {
   assert (gh_string_p (str));
   warning ("lily-guile: " + ly_scm2string (str));
   return SCM_BOOL_T;
 }
 
-SCM
-ly_isdir_p (SCM s)
+LY_DEFINE(ly_isdir_p,  "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))
     {
@@ -405,8 +412,11 @@ ly_type (SCM exp)
  */
    
    
-SCM
-ly_number2string (SCM s)
+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.
+")
 {
   assert (gh_number_p (s));
 
@@ -456,36 +466,31 @@ wave_sweep_goodbye (void *dummy1, void *
 
 
 #include "version.hh"
-SCM
-ly_version ()
+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 ")" ;
   
   return gh_eval_str ((char*)vs);
 }
 
-SCM
-ly_unit ()
+LY_DEFINE(ly_unit,  "ly-unit", 0, 0, 0, (),
+	  "Return the unit used for lengths as a string.")
 {
   return ly_str02scm (INTERNAL_UNIT);
 }
 
+LY_DEFINE(ly_verbose,  "ly-verbose", 0, 0, 0, (),
+  "Return whether lilypond is being run in verbose mode.")
+{
+  return gh_bool2scm (verbose_global_b);
+}
+
 static void
 init_functions ()
 {
-  scm_c_define_gsubr ("ly-warn", 1, 0, 0,
-		      (Scheme_function_unknown)ly_warning);
-  scm_c_define_gsubr ("ly-version", 0, 0, 0,
-		      (Scheme_function_unknown)ly_version);  
-  scm_c_define_gsubr ("ly-unit", 0, 0, 0,
-		      (Scheme_function_unknown)ly_unit);  
-  scm_c_define_gsubr ("ly-gulp-file", 1,0, 0,
-		      (Scheme_function_unknown)ly_gulp_file);
-  scm_c_define_gsubr ("dir?", 1,0, 0, (Scheme_function_unknown)ly_isdir_p);
-  scm_c_define_gsubr ("ly-number->string", 1, 0,0,
-		      (Scheme_function_unknown) ly_number2string);
-
-
 #ifdef TEST_GC 
   scm_c_hook_add (&scm_before_mark_c_hook, greet_sweep, 0, 0);
   scm_c_hook_add (&scm_before_sweep_c_hook, wave_sweep_goodbye, 0, 0);
@@ -729,3 +734,4 @@ ly_split_list (SCM s, SCM list)
   return gh_cons ( scm_reverse_x (before, SCM_EOL),  after);
   
 }
+
diff -purN ../lilypond-1.5.56/lily/lookup.cc ./lily/lookup.cc
--- ../lilypond-1.5.56/lily/lookup.cc	Mon Apr  1 15:48:03 2002
+++ ./lily/lookup.cc	Sun May 19 02:12:04 2002
@@ -531,7 +531,7 @@ Lookup::repeat_slash (Real w, Real s, Re
 }
 
 Molecule
-Lookup::bracket (Axis a, Interval iv, Direction d, Real thick, Real protude)
+Lookup::bracket (Axis a, Interval iv, Real thick, Real protude)
 {
   Box b;
   Axis other = Axis((a+1)%2);
@@ -541,8 +541,8 @@ Lookup::bracket (Axis a, Interval iv, Di
   Molecule m =  filledbox (b);
 
   b[a] = Interval (iv[UP] - thick, iv[UP]);
-  Interval oi = Interval (-thick/2, thick/2 + protude) ;
-  oi *=  d;
+  Interval oi = Interval (-thick/2, thick/2 + fabs (protude)) ;
+  oi *=  sign (protude);
   b[other] = oi;
   m.add_molecule (filledbox (b));
   b[a] = Interval (iv[DOWN], iv[DOWN]  +thick);
@@ -551,25 +551,24 @@ Lookup::bracket (Axis a, Interval iv, Di
   return m;
 }
 
-SCM
-ly_bracket (SCM a, SCM iv, SCM d, SCM t, SCM p)
+/*
+  TODO: use rounded boxes.
+ */
+LY_DEFINE(ly_bracket ,"ly-bracket",
+	  4, 0, 0,
+	  (SCM a, SCM iv, SCM t, SCM p),
+	  "Make a bracket in direction @var{a}. The extent of the bracket is
+given by @var{iv}. The wings protude by an amount of @var{p}, which
+may be negative. The thickness is given by @var{t}.")
 {
   SCM_ASSERT_TYPE(ly_axis_p (a), a, SCM_ARG1, __FUNCTION__, "axis") ;
-  SCM_ASSERT_TYPE(ly_number_pair_p (iv), iv, SCM_ARG1, __FUNCTION__, "number pair") ;
-  SCM_ASSERT_TYPE(ly_dir_p (d), a, SCM_ARG1, __FUNCTION__, "direction") ;
-  SCM_ASSERT_TYPE(gh_number_p (t), a, SCM_ARG1, __FUNCTION__, "number") ;
-  SCM_ASSERT_TYPE(gh_number_p(p), a, SCM_ARG1, __FUNCTION__, "number") ;
+  SCM_ASSERT_TYPE(ly_number_pair_p (iv), iv, SCM_ARG2, __FUNCTION__, "number pair") ;
+  SCM_ASSERT_TYPE(gh_number_p (t), a, SCM_ARG3, __FUNCTION__, "number") ;
+  SCM_ASSERT_TYPE(gh_number_p(p), a, SCM_ARG4, __FUNCTION__, "number") ;
 
 
   return Lookup::bracket ((Axis)gh_scm2int (a), ly_scm2interval (iv),
-		  (Direction)gh_scm2int (d), gh_scm2double (t), gh_scm2double (p)).smobbed_copy ();
+			  gh_scm2double (t),
+			  gh_scm2double (p)).smobbed_copy ();
 }
   
-static void
-lookup_init ()
-{
-  scm_c_define_gsubr ("ly-bracket", 5, 0, 0, (Scheme_function_unknown) ly_bracket);
-}
-
-ADD_SCM_INIT_FUNC (lookup,lookup_init);
-
diff -purN ../lilypond-1.5.56/lily/main.cc ./lily/main.cc
--- ../lilypond-1.5.56/lily/main.cc	Wed May 15 12:27:53 2002
+++ ./lily/main.cc	Sun May 19 02:12:05 2002
@@ -247,10 +247,6 @@ setup_paths ()
 #endif
 
   global_path.add ("");
-  // must override (come before) "/usr/local/share/lilypond"!
-  char const *env_sz = getenv ("LILYINCLUDE");
-  if (env_sz)
-    global_path.parse_path (env_sz);
 
 
   /* Adding mf/out make lilypond unchanged source directory, when setting
diff -purN ../lilypond-1.5.56/lily/mensural-ligature-engraver.cc ./lily/mensural-ligature-engraver.cc
--- ../lilypond-1.5.56/lily/mensural-ligature-engraver.cc	Thu Jan  1 01:00:00 1970
+++ ./lily/mensural-ligature-engraver.cc	Sun May 19 02:06:24 2002
@@ -0,0 +1,583 @@
+/*
+  mensural-ligature-engraver.cc -- implement Mensural_ligature_engraver
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (C) 2002 Juergen Reuter <reuter@ipd.uka.de>
+ */
+
+#include "mensural-ligature.hh"
+#include "ligature-engraver.hh"
+#include "musical-request.hh"
+#include "warn.hh"
+#include "item.hh"
+#include "spanner.hh"
+#include "rod.hh"
+#include "paper-column.hh"
+#include "note-column.hh"
+#include "rhythmic-head.hh"
+#include "note-head.hh"
+#include "staff-symbol-referencer.hh"
+#include "paper-def.hh"
+#include "font-interface.hh"
+
+/*
+ * TODO: local accidentals: collect accidentals that occur within a
+ * ligature and put them before the ligature.  If an accidental
+ * changes within a ligature, print a warning (user error) and ignore
+ * any further accidental for that pitch within that ligature
+ * (actually, in such a case, the user should split the ligature into
+ * two separate ligatures).  Similarly, any object that, in ordinary
+ * notation, may be put to the left or to the right of a
+ * note-head/ligature-head, should be collected and put before or
+ * after the ligature.
+ *
+ * TODO: make spacing more robust: do not screw up spacing if user
+ * erroneously puts rest in ligature.
+ *
+ * TODO: My resources on Franco of Cologne's rules claim that his
+ * rules map ligature<->mensural timing in a non-ambigous way, but in
+ * fact, as presented in these resources, the rules become ambigous as
+ * soon as there appear durations other than breves within a ligature
+ * with more than two heads (ligatura ternaria etc.).  Hence, the
+ * below implementation is an approximation of what I think the rules
+ * could look like if forced to be non-ambigous.  This should be
+ * further investigated.
+ *
+ * TODO: The automat is quite complicated, and its design is error
+ * prone (and most probably, it behaves wrong for some very special
+ * cases).  Maybe we can find a better paradigm for modelling Franco
+ * of Cologne's rules?
+ *
+ * TODO: dotted heads: when applying Franco of Cologne's mapping, put
+ * dots *above* (rather than after) affected ligature heads.
+ *
+ * TODO: prohibit multiple voices within a ligature.
+ *
+ * TODO: for each ligature, add Rod that represents the total length
+ * of the ligature (to preemptively avoid collision with adjacent
+ * notes); or maybe just additionally create a mensural-ligature grob
+ * (via Mensural_ligature::brew_molecule(SCM)) that just consists of a
+ * bounding box around all primitives of the ligature.
+ *
+ * TODO: enhance robustness: in case of an illegal ligature (e.g. the
+ * user requests for a ligature that contains a minima or STATE_ERROR
+ * is reached), automatically break the ligature into smaller, valid
+ * pieces.
+ *
+ * TODO: In the future, there will be further ligature engravers
+ * implemented, such as a Vaticana_ligature_engraver.  There will be
+ * redundant code between these engravers and the
+ * Mensural_ligature_engraver.  In particular these are functions
+ * set_column_l_, fold_up_primitives, join_primitives, and
+ * ackowledge_grob; further the code for handling accidentals.  It is
+ * not appropriate to put these things into Ligature_engraver, since,
+ * for example, Ligature_bracket_engraver does not share any of this
+ * code.  Hence, we might to introduce a further subclass of
+ * Ligature_engraver which serves as super class for
+ * Mensural_ligature_engraver, Vaticana_ligature_engraver, among
+ * others.
+ */
+class Mensural_ligature_engraver : public Ligature_engraver
+{
+  Real distance_f_;
+  Array<Grob_info> primitives_arr_;
+
+protected:
+  virtual void acknowledge_grob (Grob_info);
+  virtual void try_stop_ligature ();
+  virtual Spanner *create_ligature_spanner ();
+
+public:
+  TRANSLATOR_DECLARATIONS(Mensural_ligature_engraver);
+
+private:
+  int apply_transition (int state, int input, int i);
+  void transform_heads ();
+  void propagate_properties ();
+  void fold_up_primitives ();
+  void join_primitives ();
+  void set_column_l (Item *item, Paper_column *new_col);
+};
+
+
+Mensural_ligature_engraver::Mensural_ligature_engraver ()
+{
+  distance_f_ = 0;
+}
+
+Spanner *
+Mensural_ligature_engraver::create_ligature_spanner ()
+{
+  distance_f_ = 0;
+  return new Spanner (get_property ("MensuralLigature"));
+}
+
+/*
+ * TODO: move this function to class Item?
+ */
+void
+Mensural_ligature_engraver::set_column_l (Item *item, Paper_column *column)
+{
+  Item *parent = dynamic_cast<Item*> (item->get_parent (X_AXIS));
+  if (!parent)
+    {
+      programming_error ("failed tweaking paper column in ligature");
+      return;
+    }
+
+  String name = parent->name ();
+  if (!String::compare_i (name, "PaperColumn"))
+    {
+      // Change column not only for targeted item (NoteColumn), but
+      // also for all associated grobs (NoteSpacing, SeparationItem).
+      Grob *sl = Staff_symbol_referencer::staff_symbol_l (item);
+      for (SCM tail = parent->get_grob_property ("elements");
+	   gh_pair_p (tail);
+	   tail = ly_cdr (tail))
+	{
+	  Item *sibling = unsmob_item (ly_car (tail));
+	  if ((sibling) &&
+	      (Staff_symbol_referencer::staff_symbol_l (sibling) == sl))
+	    {
+	      sibling->set_parent (column, X_AXIS);
+	    }
+	}
+    }
+  else
+    {
+      set_column_l (parent, column);
+    }
+}
+
+/*
+ * The following lines implement a finite state automat.  Given a
+ * sequence of durations (Longa, Brevis, Semibrevis) or
+ * end-of-ligature-request as input, the automat outputs a sequence of
+ * requests for grobs that form a proper ligature.
+ */
+
+/*
+ * This enumeration represents the set of possible input values to the
+ * automat.  There may (potentially) be any sequence of Longa, Brevis,
+ * and Semibrevis duration symbols fed into the automat, with a final
+ * EndOfLigature symbol to terminate the ligature.  Other durations
+ * are explicitly prohibited.  Depending on the note's pitch of the
+ * preceding and the current input, the melodic line may be ascending
+ * or descending.  Per definition, the melodic line must either ascend
+ * or descend, because if the pitches were twice the same, the two
+ * notes would be merged into a single one (as long as not resulting
+ * in a prohibited duration).  In the case of the EndOfLigature
+ * symbol, the melodic line is undefined (but we still have ascending
+ * and descending case for the sake of consistency, making the automat
+ * simpler).
+ */
+enum Ligature_input
+{
+  // Ascending/Descending Longa/Brevis/Semibrevis/EndOfLigature
+  INPUT_AL = 0,
+  INPUT_DL,
+  INPUT_AB,
+  INPUT_DB,
+  INPUT_AS,
+  INPUT_DS,
+  INPUT_AE,
+  INPUT_DE,
+};
+
+/*
+ * This enumeration represents all possible internal states of the
+ * automat.  Besides the generic states START, ERROR, and END, the
+ * remaining states L, B, S, and SS describe pending values from the
+ * sequence of input values that have not yet been transformed to
+ * proper output values, including the melodic direction
+ * (ascending/descending) for state L.
+ */
+enum Ligature_state
+{
+  // aL = ascending Longa, dL descending Longa, B = Brevis, S =
+  // Semibrevis, SS = 2 Semibreves
+  STATE_START = 0,
+  STATE_aL,
+  STATE_dL,
+  STATE_B,
+  STATE_S,
+  STATE_SS,
+  STATE_ERROR,
+  STATE_END,
+};
+
+/*
+ * The following array represents the transitions of the automat:
+ * given some state and input, it maps to a new state, according (with
+ * the limitations as described above) to the rules of Franco of
+ * Cologne.
+ */
+const int/*new state*/ transition_state[/*old state*/][8/*input*/] =
+{
+  {STATE_aL,    STATE_dL,    STATE_B,     STATE_B,
+   STATE_S,     STATE_S,     STATE_ERROR, STATE_ERROR}, // was: STATE_START
+  {STATE_aL,    STATE_dL,    STATE_B,     STATE_START,
+   STATE_ERROR, STATE_ERROR, STATE_END,   STATE_END},   // was: STATE_aL
+  {STATE_aL,    STATE_dL,    STATE_B,     STATE_START,
+   STATE_ERROR, STATE_ERROR, STATE_END,   STATE_END},   // was: STATE_dL
+  {STATE_aL,    STATE_dL,    STATE_B,     STATE_START,
+   STATE_ERROR, STATE_ERROR, STATE_END,   STATE_END},   // was: STATE_B
+  {STATE_ERROR, STATE_ERROR, STATE_ERROR, STATE_ERROR,
+   STATE_SS,    STATE_SS,    STATE_ERROR, STATE_ERROR}, // was: STATE_S
+  {STATE_aL,    STATE_dL,    STATE_B,     STATE_B,
+   STATE_S,     STATE_S,     STATE_END,   STATE_END},   // was: STATE_SS
+  {STATE_ERROR, STATE_ERROR, STATE_ERROR, STATE_ERROR,
+   STATE_ERROR, STATE_ERROR, STATE_ERROR, STATE_ERROR}, // was: STATE_ERROR
+  {STATE_ERROR, STATE_ERROR, STATE_ERROR, STATE_ERROR,
+   STATE_ERROR, STATE_ERROR, STATE_ERROR, STATE_ERROR}, // was: STATE_END
+};
+
+/*
+ * The following array represents the output of the automat while
+ * switching from one state to another: given some state and input, it
+ * maps to the output produced when switching to the next state,
+ * according (with the limitations as described above) to the rules of
+ * Franco of Cologne.
+ */
+const int/*output*/ transition_output[/*old state*/][8/*input*/] =
+{
+  {MLP_NONE,  MLP_NONE,  MLP_NONE,  MLP_NONE,
+   MLP_NONE,  MLP_NONE,  MLP_NONE,  MLP_NONE}, // was: STATE_START
+  {MLP_sc,    MLP_ss,    MLP_sc,    MLP_LB,
+   MLP_NONE,  MLP_NONE,  MLP_sc,    MLP_sc},   // was: STATE_aL
+  {MLP_sc,    MLP_ss,    MLP_sc,    MLP_LB,
+   MLP_NONE,  MLP_NONE,  MLP_ss,    MLP_ss},   // was: STATE_dL
+  {MLP_ss,    MLP_cs,    MLP_ss,    MLP_BB,
+   MLP_NONE,  MLP_NONE,  MLP_ss,    MLP_ss} ,  // was: STATE_B
+  {MLP_NONE,  MLP_NONE,  MLP_NONE,  MLP_NONE,
+   MLP_NONE,  MLP_NONE,  MLP_NONE,  MLP_NONE}, // was: STATE_S
+  {MLP_SS,    MLP_SS,    MLP_SS,    MLP_SS,
+   MLP_SS,    MLP_SS,    MLP_SS,    MLP_SS} ,  // was: STATE_SS
+  {MLP_NONE,  MLP_NONE,  MLP_NONE,  MLP_NONE,
+   MLP_NONE,  MLP_NONE,  MLP_NONE,  MLP_NONE}, // was: STATE_ERROR
+  {MLP_NONE,  MLP_NONE,  MLP_NONE,  MLP_NONE,
+   MLP_NONE,  MLP_NONE,  MLP_NONE,  MLP_NONE}, // was: STATE_END
+};
+
+int
+Mensural_ligature_engraver::apply_transition (int state, int input, int i)
+{
+  int output = transition_output[state][input];
+  Item *last_last_primitive = (i > 1) ?
+    dynamic_cast<Item*> (primitives_arr_[i-2].grob_l_) : 0;
+  Item *last_primitive = (i > 0) ?
+    dynamic_cast<Item*> (primitives_arr_[i-1].grob_l_) : 0;
+  Item *primitive = (i < primitives_arr_.size ()) ?
+    dynamic_cast<Item*> (primitives_arr_[i].grob_l_) : 0;
+  switch (output)
+    {
+      case MLP_NONE:
+	// skip note head, expecting a primitive with two note heads
+	break;
+      case MLP_sc:
+      case MLP_ss:
+      case MLP_cs:
+	// primitive with single note head
+	if (!last_primitive)
+	  {
+	    programming_error ("last_primitive undefined");
+	    break;
+	  }
+	last_primitive->set_grob_property ("primitive", gh_int2scm (output));
+	break;
+      case MLP_BB:
+      case MLP_LB:
+	// primitive with two note heads
+	if (!last_primitive)
+	  {
+	    programming_error ("last_primitive undefined");
+	    break;
+	  }
+	if (!primitive)
+	  {
+	    programming_error ("primitive undefined");
+	    break;
+	  }
+	last_primitive->set_grob_property ("primitive", gh_int2scm (output));
+	primitive->set_grob_property ("primitive", gh_int2scm (MLP_NONE));
+	break;
+      case MLP_SS:
+	// delayed primitive with two note heads
+	if (!last_last_primitive)
+	  {
+	    programming_error ("last_last_primitive undefined");
+	    break;
+	  }
+	if (!last_primitive)
+	  {
+	    programming_error ("last_primitive undefined");
+	    break;
+	  }
+	last_last_primitive->set_grob_property ("primitive", gh_int2scm (output));
+	last_primitive->set_grob_property ("primitive", gh_int2scm (MLP_NONE));
+	break;
+      default:
+	programming_error (_f ("unexpected case fall-through"));
+	break;
+    }
+  return transition_state[state][input];
+}
+
+void
+Mensural_ligature_engraver::transform_heads ()
+{
+  if (primitives_arr_.size () < 2)
+    {
+      warning (_f ("ligature with less than 2 heads -> skipping"));
+      return;
+    }
+  int state = STATE_START;
+  Pitch last_pitch, pitch;
+  bool have_last_pitch = 0, have_pitch = 0;
+  for (int i = 0; i < primitives_arr_.size (); i++) {
+    last_pitch = pitch;
+    have_last_pitch = have_pitch;
+    Grob_info info = primitives_arr_[i];
+    int duration_log =
+      Rhythmic_head::balltype_i (dynamic_cast<Item*> (info.grob_l_));
+    Note_req *nr = dynamic_cast<Note_req*> (info.music_cause ());
+    if (!nr)
+      {
+	info.music_cause ()->origin ()->warning (_f ("can not determine pitch of ligature primitive -> skipping"));
+	i++;
+	state = STATE_START;
+	have_pitch = 0;
+	continue;
+      }
+    else
+      {
+	pitch = *unsmob_pitch (nr->get_mus_property ("pitch"));
+	have_pitch = 1;
+      }
+
+    int delta_pitch;
+
+    if (!have_last_pitch)
+      {
+	delta_pitch = 0; // first pitch; delta undefined
+      }
+    else
+      {
+	delta_pitch = (pitch.steps () - last_pitch.steps ());
+	if (Pitch::compare (last_pitch, pitch) == 0)
+	  {
+	    info.music_cause ()->origin ()->warning (_f ("prime interval within ligature -> skipping"));
+	    i++;
+	    state = STATE_START;
+	    have_pitch = 0;
+	    continue;
+	  }
+      }
+
+    if ((duration_log < -2) || (duration_log > 0))
+      {
+	info.music_cause ()->origin ()->warning (_f ("mensural ligature: duration none of L, B, S -> skipping"));
+	i++;
+	state = STATE_START;
+	have_pitch = 0;
+	continue;
+      }
+
+    int input = (duration_log + 2) * 2 + ((delta_pitch < 0) ? 1 : 0);
+    state = apply_transition (state, input, i);
+    // TODO: if (state == STATE_ERROR) { ... }
+  }
+
+  state = apply_transition (state, INPUT_AE, primitives_arr_.size ());
+  // TODO: if (state == STATE_ERROR) { ... }
+}
+
+void set_delta_pitch (Item *primitive, Grob_info info1, Grob_info info2)
+{
+  Note_req *nr1 = dynamic_cast<Note_req*> (info1.music_cause ());
+  Note_req *nr2 = dynamic_cast<Note_req*> (info2.music_cause ());
+  Pitch pitch1 = *unsmob_pitch (nr1->get_mus_property ("pitch"));
+  Pitch pitch2 = *unsmob_pitch (nr2->get_mus_property ("pitch"));
+  int delta_pitch = (pitch2.steps () - pitch1.steps ());
+  primitive->set_grob_property ("delta-pitch", gh_int2scm (delta_pitch));
+}
+
+/*
+ * A MensuralLigature grob consists of a bunch of LigatureHead grobs
+ * that are glued together.  It (a) does make sense to change
+ * properties like thickness or flexa-width from one head to the next
+ * within a ligature (this would totally screw up alignment), and (b)
+ * some of these properties (like flexa-width) are specific to
+ * e.g. the MensuralLigature (as in contrast to e.g. LigatureBracket),
+ * and therefore should not be handled in the generic LigatureHead
+ * (which is also used by LigatureBracket).  Therefore, we let the
+ * user control these properties via the concrete Ligature grob (like
+ * MensuralLigature) and then copy these properties as necessary to
+ * each of the LigatureHead grobs.  This is what
+ * propagate_properties() does.
+ */
+void
+Mensural_ligature_engraver::propagate_properties ()
+{
+  SCM thickness_scm =
+    finished_ligature_p_->get_grob_property ("thickness");
+  Real thickness = (thickness_scm != SCM_EOL) ?
+    gh_scm2double (thickness_scm) : 1.4;
+  thickness *= finished_ligature_p_->paper_l ()->get_var ("linethickness");
+
+  /*
+   * FIXME: Since character "noteheads--1mensural" is defined in
+   * parmesan font only, the right-hand expression in the
+   * following assignment evaluates to a width of 0.0, in case
+   * font-family of finished_ligature_p_ is _not_ set to "ancient"
+   * (by default, it is; see grob properties of MensuralLigature
+   * in scm/grob-description.scm).  This may arise severe problems
+   * in the future when switching between fonts (e.g. mensural
+   * versus neo-mensural).
+   */
+  Real head_width =
+    Font_interface::get_default_font (finished_ligature_p_)->
+    find_by_name ("noteheads--1mensural").extent (X_AXIS).length ();
+  if (head_width == 0.0)
+    {
+      programming_error ("Mensural_ligature_engraver: failed evaluating head_width (most probably a font-family selection problem)");
+    }
+
+  SCM flexa_width_scm =
+    finished_ligature_p_->get_grob_property ("flexa-width");
+  Real flexa_width = (flexa_width_scm != SCM_EOL) ?
+    gh_scm2double (flexa_width_scm) : 2.0;
+  flexa_width *= Staff_symbol_referencer::staff_space (finished_ligature_p_);
+
+  Real half_flexa_width = 0.5 * (flexa_width + thickness);
+
+  for (int i = 0; i < primitives_arr_.size (); i++)
+    {
+      Item *primitive = dynamic_cast<Item*> (primitives_arr_[i].grob_l_);
+      int output = gh_scm2int (primitive->get_grob_property ("primitive"));
+      primitive->set_grob_property ("thickness",
+				    gh_double2scm (thickness));
+      switch (output) {
+	case MLP_NONE:
+	  primitive->set_grob_property ("head-width",
+					gh_double2scm (half_flexa_width));
+	  break;
+	case MLP_sc:
+	case MLP_ss:
+	case MLP_cs:
+	  primitive->set_grob_property ("head-width",
+					gh_double2scm (head_width));
+	  break;
+	case MLP_BB:
+	case MLP_LB:
+	case MLP_SS:
+	  primitive->set_grob_property ("head-width",
+					gh_double2scm (half_flexa_width));
+	  primitive->set_grob_property ("flexa-width",
+					gh_double2scm (flexa_width));
+	  set_delta_pitch (primitive,
+			   primitives_arr_[i], primitives_arr_[i+1]);
+	  break;
+	default:
+	  programming_error (_f ("unexpected case fall-through"));
+	  break;
+      }
+    }
+}
+
+void
+Mensural_ligature_engraver::fold_up_primitives ()
+{
+  Item *first = 0;
+  for (int i = 0; i < primitives_arr_.size (); i++)
+    {
+      Item *current = dynamic_cast<Item*> (primitives_arr_[i].grob_l_);
+      if (i == 0)
+	{
+	  first = current;
+	}
+
+      set_column_l (current, first->column_l ());
+
+      if (i > 0)
+	{
+#if 0
+	  Rod r;
+	  r.distance_f_ = distance_f_;
+	  r.item_l_drul_[LEFT] = first;
+	  r.item_l_drul_[RIGHT] = current;
+	  r.add_to_cols ();
+#endif
+	  current->translate_axis (distance_f_, X_AXIS);
+	}
+
+      distance_f_ +=
+	gh_scm2double (current->get_grob_property ("head-width")) -
+	gh_scm2double (current->get_grob_property ("thickness"));
+    }
+}
+
+void
+Mensural_ligature_engraver::join_primitives ()
+{
+  Pitch last_pitch;
+  for (int i = 0; i < primitives_arr_.size (); i++)
+    {
+      Grob_info info = primitives_arr_[i];
+      Note_req *nr = dynamic_cast<Note_req*> (info.music_cause ());
+      Pitch pitch = *unsmob_pitch (nr->get_mus_property ("pitch"));
+      if (i > 0)
+        {
+	  Item *primitive = dynamic_cast<Item*> (info.grob_l_);
+	  int output = gh_scm2int (primitive->get_grob_property ("primitive"));
+	  if (output & MLP_ANY)
+	    {
+	      int delta_pitch = (pitch.steps () - last_pitch.steps ());
+	      primitive->set_grob_property ("join-left",
+					    gh_int2scm (delta_pitch));
+	    }
+	}
+      last_pitch = pitch;
+    }
+}
+
+void
+Mensural_ligature_engraver::try_stop_ligature ()
+{
+  if (finished_ligature_p_)
+    {
+      transform_heads ();
+      propagate_properties ();
+      fold_up_primitives ();
+      join_primitives ();
+
+      for (int i = 0; i < primitives_arr_.size (); i++)
+	{
+	  typeset_grob (primitives_arr_[i].grob_l_);
+	}
+
+      primitives_arr_.clear ();
+      finished_ligature_p_ = 0;
+    }
+}
+
+void
+Mensural_ligature_engraver::acknowledge_grob (Grob_info info)
+{
+  Ligature_engraver::acknowledge_grob (info);
+  if (ligature_p_)
+    {
+      if (Note_head::has_interface (info.grob_l_))
+	{
+	  primitives_arr_.push (info);
+	}
+    }
+}
+
+ENTER_DESCRIPTION(Mensural_ligature_engraver,
+/* descr */       "Handles Mensural_ligature_requests by glueing special ligature heads together.",
+/* creats*/       "MensuralLigature",
+/* acks  */       "ligature-head-interface note-head-interface rest-interface",
+/* reads */       "",
+/* write */       "");
diff -purN ../lilypond-1.5.56/lily/mensural-ligature.cc ./lily/mensural-ligature.cc
--- ../lilypond-1.5.56/lily/mensural-ligature.cc	Thu Jan  1 01:00:00 1970
+++ ./lily/mensural-ligature.cc	Sun May 19 02:06:24 2002
@@ -0,0 +1,258 @@
+/*
+  mensural-ligature.cc -- implement Mensural_ligature
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2002 Juergen Reuter <reuter@ipd.uka.de>
+*/
+
+#include <math.h>
+#include "item.hh"
+#include "mensural-ligature.hh"
+#include "font-interface.hh"
+#include "molecule.hh"
+#include "lookup.hh"
+#include "staff-symbol-referencer.hh"
+#include "note-head.hh"
+#include "paper-def.hh"
+#include "warn.hh"
+
+/*
+ * TODO: divide this function into mensural and neo-mensural style.
+ *
+ * TODO: move this function to class Lookup?
+ */
+Molecule
+brew_flexa (Grob *me,
+	    Real interval,
+	    bool solid,
+	    Real width,
+	    Real thickness,
+	    bool add_stem,
+	    Direction stem_direction)
+{
+  Real staff_space = Staff_symbol_referencer::staff_space (me);
+  Real height = 0.6 * staff_space;
+  Molecule molecule = Molecule ();
+
+  if (add_stem)
+    {
+      bool consider_interval =
+	stem_direction * interval > 0.0;
+
+      Interval stem_box_x (0, thickness);
+      Interval stem_box_y;
+
+      if (consider_interval)
+        {
+	  Real y_length = max (interval/2.0*staff_space, 1.2*staff_space);
+	  stem_box_y = Interval (0, y_length);
+	}
+      else
+	stem_box_y = Interval (0, staff_space);
+
+      Real y_correction =
+	(stem_direction == UP) ?
+	+0.5*height :
+	-0.5*height - stem_box_y.length();
+
+      Box stem_box (stem_box_x, stem_box_y);
+      Molecule stem = Lookup::filledbox (stem_box);
+      stem.translate_axis (y_correction, Y_AXIS);
+      molecule.add_molecule(stem);
+    }
+
+  Real slope = (interval / 2.0 * staff_space) / width;
+
+  // Compensate optical illusion regarding vertical position of left
+  // and right endings due to slope.
+  Real ypos_correction = -0.1*staff_space * sign(slope);
+  Real slope_correction = 0.2*staff_space * sign(slope);
+  Real corrected_slope = slope + slope_correction/width;
+
+  if (solid)
+    {
+      Molecule solid_head =
+	Lookup::horizontal_slope (width, corrected_slope, height);
+      molecule.add_molecule (solid_head);
+    }
+  else // outline
+    {
+      Molecule left_edge =
+	Lookup::horizontal_slope (thickness, corrected_slope, height);
+      molecule.add_molecule(left_edge);
+
+      Molecule right_edge =
+	Lookup::horizontal_slope (thickness, corrected_slope, height);
+      right_edge.translate_axis (width-thickness, X_AXIS);
+      right_edge.translate_axis (corrected_slope * (width-thickness), Y_AXIS);
+      molecule.add_molecule(right_edge);
+
+      Molecule bottom_edge =
+	Lookup::horizontal_slope (width, corrected_slope, thickness);
+      bottom_edge.translate_axis (-0.5*height, Y_AXIS);
+      molecule.add_molecule (bottom_edge);
+
+      Molecule top_edge =
+	Lookup::horizontal_slope (width, corrected_slope, thickness);
+      top_edge.translate_axis (+0.5*height, Y_AXIS);
+      molecule.add_molecule (top_edge);
+    }
+  molecule.translate_axis (ypos_correction, Y_AXIS);
+  return molecule;
+}
+
+void
+add_ledger_lines (Grob *me, Molecule *out, int pos, Real offs,
+		  bool ledger_take_space)
+{
+  int interspaces = Staff_symbol_referencer::line_count (me)-1;
+  if (abs (pos) - interspaces > 1)
+    {
+      Interval hd = out->extent (X_AXIS);
+      Real left_ledger_protusion = hd.length ()/4;
+      Real right_ledger_protusion = left_ledger_protusion;
+
+      Interval l_extents = Interval (hd[LEFT] - left_ledger_protusion,
+				     hd[RIGHT] + right_ledger_protusion);
+      Molecule ledger_lines =
+	Note_head::brew_ledger_lines (me, pos, interspaces,
+				      l_extents,
+				      ledger_take_space);
+      ledger_lines.translate_axis (offs, Y_AXIS);
+      out->add_molecule (ledger_lines);
+    }
+}
+
+Molecule
+internal_brew_primitive (Grob *me, bool ledger_take_space)
+{
+  SCM primitive_scm = me->get_grob_property ("primitive");
+  if (primitive_scm == SCM_EOL)
+    {
+      programming_error ("Mensural_ligature: undefined primitive -> ignoring grob");
+      return Molecule ();
+    }
+
+  Molecule out;
+  int primitive = gh_scm2int (primitive_scm);
+  int delta_pitch = 0;
+  Real thickness = 0.0;
+  Real flexa_width = 0.0;
+  Real staff_space = Staff_symbol_referencer::staff_space (me);
+  if (primitive & MLP_ANY)
+    {
+      SCM thickness_scm = me->get_grob_property ("thickness");
+      if (thickness_scm != SCM_EOL)
+	{
+	  thickness = gh_scm2double (thickness_scm);
+	}
+      else
+	{
+	  programming_error (_f ("Mensural_ligature: thickness undefined on flexa %d; assuming 1.4", primitive));
+	  thickness = 1.4 * me->paper_l ()->get_var ("linethickness");
+	}
+    }
+
+  if (primitive & MLP_FLEXA)
+    {
+      SCM delta_pitch_scm = me->get_grob_property ("delta-pitch");
+      if (delta_pitch_scm != SCM_EOL)
+	{
+	  delta_pitch = gh_scm2int (delta_pitch_scm);
+	}
+      else
+	{
+	  programming_error (_f ("Mensural_ligature: delta-pitch undefined on flexa %d; assuming 0", primitive));
+	  delta_pitch = 0;
+	}
+
+      SCM flexa_width_scm = me->get_grob_property ("flexa-width");
+      if (flexa_width_scm != SCM_EOL)
+	{
+	  flexa_width = gh_scm2double (flexa_width_scm);
+	}
+      else
+	{
+	  programming_error (_f ("Mensural_ligature: flexa-width undefined on flexa %d; assuming 2.0", primitive));
+	  flexa_width = 2.0 * staff_space;
+	}
+    }
+
+  switch (primitive)
+    {
+      case MLP_NONE:
+	return Molecule();
+      case MLP_BB:
+	out = brew_flexa (me, delta_pitch, false,
+			  flexa_width, thickness, true, DOWN);
+	break;
+      case MLP_sc:
+	out = Font_interface::get_default_font (me)->find_by_name ("noteheads--2mensural");
+	break;
+      case MLP_ss:
+	out = Font_interface::get_default_font (me)->find_by_name ("noteheads--1mensural");
+	break;
+      case MLP_cs:
+	out = Font_interface::get_default_font (me)->find_by_name ("noteheads-lmensural");
+	break;
+      case MLP_SS:
+	out = brew_flexa (me, delta_pitch, false,
+			  flexa_width, thickness, true, UP);
+	break;
+      case MLP_LB:
+	out = brew_flexa (me, delta_pitch, false,
+			  flexa_width, thickness, false, CENTER);
+	break;
+      default:
+	programming_error (_f ("Mensural_ligature: unexpected case fall-through"));
+	return Molecule ();
+    }
+
+  SCM join_left_scm = me->get_grob_property ("join-left");
+  if (join_left_scm != SCM_EOL)
+    {
+      int join_left = gh_scm2int (join_left_scm);
+      if (!join_left)
+	programming_error (_f ("Menusral_ligature: (join_left == 0)"));
+      Real blotdiameter = (me->paper_l ()->get_var ("blotdiameter"));
+      Interval x_extent = Interval (0, thickness);
+      Interval y_extent = (join_left > 0) ?
+	Interval (-join_left * 0.5 * staff_space, 0) :
+	Interval (0, -join_left * 0.5 * staff_space);
+      Box stem_box (x_extent, y_extent);
+
+      Molecule stem =
+	Lookup::roundfilledbox (stem_box, blotdiameter);
+      out.add_molecule (stem);
+    }
+
+  int pos = (int)rint (Staff_symbol_referencer::position_f (me));
+  add_ledger_lines(me, &out, pos, 0, ledger_take_space);
+  if (primitive & MLP_FLEXA)
+    {
+      pos += delta_pitch;
+      add_ledger_lines(me, &out, pos, 0.5*delta_pitch, ledger_take_space);
+    }
+
+  return out;
+}
+
+MAKE_SCHEME_CALLBACK (Mensural_ligature, brew_ligature_primitive, 1);
+SCM
+Mensural_ligature::brew_ligature_primitive (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  return internal_brew_primitive (me, false).smobbed_copy ();
+}
+
+MAKE_SCHEME_CALLBACK (Mensural_ligature, brew_molecule, 1);
+SCM
+Mensural_ligature::brew_molecule (SCM smob)
+{
+  return SCM_EOL;
+}
+
+ADD_INTERFACE(Mensural_ligature, "mensural-ligature-interface",
+	      "A mensural ligature",
+	      "thickness flexa-width");
diff -purN ../lilypond-1.5.56/lily/molecule.cc ./lily/molecule.cc
--- ../lilypond-1.5.56/lily/molecule.cc	Sun Mar 24 21:46:54 2002
+++ ./lily/molecule.cc	Sun May 19 02:12:05 2002
@@ -135,9 +135,14 @@ Molecule::add_at_edge (Axis a, Direction
   add_molecule (toadd);
 }
 
-/* ly_?  Thought we had the ly_ prefix for wrapping/adding to gh_ */
-SCM
-Molecule::ly_set_molecule_extent_x (SCM mol, SCM axis, SCM np)
+LY_DEFINE(ly_set_molecule_extent_x,"ly-set-molecule-extent!", 3 , 0, 0, 
+	  (SCM mol, SCM axis, SCM np),
+	  "Set the extent (@var{extent} must be a pair of numbers) of @var{mol} in 
+@var{axis} direction (0 or 1 for x- and y-axis respectively).
+
+Note that an extent @code{(A . B)} is an interval and hence @code{A} is
+smaller than @code{B}, and is often negative.
+5")
 {
   Molecule* m = unsmob_molecule (mol);
   SCM_ASSERT_TYPE (m, mol, SCM_ARG1, __FUNCTION__, "molecule");
@@ -150,8 +155,11 @@ Molecule::ly_set_molecule_extent_x (SCM 
   return SCM_UNDEFINED;
 }
 
-SCM
-Molecule::ly_get_molecule_extent (SCM mol, SCM axis)
+LY_DEFINE(ly_get_molecule_extent,
+	  "ly-get-molecule-extent", 2 , 0, 0,  (SCM mol, SCM axis),
+	  "Return a pair of numbers signifying the extent of @var{mol} in
+@var{axis} direction (0 or 1 for x and y axis respectively).
+")
 {
   Molecule *m = unsmob_molecule (mol);
   SCM_ASSERT_TYPE (m, mol, SCM_ARG1, __FUNCTION__, "molecule");
@@ -161,9 +169,14 @@ Molecule::ly_get_molecule_extent (SCM mo
 }
 
 
-SCM
-Molecule::ly_molecule_combined_at_edge (SCM first, SCM axis, SCM direction,
-					SCM second, SCM padding)
+LY_DEFINE(ly_molecule_combined_at_edge,
+	  "ly-combine-molecule-at-edge",
+	  5 , 0, 0,  (SCM first, SCM axis, SCM direction,
+		      SCM second, SCM padding),
+	  "Construct a molecule by putting @var{second} next to
+@var{first}. @var{axis} can be 0 (x-axis) or 1 (y-axis), @var{direction} can be
+-1 (left or down) or 1 (right or up).  @var{padding} specifies extra
+space to add in between measured in global staff space.")
 
 {
   Molecule * m1 = unsmob_molecule (first);
@@ -184,8 +197,13 @@ Molecule::ly_molecule_combined_at_edge (
   return result.smobbed_copy ();
 }
 
-SCM
-ly_add_molecule (SCM first, SCM second)
+/*
+  FIXME: support variable number of arguments "
+ */
+LY_DEFINE(ly_add_molecule , 
+	  "ly-add-molecule", 2, 0,0,(SCM first, SCM second),
+	  "Combine two molecules."
+	  )
 {
   Molecule * m1 = unsmob_molecule (first);
   Molecule * m2 = unsmob_molecule (second);
@@ -200,9 +218,9 @@ ly_add_molecule (SCM first, SCM second)
   return result.smobbed_copy ();
 }
 
-
-SCM
-ly_make_molecule (SCM expr, SCM xext, SCM yext)
+LY_DEFINE(ly_make_molecule,
+	  "ly-make-molecule", 3, 0, 0,  (SCM expr, SCM xext, SCM yext),
+	  "")
 {
   SCM_ASSERT_TYPE (ly_number_pair_p (xext), xext, SCM_ARG2, __FUNCTION__, "number pair");
   SCM_ASSERT_TYPE (ly_number_pair_p (yext), yext, SCM_ARG3, __FUNCTION__, "number pair");  
@@ -222,16 +240,16 @@ fontify_atom (Font_metric * met, SCM f)
 			ly_quote_scm (met->description_), f, SCM_UNDEFINED);
 }
 
-SCM
-ly_fontify_atom (SCM met, SCM f)
+LY_DEFINE(ly_fontify_atom,"ly-fontify-atom", 2, 0, 0, 
+	  (SCM met, SCM f),
+	  "Add a font selection command for the font metric @var{met} to @var{f}.")
 {
   SCM_ASSERT_TYPE(unsmob_metrics (met), met, SCM_ARG1, __FUNCTION__, "font metric");
 
   return fontify_atom (unsmob_metrics (met), f);
 }
-
-SCM
-ly_align_to_x (SCM mol, SCM axis, SCM dir)
+LY_DEFINE(ly_align_to_x,"ly-align-to!", 3, 0, 0,  (SCM mol, SCM axis, SCM dir),
+	  "Align @var{mol} using its own extents.")
 {
   SCM_ASSERT_TYPE(unsmob_molecule (mol), mol, SCM_ARG1, __FUNCTION__, "molecule");
   SCM_ASSERT_TYPE(ly_axis_p(axis), axis, SCM_ARG2, __FUNCTION__, "axis");
@@ -243,19 +261,6 @@ ly_align_to_x (SCM mol, SCM axis, SCM di
 }
 
 
-static void
-molecule_init ()
-{
-  scm_c_define_gsubr ("ly-make-molecule", 3, 0, 0, (Scheme_function_unknown) ly_make_molecule);
-  scm_c_define_gsubr ("ly-fontify-atom", 2, 0, 0, (Scheme_function_unknown) ly_fontify_atom);
-  scm_c_define_gsubr ("ly-align-to!", 3, 0, 0, (Scheme_function_unknown) ly_align_to_x);
-  scm_c_define_gsubr ("ly-add-molecule", 2, 0,0,(Scheme_function_unknown) ly_add_molecule);
-  scm_c_define_gsubr ("ly-combine-molecule-at-edge", 5 , 0, 0, (Scheme_function_unknown) Molecule::ly_molecule_combined_at_edge);
-  scm_c_define_gsubr ("ly-set-molecule-extent!", 3 , 0, 0, (Scheme_function_unknown) Molecule::ly_set_molecule_extent_x);
-  scm_c_define_gsubr ("ly-get-molecule-extent", 2 , 0, 0, (Scheme_function_unknown) Molecule::ly_get_molecule_extent);
-}
-ADD_SCM_INIT_FUNC (molecule,molecule_init);
-
 
 /*
   Hmm... maybe this is not such a good idea ; stuff can be empty,
@@ -284,9 +289,8 @@ IMPLEMENT_SIMPLE_SMOBS (Molecule);
 
 
 int
-Molecule::print_smob (SCM s, SCM port, scm_print_state *)
+Molecule::print_smob (SCM , SCM port, scm_print_state *)
 {
-     
   scm_puts ("#<Molecule ", port);
 #if 0
   Molecule  *r = (Molecule *) ly_cdr (s);
diff -purN ../lilypond-1.5.56/lily/moment.cc ./lily/moment.cc
--- ../lilypond-1.5.56/lily/moment.cc	Wed May 15 12:31:59 2002
+++ ./lily/moment.cc	Sun May 19 02:12:05 2002
@@ -48,8 +48,15 @@ Moment::print_smob (SCM s, SCM port, scm
 /*
   TODO: add optional factor argument.
  */
-SCM
-make_rational (SCM n, SCM d)
+LY_DEFINE (make_moment,"make-moment", 2,0,0, (SCM n, SCM d),
+	   "create the rational number with main timing @var{n}/@var{d}. 
+
+
+Moment is a point in musical time. It is consists of a pair of
+rationals (@var{m},@var{g}), where @var{m} is the timing for the  main
+notes, and @var{g} the timing for  grace notes. In absence of grace
+notes, @var{g} is zero.
+")
 {
   Moment m (Rational (1,1));
 
@@ -65,15 +72,6 @@ make_rational (SCM n, SCM d)
   return m.smobbed_copy ();
 }
 
-
-void
-init_moments ()
-{
-  scm_c_define_gsubr ("make-moment", 2 , 0, 0, (Scheme_function_unknown) make_rational);
-}
-
-ADD_SCM_INIT_FUNC (moms,init_moments);
-
 SCM
 Moment::equal_p (SCM a, SCM b)
 {
diff -purN ../lilypond-1.5.56/lily/music.cc ./lily/music.cc
--- ../lilypond-1.5.56/lily/music.cc	Fri Mar 22 01:28:43 2002
+++ ./lily/music.cc	Sun May 19 02:12:05 2002
@@ -206,8 +206,9 @@ Music::~Music ()
   
 }
 
-SCM
-ly_get_mus_property (SCM mus, SCM sym)
+LY_DEFINE(ly_get_mus_property,
+	  "ly-get-mus-property", 2, 0, 0,  (SCM mus, SCM sym),
+	  "Get the property @var{sym} of music expression @var{mus}.")
 {
   Music * sc = unsmob_music (mus);
   SCM_ASSERT_TYPE(sc, mus, SCM_ARG1, __FUNCTION__, "grob");
@@ -217,9 +218,10 @@ ly_get_mus_property (SCM mus, SCM sym)
 
 }
 
-
-SCM
-ly_set_mus_property (SCM mus, SCM sym, SCM val)
+LY_DEFINE(ly_set_mus_property,
+	  "ly-set-mus-property", 3, 0, 0,
+	  (SCM mus, SCM sym, SCM val),
+	  "Set property @var{sym} in music expression @var{mus} to @var{val}.")
 {
   Music * sc = unsmob_music (mus);
   SCM_ASSERT_TYPE(sc, mus, SCM_ARG1, __FUNCTION__, "grob");
@@ -236,8 +238,17 @@ ly_set_mus_property (SCM mus, SCM sym, S
 
 
 // to do  property args 
-SCM
-ly_make_music (SCM type)
+LY_DEFINE(ly_make_music,
+	  "ly-make-music", 1, 0, 0,  (SCM type),
+	  "
+Make a music object/expression of type @var{name}. Warning: this
+interface will likely change in the near future.
+
+
+
+Music is the data type that music expressions are stored in. The data
+type does not yet offer many manipulations.
+")
 {
   SCM_ASSERT_TYPE(gh_string_p(type), type, SCM_ARG1, __FUNCTION__, "string");
   
@@ -248,8 +259,9 @@ ly_make_music (SCM type)
   return s;
 }
 
-SCM
-ly_music_name (SCM mus)
+LY_DEFINE(ly_music_name, "ly-music-name", 1, 0, 0, 
+  (SCM mus),
+  "Return the name of @var{music}.")
 {
   Music * m = unsmob_music (mus);
   SCM_ASSERT_TYPE(m, mus, SCM_ARG1, __FUNCTION__ ,"music");
@@ -258,8 +270,8 @@ ly_music_name (SCM mus)
   return ly_str02scm (nm);
 }
 
-SCM
-ly_music_list_p (SCM l)
+LY_DEFINE(ly_music_list_p,"music-list?", 1, 0, 0, 
+  (SCM l),"Type predicate: return true if @var{l} is a list of music objects.")
 {
   if (scm_list_p (l) != SCM_BOOL_T)
     return SCM_BOOL_F;
@@ -272,15 +284,4 @@ ly_music_list_p (SCM l)
     }
   return SCM_BOOL_T;
 }
-
-static void
-init_functions ()
-{
-  scm_c_define_gsubr ("music-list?", 1, 0, 0, (Scheme_function_unknown)ly_music_list_p);  
-  scm_c_define_gsubr ("ly-get-mus-property", 2, 0, 0, (Scheme_function_unknown)ly_get_mus_property);
-  scm_c_define_gsubr ("ly-set-mus-property", 3, 0, 0, (Scheme_function_unknown)ly_set_mus_property);
-  scm_c_define_gsubr ("ly-make-music", 1, 0, 0, (Scheme_function_unknown)ly_make_music);
-  scm_c_define_gsubr ("ly-music-name", 1, 0, 0, (Scheme_function_unknown)ly_music_name);    
-}
-ADD_SCM_INIT_FUNC (musicscm,init_functions);
 ADD_MUSIC(Music);
diff -purN ../lilypond-1.5.56/lily/note-heads-engraver.cc ./lily/note-heads-engraver.cc
--- ../lilypond-1.5.56/lily/note-heads-engraver.cc	Sun Mar 24 21:46:54 2002
+++ ./lily/note-heads-engraver.cc	Sun May 19 02:16:29 2002
@@ -34,11 +34,14 @@ protected:
   virtual void process_music ();
 
   virtual void stop_translation_timestep ();
-};
 
+private:
+  bool in_ligature;
+};
 
 Note_heads_engraver::Note_heads_engraver()
 {
+  in_ligature = 0;
 }
 
 bool
@@ -53,6 +56,19 @@ Note_heads_engraver::try_music (Music *m
     {
       return note_req_l_arr_.size ();
     }
+  else if (Span_req *req_ = dynamic_cast<Span_req*> (m))
+    {
+      if (scm_equal_p (req_->get_mus_property ("span-type"),
+		       ly_str02scm ("abort")) == SCM_BOOL_T)
+	{
+	  in_ligature = 0;
+	}
+      else if (scm_equal_p (req_->get_mus_property ("span-type"),
+			    ly_str02scm ("ligature")) == SCM_BOOL_T)
+	{
+	  in_ligature = (req_->get_span_dir () == START);
+	}
+    }
   
   return false;
 }
@@ -63,8 +79,9 @@ Note_heads_engraver::process_music ()
 {
   for (int i=0; i < note_req_l_arr_.size (); i++)
     {
-      Item *note_p  = new Item (get_property ("NoteHead"));
-      
+      Item *note_p =
+	new Item (get_property ((in_ligature) ? "LigatureHead" : "NoteHead"));
+
       Music * req = note_req_l_arr_[i];
       
       Duration dur = *unsmob_duration (req->get_mus_property ("duration"));
diff -purN ../lilypond-1.5.56/lily/parser.yy ./lily/parser.yy
--- ../lilypond-1.5.56/lily/parser.yy	Fri May 17 00:38:05 2002
+++ ./lily/parser.yy	Sun May 19 02:16:29 2002
@@ -1127,6 +1127,26 @@ command_element:
 		$$-> set_spot (THIS->here_input ());
 		$1-> set_spot (THIS->here_input ());
 	}
+	| E_LEFTSQUARE {
+		Span_req *l = new Span_req;
+		l->set_span_dir (START);
+		l->set_mus_property ("span-type", ly_str02scm ("ligature"));
+		l->set_spot (THIS->here_input ());
+
+		$$ = new Request_chord (SCM_EOL);
+		$$->set_mus_property ("elements", gh_cons (l->self_scm (), SCM_EOL));
+		$$->set_spot (THIS->here_input ());
+	}
+	| E_RIGHTSQUARE {
+		Span_req *l = new Span_req;
+		l->set_span_dir (STOP);
+		l->set_mus_property ("span-type", ly_str02scm ("ligature"));
+		l->set_spot (THIS->here_input ());
+
+		$$ = new Request_chord (SCM_EOL);
+		$$->set_mus_property ("elements", gh_cons (l->self_scm (), SCM_EOL));
+		$$->set_spot (THIS->here_input ());
+	}
 	| E_BACKSLASH {
 		$$ = new Music (gh_list (gh_cons (ly_symbol2scm ("name"), ly_symbol2scm ("separator")), SCM_UNDEFINED));
 		$$->set_spot (THIS->here_input ());
@@ -1249,19 +1269,6 @@ shorthand_command_req:
 		b->set_mus_property ("span-type", ly_str02scm ("beam"));
 		$$ = b;
 	}
-	| E_LEFTSQUARE {
-		Span_req *b = new Span_req;
-		b->set_span_dir (START);
-		b->set_mus_property ("span-type", ly_str02scm ("ligature-bracket"));
-		$$ = b;
-		THIS->last_ligature_start_ = b->self_scm ();
-	}
-	| E_RIGHTSQUARE {
-		Span_req *b = new Span_req;
-		b->set_span_dir (STOP);
-		b->set_mus_property ("span-type", ly_str02scm ("ligature-bracket"));
-		$$ = b;
-	}
 	| BREATHE {
 		$$ = new Breathing_sign_req;
 	}
diff -purN ../lilypond-1.5.56/lily/pitch.cc ./lily/pitch.cc
--- ../lilypond-1.5.56/lily/pitch.cc	Sun Apr 21 01:02:56 2002
+++ ./lily/pitch.cc	Sun May 19 02:12:06 2002
@@ -219,14 +219,13 @@ Pitch::down_to (int notename)
     }
   notename_i_ = notename;
 }
-
-/*
-  can't use macro MAKE_SCHEME_CALLBACK().
-   messy stuff since Pitch::transpose is overloaded.
- */
-
-SCM
-pitch_transpose (SCM p, SCM delta)
+ 
+LY_DEFINE(ly_pitch_transpose,
+	  "ly-transpose-pitch", 2, 0, 0,
+	  (SCM p, SCM delta),
+	  "Transpose @var{p} by the amount @var{delta}, where @var{delta} is the
+pitch that central C is transposed to.
+")
 {
   Pitch* t = unsmob_pitch (p);
   Pitch *d = unsmob_pitch (delta);
@@ -238,12 +237,6 @@ pitch_transpose (SCM p, SCM delta)
   return tp.smobbed_copy ();
 }
 
-SCM
-Pitch::transpose (SCM p, SCM d)
-{
-  return pitch_transpose (p,d);
-}
-
 /****************************************************************/
 
 
@@ -297,8 +290,16 @@ Pitch::less_p (SCM p1, SCM p2)
 /*
   should add optional args
  */
-static SCM
-make_pitch (SCM o, SCM n, SCM a)
+
+LY_DEFINE(make_pitch, "make-pitch", 3, 0, 0, 
+	  (SCM o, SCM n, SCM a),
+	  "
+@var{octave} is specified by an integer, zero for the octave containing
+middle C.  @var{note} is a number from 0 to 6, with 0 corresponding to C
+and 6 corresponding to B.  The shift is zero for a natural, negative for
+flats, or positive for sharps.
+
+")
 {
   SCM_ASSERT_TYPE(gh_number_p(o), o, SCM_ARG1, __FUNCTION__, "number");
   SCM_ASSERT_TYPE(gh_number_p(n), n, SCM_ARG2, __FUNCTION__, "number");
@@ -308,8 +309,10 @@ make_pitch (SCM o, SCM n, SCM a)
   return p.smobbed_copy ();
 }
 
-static SCM
-pitch_octave (SCM pp)
+
+LY_DEFINE(pitch_octave, "pitch-octave", 1, 0, 0, 
+	  (SCM pp),
+	  "extract the octave from pitch @var{p}.")
 {
   Pitch *p = unsmob_pitch (pp);
    SCM_ASSERT_TYPE(p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
@@ -318,8 +321,9 @@ pitch_octave (SCM pp)
   return gh_int2scm (q);
 }
 
-static SCM
-pitch_alteration (SCM pp)
+LY_DEFINE(pitch_alteration, "pitch-alteration", 1, 0, 0, 
+	  (SCM pp),
+	  "extract the alteration from pitch  @var{p}.")
 {
   Pitch *p = unsmob_pitch (pp);
   SCM_ASSERT_TYPE(p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
@@ -328,8 +332,9 @@ pitch_alteration (SCM pp)
   return gh_int2scm (q);
 }
 
-static SCM
-pitch_notename (SCM pp)
+LY_DEFINE(pitch_notename, "pitch-notename", 1, 0, 0, 
+	  (SCM pp),
+	  "extract the note name from pitch  @var{pp}.")
 {
   Pitch *p = unsmob_pitch (pp);
   SCM_ASSERT_TYPE(p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
@@ -338,8 +343,9 @@ pitch_notename (SCM pp)
   return gh_int2scm (q);
 }
 
-static SCM
-pitch_semitones (SCM pp)
+LY_DEFINE(pitch_semitones,  "pitch-semitones", 1, 0, 0, 
+	  (SCM pp),
+	  "calculate the number of semitones of @var{p} from central C.")
 {
   Pitch *p = unsmob_pitch (pp);
    SCM_ASSERT_TYPE(p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
@@ -348,29 +354,13 @@ pitch_semitones (SCM pp)
 
   return gh_int2scm (q);
 }
-SCM pitch_less_proc;
-static SCM
-pitch_less (SCM p1, SCM p2)
-{
-  return Pitch::less_p (ly_car (p1),  ly_car (p2));
-}
-
 
-static void
-add_funcs ()
+LY_DEFINE(pitch_less, "pitch<?", 2,0,0, (SCM p1, SCM p2),
+	  "Is @var{p1} lower than @var{p2}? This uses lexicographic ordening.")
 {
-  // should take list?: (make-pitch ' (octave name accidental))
-  scm_c_define_gsubr ("make-pitch", 3, 0, 0, (Scheme_function_unknown)make_pitch);
-  scm_c_define_gsubr ("pitch-octave", 1, 0, 0, (Scheme_function_unknown)pitch_octave);
-  scm_c_define_gsubr ("pitch-notename", 1, 0, 0, (Scheme_function_unknown)pitch_notename);
-  scm_c_define_gsubr ("pitch-alteration", 1, 0, 0, (Scheme_function_unknown)pitch_alteration);
-  scm_c_define_gsubr ("pitch-semitones", 1, 0, 0, (Scheme_function_unknown)pitch_semitones);
-  scm_c_define_gsubr ("Pitch::transpose", 2, 0, 0, (Scheme_function_unknown) pitch_transpose);
-  pitch_less_proc = gh_new_procedure2_0 ("pitch-less", &pitch_less);
+  return Pitch::less_p (ly_car (p1),  ly_car (p2));
 }
 
-ADD_SCM_INIT_FUNC (pitch, add_funcs);
-
 SCM
 Pitch::smobbed_copy ()const
 {
diff -purN ../lilypond-1.5.56/lily/scm-option.cc ./lily/scm-option.cc
--- ../lilypond-1.5.56/lily/scm-option.cc	Wed May 15 12:26:52 2002
+++ ./lily/scm-option.cc	Sun May 19 02:12:07 2002
@@ -51,8 +51,20 @@ Switch on any experimental features.  No
 
  */
 
-SCM
-set_lily_option (SCM var, SCM val)
+LY_DEFINE(set_lily_option,"set-lily-option", 2, 0, 0,  (SCM var, SCM val),
+	  "Set a global option for the program. Supported options  include
+
+
+@table @code
+@item help
+List all options.
+@item midi-debug
+If set to true, generate human  readable MIDI
+@end table
+
+This function is useful to call from the command line: @code{lilypond -e
+\"(set-lily-option 'midi-debug #t)\"}.
+")
 {
   /*
     Scheme option usage:
@@ -114,13 +126,5 @@ possible options for SYMBOL are :
 }
 
 
-static void
-init_functions ()
-{
-  scm_c_define_gsubr ("set-lily-option", 2, 0, 0, (Scheme_function_unknown)set_lily_option);
-}
-
-
-ADD_SCM_INIT_FUNC (init_functions_sopt, init_functions);
 
 
diff -purN ../lilypond-1.5.56/lily/stem.cc ./lily/stem.cc
--- ../lilypond-1.5.56/lily/stem.cc	Sat May  4 14:57:28 2002
+++ ./lily/stem.cc	Sun May 19 02:12:07 2002
@@ -9,7 +9,7 @@
   TODO: This is way too hairy
 */
 
-#include <math.h>		// m_pi
+#include <math.h>		// rint
 
 #include "lookup.hh"
 #include "directional-element-interface.hh"
@@ -753,6 +753,10 @@ Stem::calc_stem_info (Grob*me) 
   info.ideal_y = chord_start_f (me);
 
   // for simplicity, we calculate as if dir == UP
+
+  /*
+    UGH. This confuses issues more. fixme. --hwn
+   */
   info.ideal_y *= beam_dir;
   SCM grace_prop = me->get_grob_property ("grace");
 
@@ -776,6 +780,10 @@ Stem::calc_stem_info (Grob*me) 
 
   Real stem_length =  a[multiplicity <? (a.size () - 1)] * staff_space;
 
+
+  /*
+    This sucks -- On a kneed beam, *all* stems are kneed, not half of them.
+   */
   if (!beam_dir || (beam_dir == Directional_element_interface::get (me)))
     /* normal beamed stem */
     {
@@ -816,12 +824,13 @@ Stem::calc_stem_info (Grob*me) 
   else
     /* knee */
     {
-      info.ideal_y -= thick;
-      info.max_y = info.ideal_y;
-      info.min_y = - 1000 ; // INT_MAX;
+      info.ideal_y -= thick + stem_length;
+      info.max_y = info.ideal_y - minimum_length;
 
-      info.ideal_y -= stem_length;
-      info.max_y -= minimum_length;
+      /*
+	We shouldn't invert the stems, so we set minimum at 0. 
+       */
+      info.min_y = 0.5;
     }
   
   info.ideal_y = (info.max_y <? info.ideal_y) >? info.min_y;
diff -purN ../lilypond-1.5.56/lily/system.cc ./lily/system.cc
--- ../lilypond-1.5.56/lily/system.cc	Wed Apr 10 19:25:36 2002
+++ ./lily/system.cc	Sun May 19 02:12:07 2002
@@ -260,23 +260,6 @@ System::break_into_pieces (Array<Column_
 }
 
 
-#define GLOBAL_SYMBOL(cname, name)  \
-SCM cname ;					\
-void \
-cname ## _init_func ()				\
-{						\
-  cname = ly_symbol2scm (name);			\
-  scm_permanent_object (cname);			\
-}						\
-ADD_SCM_INIT_FUNC (cname,cname ## _init_func);\
-
-
-GLOBAL_SYMBOL (offset_sym , "translate-molecule");
-GLOBAL_SYMBOL (placebox_sym , "placebox");
-GLOBAL_SYMBOL (combine_sym , "combine-molecule");
-
-
-
 void
 System::output_molecule (SCM expr, Offset o)
 {
@@ -317,7 +300,7 @@ System::output_molecule (SCM expr, Offse
       else
 	{
 	  pscore_l_->outputter_l_->
-	    output_scheme (scm_list_n (placebox_sym,
+	    output_scheme (scm_list_n (ly_symbol2scm ("placebox"),
 				    gh_double2scm (o[X_AXIS]),
 				    gh_double2scm (o[Y_AXIS]),
 				    expr,
diff -purN ../lilypond-1.5.56/lily/translator-ctors.cc ./lily/translator-ctors.cc
--- ../lilypond-1.5.56/lily/translator-ctors.cc	Fri Feb  1 19:16:16 2002
+++ ./lily/translator-ctors.cc	Sun May 19 02:12:08 2002
@@ -19,9 +19,9 @@
  */
 Dictionary<Translator*> *global_translator_dict_p=0;
 
-
-SCM
-ly_get_all_translators ()
+LY_DEFINE(ly_get_all_translators,"ly-get-all-translators", 0, 0, 0,  (),
+	  "Return an list of a all translator objects that may be instantiated
+during a lilypond run.")
 {
   SCM l = SCM_EOL;
   for (std::map<String,Translator*>::const_iterator (ci (global_translator_dict_p->begin()));
@@ -32,14 +32,6 @@ ly_get_all_translators ()
   return l;
 }
 
-static void
-all_trans_init()
-{
-  scm_c_define_gsubr ("ly-get-all-translators", 0, 0, 0, (Scheme_function_unknown) ly_get_all_translators);
-}
-
-ADD_SCM_INIT_FUNC(all_trans_init,all_trans_init);
-
 void
 add_translator (Translator *t)
 {
diff -purN ../lilypond-1.5.56/lily/translator-group.cc ./lily/translator-group.cc
--- ../lilypond-1.5.56/lily/translator-group.cc	Thu Mar 21 01:44:50 2002
+++ ./lily/translator-group.cc	Sun May 19 02:12:08 2002
@@ -418,9 +418,10 @@ Translator_group::finalize ()
   each (&Translator::removal_processing);
 }
 
-
-SCM
-ly_get_trans_property (SCM context, SCM name)
+LY_DEFINE(ly_get_context_property,
+	  "ly-get-context-property", 2, 0, 0,
+	  (SCM context, SCM name),
+	  "retrieve the value of @var{sym} from context @var{tr}")
 {
   Translator *t = unsmob_translator (context);
   Translator_group* tr=   dynamic_cast<Translator_group*> (t);
@@ -430,27 +431,18 @@ ly_get_trans_property (SCM context, SCM 
   return tr->internal_get_property (name);
   
 }
-SCM
-ly_set_trans_property (SCM context, SCM name, SCM val)
+
+LY_DEFINE(ly_set_context_property,
+	  "ly-set-context-property", 3, 0, 0,
+	  (SCM context, SCM name, SCM val),
+	  "set value of property @var{sym} in context @var{tr} to @var{val}.
+")
 {
   Translator *t = unsmob_translator (context);
   Translator_group* tr=   dynamic_cast<Translator_group*> (t);
 
-  SCM_ASSERT_TYPE(tr, context, SCM_ARG1, __FUNCTION__, "Translator group");
+  SCM_ASSERT_TYPE(tr, context, SCM_ARG1, __FUNCTION__, "Context");
   tr->internal_set_property (name, val);
 
   return SCM_UNSPECIFIED;
 }
-
-
-
-
-void
-add_trans_scm_funcs ()
-{
-  scm_c_define_gsubr ("ly-get-trans-property", 2, 0, 0, (Scheme_function_unknown)ly_get_trans_property);
-  scm_c_define_gsubr ("ly-set-trans-property", 3, 0, 0, (Scheme_function_unknown)ly_set_trans_property);
-}
-
-ADD_SCM_INIT_FUNC (trans_scm, add_trans_scm_funcs);
-
diff -purN ../lilypond-1.5.56/lily/translator.cc ./lily/translator.cc
--- ../lilypond-1.5.56/lily/translator.cc	Wed Mar 20 02:22:04 2002
+++ ./lily/translator.cc	Sun May 19 02:12:08 2002
@@ -139,30 +139,27 @@ Translator::mark_smob (SCM sm)
   return me->properties_scm_;
 }
 
-MAKE_SCHEME_CALLBACK(Translator,name,1);
-SCM
-Translator::name (SCM trans) 
+LY_DEFINE(ly_translator_name,
+	  "ly-translator-name", 1,0,0,  (SCM trans),
+	  "Return the type name of the translator @var{trans}.
+")
 {
-  if (unsmob_translator (trans))
-    {
-      char const* nm = classname (unsmob_translator (trans));
-      return ly_str02scm (nm);
-    }
-  return
-    SCM_EOL;
+  Translator* tr =  unsmob_translator (trans);
+  SCM_ASSERT_TYPE(tr, trans, SCM_ARG1, __FUNCTION__, "Context");
+
+  char const* nm = classname (tr);
+  return ly_str02scm (nm);
 }
 
-MAKE_SCHEME_CALLBACK(Translator,description,1)
-SCM
-Translator::description (SCM me) 
+LY_DEFINE(ly_translator_description,
+	  "ly-translator-description",
+	  1,0,0, (SCM me),
+	  "Return an alist of properties of  translator @var{me}.")
 {
-  if (unsmob_translator (me))
-    return unsmob_translator(me)->translator_description ();
-  else
-    {
-      programming_error ("Translator::description ()");  
-      return SCM_EOL;
-    }
+  Translator *tr =unsmob_translator (me);
+  SCM_ASSERT_TYPE (tr, me, SCM_ARG1, __FUNCTION__, "Context");
+
+  return tr->translator_description ();
 }
 
 SCM
@@ -177,7 +174,7 @@ Translator::print_smob (SCM s, SCM port,
   Translator *sc = (Translator *) ly_cdr (s);
      
   scm_puts ("#<Translator ", port);
-  scm_display (name (s), port);
+  scm_display (ly_translator_name (s), port);
   scm_display (sc->simple_trans_list_, port);
   /*
     don't try to print properties, that is too much hassle.
diff -purN ../lilypond-1.5.56/mf/parmesan-heads.mf ./mf/parmesan-heads.mf
--- ../lilypond-1.5.56/mf/parmesan-heads.mf	Sat Mar  2 02:43:00 2002
+++ ./mf/parmesan-heads.mf	Sun May 19 02:16:29 2002
@@ -25,7 +25,7 @@ define_pixels(noteheight);
 %
 brevis_wid# := 2 staff_space#;
 
-def draw_brevis(expr brevwid) =
+def draw_neo_brevis(expr brevwid) =
 	save beamheight, head_width;
 	save holeheight, stem_width;
 	save serif_size, serif_protrude;
@@ -66,12 +66,26 @@ def draw_brevis(expr brevwid) =
 enddef;
 
 
+def draw_neo_left_stemmed_head (expr wid) =
+	draw_neo_brevis(wid);
+
+	x6 = x7 = head_width - stem_width/2;
+	y6 = y5;
+	y7 = y5 - 2.25staff_space;
+	pickup pencircle scaled stem_width;
+	draw z6 .. z7;
+enddef;
+
+fet_beginchar("Left stemmed notehead", "lneo_mensural", "mensuralleftstemmedhead");
+	draw_neo_left_stemmed_head (brevis_wid#)
+fet_endchar;
+
 %
 % Some sources (eg Musix/OpusTeX think that the appendage should be on
 % the left, some say right. Right wins democratically.
 %
 def draw_neo_longa (expr wid) =
-	draw_brevis(wid);
+	draw_neo_brevis(wid);
 	save theta;
 
 	x7r = head_width;
@@ -100,7 +114,7 @@ fet_beginchar("Longa notehead", "-2neo_m
 fet_endchar;
 
 fet_beginchar("Brevis notehead", "-1neo_mensural", "mensuralbrevishead")
-	draw_brevis(brevis_wid#);
+	draw_neo_brevis(brevis_wid#);
 fet_endchar;
 
 def draw_neo_mensural_black_head (expr wid) =
@@ -156,10 +170,29 @@ fet_endchar;
 
 brevis_wid# := 1 staff_space#;
 
-def draw_longa (expr wid) =
+def draw_brevis (expr wid) =
+	% TODO.  For the moment, fall back to draw_neo_brevis.
+	draw_neo_brevis(wid);
+enddef;
+
+def draw_left_stemmed_head (expr wid) =
 	draw_brevis(wid);
 	save theta;
 
+	x6 = x7 = stem_width/2;
+	y6 = y5;
+	y7 = y5 - 2.25staff_space;
+	pickup pencircle scaled stem_width;
+	draw z6 .. z7;
+enddef;
+
+fet_beginchar("Left stemmed notehead", "lmensural", "mensuralleftstemmedhead");
+	draw_left_stemmed_head (brevis_wid#)
+fet_endchar;
+
+def draw_longa (expr wid) =
+	draw_brevis(wid);
+
 	x6 = x7 = head_width - stem_width/2;
 	y6 = y5;
 	y7 = y5 - 2.25staff_space;
diff -purN ../lilypond-1.5.56/scm/backend-documentation-lib.scm ./scm/backend-documentation-lib.scm
--- ../lilypond-1.5.56/scm/backend-documentation-lib.scm	Sun Apr 21 15:52:04 2002
+++ ./scm/backend-documentation-lib.scm	Sun May 19 02:12:29 2002
@@ -95,7 +95,7 @@
      (let* ((grob name)
 	    (engravers (filter-list
 			(lambda (x) (engraver-makes-grob? name x)) all-engravers-list))
-	    (engraver-names (map Translator::name engravers))
+	    (engraver-names (map ly-translator-name engravers))
 	    )
 
        (string-append
@@ -108,7 +108,7 @@
 
 
 (define (engraver-makes-grob? name-symbol grav)
-  (memq name-symbol (assoc 'grobs-created (Translator::description grav)))
+  (memq name-symbol (assoc 'grobs-created (ly-translator-description grav)))
   )
 
 (define (document-all-grobs name)
@@ -209,10 +209,7 @@
        (texi (description-list->texi descs))
        )
     
-    (string-append
-     (node name)
-     (texi-section 1 name #f)
-     texi)
+     texi
   )
   )
 
diff -purN ../lilypond-1.5.56/scm/engraver-documentation-lib.scm ./scm/engraver-documentation-lib.scm
--- ../lilypond-1.5.56/scm/engraver-documentation-lib.scm	Sat Oct 13 00:35:22 2001
+++ ./scm/engraver-documentation-lib.scm	Sun May 19 02:12:33 2002
@@ -22,11 +22,11 @@
 
   (let* (
 	 (level (if (eq? where 'context) 3 2))
-	 (propsr (cdr (assoc 'properties-read (Translator::description engraver))))
-	 (propsw (cdr (assoc 'properties-written (Translator::description engraver))))	 
-	 (name (Translator::name engraver))
+	 (propsr (cdr (assoc 'properties-read (ly-translator-description engraver))))
+	 (propsw (cdr (assoc 'properties-written (ly-translator-description engraver))))	 
+	 (name (ly-translator-name engraver))
 	 (name-sym (string->symbol name))
-	 (desc (cdr (assoc 'description (Translator::description engraver))))
+	 (desc (cdr (assoc 'description (ly-translator-description engraver))))
 	 (grobs (engraver-grobs engraver))
 	 )
 
@@ -78,7 +78,7 @@
 
 ;; First level Engraver description
 (define (document-separate-engraver top grav)
-  (let ((name (Translator::name grav)))
+  (let ((name (ly-translator-name grav)))
     (processing name)
     (string-append
      (node (engraver-name name))
@@ -88,7 +88,7 @@
 (define (find-engraver-by-name name list)
   (if (null? list)
       #f
-      (if (equal? name (Translator::name (car list)))
+      (if (equal? name (ly-translator-name (car list)))
 	  (car list)
 	  (find-engraver-by-name name (cdr list)))))
 
@@ -150,7 +150,7 @@
 
     (if (eq? eg #f)
 	'()
-	(map symbol->string (cdr (assoc 'grobs-created (Translator::description eg))))
+	(map symbol->string (cdr (assoc 'grobs-created (ly-translator-description eg))))
  	)
   ))
 
@@ -199,7 +199,7 @@
 (define all-engravers-list  (ly-get-all-translators))
 (define (document-all-engravers name)
   (let* ((gravs all-engravers-list)
-	 (names (map Translator::name gravs))
+	 (names (map ly-translator-name gravs))
 	 (doc (apply string-append
 		     (map (lambda (x) (document-separate-engraver name x))
 			  gravs))))
diff -purN ../lilypond-1.5.56/scm/function-documentation.scm ./scm/function-documentation.scm
--- ../lilypond-1.5.56/scm/function-documentation.scm	Thu Jan  1 01:00:00 1970
+++ ./scm/function-documentation.scm	Sun May 19 02:14:07 2002
@@ -0,0 +1,42 @@
+(use-modules
+ (ice-9 regex))
+
+(define (format-c-header c-h)
+  (regexp-substitute/global
+   #f "," 
+   (regexp-substitute/global #f "(SCM|\\)|\\() *" c-h 'pre "" 'post)
+   'pre " " 'post)
+  )
+
+(define (document-scheme-function name c-header doc-string)
+  (string-append
+   "@defun " (symbol->string name)  " " (format-c-header c-header) "\n"
+   doc-string
+   "\n@end defun\n\n")
+   )
+
+(define all-scheme-functions
+   (hash-fold
+    (lambda (key val prior)
+      (cons (cons key val)  prior)
+      )
+    '() (ly-get-all-function-documentation))
+   )
+
+(define (document-all-scheme-functions)
+  (let*
+      (
+
+       (fdocs (map (lambda (x)
+		(document-scheme-function (car x) (cadr x) (cddr x))
+		)
+	      all-scheme-functions)
+	 )
+       (sfdocs (sort fdocs string<?))
+       )
+
+    (apply string-append sfdocs)
+	 
+  ))
+
+
diff -purN ../lilypond-1.5.56/scm/generate-documentation.scm ./scm/generate-documentation.scm
--- ../lilypond-1.5.56/scm/generate-documentation.scm	Sun Mar 24 21:46:57 2002
+++ ./scm/generate-documentation.scm	Sun May 19 02:12:33 2002
@@ -17,9 +17,11 @@
 ;;;;;;;;;;;;;;;;
 
 (define load-files '("documentation-lib.scm"
+		     "function-documentation.scm"
 		     "engraver-documentation-lib.scm"
 		     "music-documentation-lib.scm"
-		     "backend-documentation-lib.scm"))
+		     "backend-documentation-lib.scm"
+		     ))
 
 (map load-from-path load-files)
 
@@ -34,13 +36,23 @@
 
 
 (let* ((doc (string-append
-	     (document-music "LilyPond music properties") 
- 	     (document-paper "LilyPond interpretation contexts")
- 	     (document-all-engravers "LilyPond engravers")
-	     (document-all-engraver-properties "LilyPond context properties")
- 	     (document-all-grobs "LilyPond backend")
- 	     (document-all-interfaces "LilyPond interfaces")
-	     (document-all-backend-properties "LilyPond backend properties")
+	     (document-music "music properties") 
+ 	     (document-paper "interpretation contexts")
+ 	     (document-all-engravers "engravers")
+	     (document-all-engraver-properties "context properties")
+ 	     (document-all-grobs "backend")
+ 	     (document-all-interfaces "interfaces")
+
+	     (node "backend properties")
+	     (texi-section 1 "backend properties" #f)
+
+	     (document-all-backend-properties "backend properties")
+
+	     (node "function documentation")
+	     (texi-section 1 "function documentation" #f)
+
+	     (document-all-scheme-functions)
+	     
 	     )
        )
        (name "lilypond-internals")
@@ -55,13 +67,14 @@
      ;; we can't use (dir) and top if we're included by lilypond.tely
      "LilyPond internals" name "(lilypond.info)"
      '(
-       ("LilyPond music properties" . "properties for Music representation")
-       ("LilyPond interpretation contexts" . "Hierarchy and grouping of Engravers")
-       ("LilyPond engravers" . "Engravers create Grobs")
-       ("LilyPond context properties" . "context properties")       
-       ("LilyPond backend" . "Detailed description of all Grobs")
-       ("LilyPond interfaces" . "Grob Interfaces")
-       ("LilyPond backend properties" . "Grob properties")
+       ("music properties" . "properties for Music representation")
+       ("interpretation contexts" . "Hierarchy and grouping of Engravers")
+       ("engravers" . "Engravers create Grobs")
+       ("context properties" . "context properties")       
+       ("backend" . "Detailed description of all Grobs")
+       ("interfaces" . "Grob Interfaces")
+       ("backend properties" . "Grob properties")
+       ("function documentation" . "Grob properties")       
        ("Index" . "index")
        ))
 
diff -purN ../lilypond-1.5.56/scm/grob-description.scm ./scm/grob-description.scm
--- ../lilypond-1.5.56/scm/grob-description.scm	Sun May  5 21:33:28 2002
+++ ./scm/grob-description.scm	Sun May 19 02:16:29 2002
@@ -373,14 +373,32 @@
 	(meta . ((interfaces . (key-signature-interface  font-interface  break-aligned-interface))))
 	))
 
+    (Ligature
+     . (
+	(molecule-callback . ,Ligature_bracket::brew_molecule)
+	(meta . ((interfaces . (ligature-interface))))
+	))
+
     (LigatureBracket
      . (
 	(width . 0.75)
 	(height . 0.5)
+	(ligature-primitive-callback . ,Note_head::brew_molecule)
 	(molecule-callback . ,Ligature_bracket::brew_molecule)
 	(meta . ((interfaces . (ligature-bracket-interface))))
 	))
 
+    (LigatureHead
+     . (
+	(ligature-primitive-callback . ,Note_head::brew_molecule)
+	(molecule-callback . ,Ligature_head::brew_molecule)
+	(Y-offset-callbacks  . (,Staff_symbol_referencer::callback))
+	(stem-attachment-function . ,note-head-style->attachment-coordinates)
+	(font-family . ancient)
+	(style . mensural)
+	(meta . ((interfaces . (ligature-head-interface rhythmic-head-interface note-head-interface staff-symbol-referencer-interface))))
+	))
+
     (LyricHyphen
      . (
 	(thickness . 1.0)
@@ -416,6 +434,16 @@
 	(meta . ((interfaces . (lyric-syllable-interface self-alignment-interface text-interface font-interface))))
 	))
 
+    (MensuralLigature
+     . (
+	(thickness . 1.4)
+	(flexa-width . 2.0)
+	(ligature-primitive-callback . ,Mensural_ligature::brew_ligature_primitive)
+	(molecule-callback . ,Mensural_ligature::brew_molecule)
+	(font-family . ancient)
+	(meta . ((interfaces . (mensural-ligature-interface))))
+	))
+
     (Porrectus
      . (
 	(style . mensural)
diff -purN ../lilypond-1.5.56/scm/grob-property-description.scm ./scm/grob-property-description.scm
--- ../lilypond-1.5.56/scm/grob-property-description.scm	Sun May  5 23:14:21 2002
+++ ./scm/grob-property-description.scm	Sun May 19 02:16:29 2002
@@ -155,6 +155,7 @@ procedure returns #t, attachment is used
 procedure is tried.")
 (grob-property-description 'flag-style string? "turn stroke through stem on/off.")
 (grob-property-description 'flag-width-function procedure? "Procedure that computes the width of a half-beam (a non-connecting beam.).")
+(grob-property-description 'flexa-width number? "width of a flexa shape in a ligature grob.")
 (grob-property-description 'font-family symbol? "partial font
 definition: music roman braces dynamic math ...")
 (grob-property-description 'font-name string? "file name for the font to load.
diff -purN ../lilypond-1.5.56/scm/interface-description.scm ./scm/interface-description.scm
--- ../lilypond-1.5.56/scm/interface-description.scm	Sun Mar 24 21:46:57 2002
+++ ./scm/interface-description.scm	Sun May 19 02:16:29 2002
@@ -26,6 +26,12 @@
  )
 
 (ly-add-interface
+ 'ligature-interface
+ "A ligature"
+ '()
+ )
+
+(ly-add-interface
  'mark-interface
  "a rehearsal mark"
  '(
diff -purN ../lilypond-1.5.56/scm/lily.scm ./scm/lily.scm
--- ../lilypond-1.5.56/scm/lily.scm	Fri May 17 01:00:21 2002
+++ ./scm/lily.scm	Sun May 19 02:12:33 2002
@@ -114,11 +114,15 @@
 
 
 (define (ly-load x)
-  ;; should check verbose
-;;  (format (current-error-port) "[~s]" x)
-  (primitive-load (%search-load-path x))
+  (let*
+      (
+       (fn (%search-load-path x))
+       )
+    (if (ly-verbose)
+	(format (current-error-port) "[~A]" fn))
+    (primitive-load fn)
 
-  )
+    ))
 
 
 
diff -purN ../lilypond-1.5.56/scm/molecule.scm ./scm/molecule.scm
--- ../lilypond-1.5.56/scm/molecule.scm	Fri Mar 22 01:28:43 2002
+++ ./scm/molecule.scm	Sun May 19 02:12:34 2002
@@ -29,8 +29,8 @@
 
   (let* (
 	 (ext (ly-get-molecule-extent mol axis))
-	 (lb (ly-bracket axis ext -1 thick protusion))
-	 (rb (ly-bracket axis ext 1 thick protusion))
+	 (lb (ly-bracket axis ext thick (- protusion)))
+	 (rb (ly-bracket axis ext thick protusion))
 	 )
     (set! mol (ly-combine-molecule-at-edge mol (other-axis  axis) 1 lb padding))
     (set! mol (ly-combine-molecule-at-edge mol (other-axis  axis) -1 rb padding))
diff -purN ../lilypond-1.5.56/scripts/convert-ly.py ./scripts/convert-ly.py
--- ../lilypond-1.5.56/scripts/convert-ly.py	Tue Apr  2 00:45:10 2002
+++ ./scripts/convert-ly.py	Sun May 19 02:12:35 2002
@@ -848,6 +848,15 @@ if 1:
 	
 	conversions.append (((1,5,49), conv, 'noAutoBeaming -> autoBeaming'))
 
+
+if 1:
+	def conv (str):
+		str = re.sub ('Pitch::transpose', 'ly-transpose-pitch', str)
+
+		return str
+	
+	conversions.append (((1,5,56), conv, 'Pitch::transpose->ly-transpose-pitch'))
+
 ################################
 #	END OF CONVERSIONS	
 ################################
diff -purN ../lilypond-1.5.56/scripts/lilypond-book.py ./scripts/lilypond-book.py
--- ../lilypond-1.5.56/scripts/lilypond-book.py	Fri May 17 00:38:09 2002
+++ ./scripts/lilypond-book.py	Sun May 19 02:22:25 2002
@@ -567,9 +567,11 @@ def output_verbatim (body):
 
 #warning: this uses extended regular expressions. Tread with care.
 
-# legenda (?P  name parameter
-# *? match non-greedily.
+# legenda
 
+# (?P  -- name parameter
+# *? -- match non-greedily.
+# (?m)  -- ?  
 re_dict = {
 	'html': {
 		 'include':  no_match,
@@ -579,9 +581,9 @@ re_dict = {
 		 'landscape': no_match,
 		 'verbatim': r'''(?s)(?P<code><pre>\s.*?</pre>\s)''',
 		 'verb': r'''(?P<code><pre>.*?</pre>)''',
-		 'lilypond-file': '(?m)(?P<match><lilypondfile(?P<options>[^>]*)?>\s*(?P<filename>.*?)\s*</lilypondfile>)',
+		 'lilypond-file': r'(?m)(?P<match><lilypondfile(?P<options>[^>]+)?>\s*(?P<filename>[^<]+)\s*</lilypondfile>)',
 		 'lilypond' : '(?m)(?P<match><lilypond((?P<options>[^:]*):)(?P<code>.*?)/>)',
-		 'lilypond-block': r'''(?ms)(?P<match><lilypond(?P<options>[^>]*)?>(?P<code>.*?)</lilypond>)''',
+		 'lilypond-block': r'''(?ms)(?P<match><lilypond(?P<options>[^>]+)?>(?P<code>.*?)</lilypond>)''',
 		  'option-sep' : '\s*',
 		  'intertext': r',?\s*intertext=\".*?\"',
 		  'multiline-comment': r"(?sm)\s*(?!@c\s+)(?P<code><!--\s.*?!-->)\s",
@@ -1244,7 +1246,7 @@ def compile_all_files (chunks):
 		texfiles = string.join (tex, ' ')
 		cmd = 'lilypond --header=texidoc %s %s %s' \
 		      % (lilyopts, g_extra_opts, texfiles)
-		quiet_system (cmd, 'LilyPond')
+		system (cmd)
 
 		#
 		# Ugh, fixing up dependencies for .tex generation
diff -purN ../lilypond-1.5.56/stepmake/GNUmakefile.in ./stepmake/GNUmakefile.in
--- ../lilypond-1.5.56/stepmake/GNUmakefile.in	Fri Mar 29 14:16:22 2002
+++ ./stepmake/GNUmakefile.in	Sun May 19 02:12:35 2002
@@ -17,7 +17,7 @@ endif
 
 # list of distribution files:
 #
-SCRIPTS = configure aclocal.m4
+SCRIPTS = configure aclocal.m4 autogen.sh
 README_FILES = CHANGES README TODO
 README_TXT_FILES = 
 EXTRA_DIST_FILES = $(IN_FILES) VERSION $(README_FILES)  $(SCRIPTS) INSTALL.texi
diff -purN ../lilypond-1.5.56/stepmake/aclocal.m4 ./stepmake/aclocal.m4
--- ../lilypond-1.5.56/stepmake/aclocal.m4	Fri May 17 00:38:10 2002
+++ ./stepmake/aclocal.m4	Sun May 19 02:12:35 2002
@@ -106,7 +106,6 @@ AC_DEFUN(STEPMAKE_BISON, [
 	STEPMAKE_CHECK_VERSION(BISON, $1, $2)
     fi
 ])
-    
 
 
 AC_DEFUN(STEPMAKE_COMPILE, [
@@ -192,9 +191,6 @@ AC_DEFUN(STEPMAKE_CXX, [
     AC_PROG_CXX
     STEPMAKE_OPTIONAL_REQUIRED(CXX, c++, $1)
 
-    AC_CHECK_HEADER(FlexLexer.h, true,
-	STEPMAKE_WARN(cannot find flex header.  Please install Flex headers correctly))
-
     CPPFLAGS="$CPPFLAGS $DEFINES"
     CXXFLAGS="$CXXFLAGS $OPTIMIZE"
     LDFLAGS="$LDFLAGS $EXTRA_LIBES"
@@ -299,6 +295,24 @@ AC_DEFUN(STEPMAKE_FLEX, [
 ])
 
 
+AC_DEFUN(STEPMAKE_FLEXLEXER, [
+    AC_HAVE_HEADERS(FlexLexer.h, true, false)
+    if test $? -ne 0; then
+	warn='FlexLexer.h (flex package)'
+	STEPMAKE_ADD_ENTRY($1, $warn)
+    fi
+])
+
+
+AC_DEFUN(STEPMAKE_GCC, [
+    if test "$GCC" = "yes"; then
+        STEPMAKE_CHECK_VERSION(CC, $1, $2)
+    else
+	warn="$CC (Please install *GNU* cc)"
+	STEPMAKE_ADD_ENTRY($1, $warn)
+    fi
+])
+
 
 AC_DEFUN(STEPMAKE_GETTEXT, [
     DIR_LOCALEDIR=${localedir}
@@ -369,7 +383,6 @@ AC_DEFUN(STEPMAKE_GUILE_DEVEL, [
 	fi
     done
     STEPMAKE_OPTIONAL_REQUIRED(GUILE_CONFIG, $guile_config, $1)
-    #if expr "$GUILE_CONFIG" : '.*\(echo\)' >/dev/null; then
     if test $? -ne 0; then
         STEPMAKE_ADD_ENTRY($1, 'guile-config (guile-devel, guile-dev or libguile-dev package)')
     fi 
@@ -394,25 +407,15 @@ AC_DEFUN(STEPMAKE_GUILE_DEVEL, [
 
 
 AC_DEFUN(STEPMAKE_GXX, [
-    AC_MSG_CHECKING("g++ version")
-    cxx_version=`$CXX --version`
-    AC_MSG_RESULT("$cxx_version")
-    changequote(<<, >>)dnl
-    # urg, egcs: how to check for egcs >= 1.1?
-    if expr "$cxx_version" : '.*2\.[89]' > /dev/null ||
-	expr "$cxx_version" : '.*egcs' > /dev/null ||
-	expr "$cxx_version" : '3\.[0-9]' > /dev/null
-    changequote([, ])dnl
-    then
-	    true
+    if test "$GXX" = "yes"; then
+        STEPMAKE_CHECK_VERSION(CXX, $1, $2)
     else
-	STEPMAKE_WARN(cannot find g++ 2.8, 2.9, 3.x or egcs 1.1)
-        STEPMAKE_ADD_ENTRY($1, 'g++ >= 2.95 (gcc package)')
+	warn="$CXX (Please install *GNU* c++)"
+	STEPMAKE_ADD_ENTRY($1, $warn)
     fi
 ])
 
 
-
 AC_DEFUN(STEPMAKE_INIT, [
 
     . $srcdir/VERSION
@@ -562,7 +565,7 @@ AC_DEFUN(STEPMAKE_INIT, [
  	$MAKE -v 2> /dev/null | grep GNU > /dev/null
 	if test "$?" = 1; then
 	    warn='make (Please install *GNU* make)'
-	    STEPMAKE_WARN($warn)
+	    # STEPMAKE_WARN($warn)
 	    STEPMAKE_ADD_ENTRY(REQUIRED, $warn)
         fi
     fi 
@@ -763,9 +766,10 @@ AC_DEFUN(STEPMAKE_PERL, [
 
 
 AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [
-    AC_HAVE_HEADERS(python2.2/Python.h python2.1/Python.h python2.0/Python.h python2/Python.h python/Python.h python1.5/Python.h Python.h)
-    if test $? -ne 0; then
-	STEPMAKE_ADD_ENTRY($1, 'python.h (python-devel, python-dev or libpython-dev package)')
+    AC_HAVE_HEADERS(python2.2/Python.h python2.1/Python.h python2.0/Python.h python2/Python.h python/Python.h python1.5/Python.h Python.h, PYTHON_HEADER=yes)
+    if test -z "$PYTHON_HEADER"; then
+	warn='python.h (python-devel, python-dev or libpython-dev package)'
+	STEPMAKE_ADD_ENTRY($1, $warn)
     fi
 ])
 
diff -purN ../lilypond-1.5.56/stepmake/autogen.sh ./stepmake/autogen.sh
--- ../lilypond-1.5.56/stepmake/autogen.sh	Thu Jan  1 01:00:00 1970
+++ ./stepmake/autogen.sh	Fri May 17 14:09:11 2002
@@ -0,0 +1,44 @@
+#!/bin/sh
+# Run this to generate configure and initial GNUmakefiles
+
+srcdir=`dirname $0`
+DIE=0
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+  echo
+  echo "ERROR: You must have \`autoconf' installed to."
+  echo "Download the appropriate package for your distribution,"
+  echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+  DIE=1
+}
+
+if test "$DIE" -eq 1; then
+  exit 1
+fi
+
+
+if test -z "$*"; then
+  echo "WARNING: I am going to run \`configure' with no arguments."
+  echo "If you wish to pass any to it, please specify them on the"
+  echo \`$0\'" command line."
+  echo
+fi
+
+for coin in `find $srcdir -name configure.in -print`
+do 
+  dr=`dirname $coin`
+  echo processing $dr
+  (
+      cd $dr
+      echo "Running autoconf ..."
+      autoconf
+  )
+done
+
+#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
+if test -z "$NOCONFIGURE"; then
+  echo Running $srcdir/configure $conf_flags "$@" ...
+  $srcdir/configure $conf_flags "$@"
+else
+  echo Skipping configure process.
+fi
diff -purN ../lilypond-1.5.56/stepmake/bin/install-dot-exe.sh ./stepmake/bin/install-dot-exe.sh
--- ../lilypond-1.5.56/stepmake/bin/install-dot-exe.sh	Mon Jun 29 13:32:49 1998
+++ ./stepmake/bin/install-dot-exe.sh	Sun May 19 02:12:36 2002
@@ -1,20 +1,21 @@
 #!/bin/sh
 # install-dot-exe.sh  -- add .exe for cygnus gnu-windows
-# hack for doos install; cygnus should support rpm
+# hack for doos install
 
 realinstall=install
 
 args=''
 while [ $# -ne 0 ] 
 do
+    x=`echo $1 | sed 's@//@/@g'`
     case $1 in
-	-*) args="$args $1"
+	-*) args="$args $x"
 	    ;;
 
 	 *) if [ -f $1.exe ]; then
-		args="$args $1.exe"
+		args="$args $x.exe"
 	    else
-		args="$args $1"
+		args="$args $x"
 	    fi
 	    ;;
     esac
diff -purN ../lilypond-1.5.56/stepmake/stepmake/automatically-generated.sub.make ./stepmake/stepmake/automatically-generated.sub.make
--- ../lilypond-1.5.56/stepmake/stepmake/automatically-generated.sub.make	Mon Sep 14 18:51:34 1998
+++ ./stepmake/stepmake/automatically-generated.sub.make	Sun May 19 02:12:37 2002
@@ -3,7 +3,8 @@ LINECOMMENT=\#
 
 default:
 	-chmod +w $(OUTFILE)
-	echo "$(LINECOMMENT) WARNING WARNING WARNING WARNING" > $(OUTFILE)
+	head -1 $(INFILE) > $(OUTFILE)
+	echo "$(LINECOMMENT) WARNING WARNING WARNING" >> $(OUTFILE)
 	echo "$(LINECOMMENT) do not edit! this is $(OUTFILE), generated from $(INFILE)" >> $(OUTFILE)
 	cat $(INFILE) >> $(OUTFILE)
 	chmod -w $(OUTFILE)
diff -purN ../lilypond-1.5.56/stepmake/stepmake/generic-targets.make ./stepmake/stepmake/generic-targets.make
--- ../lilypond-1.5.56/stepmake/stepmake/generic-targets.make	Wed Dec 26 22:16:19 2001
+++ ./stepmake/stepmake/generic-targets.make	Sun May 19 02:12:37 2002
@@ -99,9 +99,8 @@ $(outdir)/version.hh: $(outdir)/VERSION
 $(outdir)/config.h: $(config_h)
 	cp -p $< $@
 
-# should this be in Rules?
 configure: configure.in aclocal.m4
-	autoconf 
+	NOCONFIGURE=yes $(srcdir)/autogen.sh
 	chmod +x configure
 
 local-clean:
diff -purN ../lilypond-1.5.56/stepmake/stepmake/toplevel-targets.make ./stepmake/stepmake/toplevel-targets.make
--- ../lilypond-1.5.56/stepmake/stepmake/toplevel-targets.make	Fri Mar 22 01:28:43 2002
+++ ./stepmake/stepmake/toplevel-targets.make	Sun May 19 02:12:38 2002
@@ -17,6 +17,10 @@ GNUmakefile: GNUmakefile.in
 ifneq ($(PACKAGE),STEPMAKE)
 aclocal.m4: $(stepmake)/aclocal.m4
 	$(MAKE) INFILE=$< OUTFILE=$@ LINECOMMENT=dnl -f $(stepdir)/automatically-generated.sub.make
+
+autogen.sh: $(stepmake)/autogen.sh
+	$(MAKE) INFILE=$< OUTFILE=$@ LINECOMMENT=\# -f $(stepdir)/automatically-generated.sub.make
+	chmod +x autogen.sh
 endif
 
 
