]> git.donarmstrong.com Git - lilypond.git/commitdiff
2002-07-13 Han-Wen <hanwen@cs.uu.nl>
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 13 Jul 2002 14:40:42 +0000 (14:40 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 13 Jul 2002 14:40:42 +0000 (14:40 +0000)
* scripts/ly2dvi.py (run_latex): show latex error log. Ask for
bugreport if lilypond is killed.

2002-07-12  Mats Bengtsson  <matsb@s3.kth.se>

* lily/beam.cc (after_line_breaking): Set correct stem lengths
also when beam positions are set manually.
(consider_auto_knees): Do not use automatic knees if the directions
are set manually by the user.

2002-07-13  Han-Wen  <hanwen@cs.uu.nl>

* lily/input-smob.cc (make_input): GUILE 1.7 compatibility fixes.

ChangeLog
autogen.sh
lily/beam.cc
lily/cxx-function-smob.cc
lily/duration.cc
lily/include/ly-smobs.icc
lily/input-smob.cc
lily/moment.cc
scm/script.scm
scripts/ly2dvi.py
stepmake/autogen.sh

index 90b0d805af4e5d4233a5d93a0016913d5727207b..d2e6c9654d1e19b5efced162b9b56c27f752c097 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,24 @@
 2002-07-13  Han-Wen  <hanwen@cs.uu.nl>
 
+       * scripts/ly2dvi.py (run_latex): show latex error log. Ask for
+       bugreport if lilypond is killed. 
+
+2002-07-12  Mats Bengtsson  <matsb@s3.kth.se>
+
+       * lily/beam.cc (after_line_breaking): Set correct stem lengths
+       also when beam positions are set manually.
+       (consider_auto_knees): Do not use automatic knees if the directions
+       are set manually by the user.
+
+2002-07-13  Han-Wen  <hanwen@cs.uu.nl>
+
+       * lily/input-smob.cc (make_input): GUILE 1.7 compatibility fixes.
+
        * lily/beam.cc: complete rewrite of multiplicity. This fixes 16th
        knees code.
        (quanting): add french beaming support (property french-beaming)
+       (stem_beams): removed.
 
-
-       
 2002-07-12  Han-Wen  <hanwen@cs.uu.nl>
 
        * input/regression/grace-auto-beam.ly: new file
index 4cc98ffdf74c0916988e4b13f8d33c5c52ade96e..e3ee7da81dc8fb8d90715a11a5858d0a6945eaf2 100755 (executable)
@@ -1,11 +1,14 @@
 #!/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`
 
+if [ stepmake/autogen.sh -nt autogen.sh ]; then
+    echo "stepmake/autogen.sh is newer. Copying file." 
+    cp -f stepmake/autogen.sh autogen.sh
+    exec ./autogen.sh
+fi
+
 # Be paranoid: check for autoconf == 2.13
 # Some setups have both autoconf 2.13 and 2.50 available through
 # a wrapper script: /usr/bin/autoconf.
@@ -13,7 +16,7 @@ srcdir=`dirname $0`
 # advertises itself as autoconf 2.13.
 # If you have such a setup, invoke this script as:
 #   autoconf=autoconf2.13 ./autogen.sh
-for i in autoconf autoconf2.13 false; do
+for i in autoconf-2.13 autoconf2.13 autoconf  false; do
   version=`$i --version 2>/dev/null | head -1 | awk '{print $NF}' | awk -F. '{print $1 * 100 + $2}'`
   if test "0$version" -eq 213; then
     autoconf=$i
index a71e306beb5e87c7812eea927f33c24386bda7a0..915363e4acedddd3060a0e7df2dd3b32cb5c9ed3 100644 (file)
@@ -304,6 +304,7 @@ Beam::brew_molecule (SCM grob)
   Real last_width = -1 ;
   
 
+  * Determine auto knees based on positions if it's set by the user.
   
   Molecule the_beam;
   Real lt = me->paper_l ()->get_var ("linethickness");
@@ -565,9 +566,10 @@ Beam::consider_auto_knees (Grob *me, Direction d)
        {
          for (int i=0; i < stems.size (); i++)
            {
-             if (Stem::invisible_b (stems[i]))
-               continue;
              Item *s = stems[i];         
+             if (Stem::invisible_b (s) || 
+                 s->get_grob_property ("dir-forced") == SCM_BOOL_T)
+               continue;
              Real y = Stem::extremal_heads (stems[i])[d]
                ->relative_coordinate (common, Y_AXIS);
 
@@ -630,13 +632,14 @@ Beam::after_line_breaking (SCM smob)
   SCM s = ly_deep_copy (me->get_grob_property ("positions"));
   me->set_grob_property ("positions", s);
 
-  if (ly_car (s) != SCM_BOOL_F)
-    return SCM_UNSPECIFIED;
+  if (ly_car (s) == SCM_BOOL_F)
+    {
 
-  // one wonders if such genericity is necessary  --hwn.
-  SCM callbacks = me->get_grob_property ("position-callbacks");
-  for (SCM i = callbacks; gh_pair_p (i); i = ly_cdr (i))
-    gh_call1 (ly_car (i), smob);
+      // one wonders if such genericity is necessary  --hwn.
+      SCM callbacks = me->get_grob_property ("position-callbacks");
+      for (SCM i = callbacks; gh_pair_p (i); i = ly_cdr (i))
+       gh_call1 (ly_car (i), smob);
+    }
 
   set_stem_lengths (me);  
   return SCM_UNSPECIFIED;
index 603a16203ed6892555da7fb9892d2b8218dc776c..6ad764d796eb6bb723915659b4e9792b75490148 100644 (file)
@@ -50,11 +50,7 @@ SCM
 smobify_cxx_function (Cxx_function cb)
 {
   SCM z;
-  
-  SCM_NEWCELL (z);
-  SCM_SETCDR (z, (SCM)cb);
-  SCM_SETCAR (z, (SCM)callback_tag);
-
+  SCM_NEWSMOB(z,callback_tag, cb) ;
   return z;
 }
 
index 5a6abfd1ca858425153b7e8233474af1761fe613..28b41a021068bd7d4cb60ac965d5ca6bacdf399f 100644 (file)
@@ -95,8 +95,6 @@ Duration::mark_smob (SCM)
 }
 
 IMPLEMENT_SIMPLE_SMOBS (Duration);
-
-
 int
 Duration::print_smob (SCM s, SCM port, scm_print_state *)
 {
index b82378dc1b1591a7f3c5b372b467b90b029493e6..aa35f4c973a07148f5a886b98eb66a8f2837099b 100644 (file)
@@ -54,7 +54,7 @@ SCM CL::smobbed_self () const                                 \
 {                                                              \
   SCM s;                                                       \
   s = gh_cons (SCM_PACK (CL::smob_tag_), SCM_PACK (this));     \
-  scm_done_malloc (sizeof (CL));                               \
+  scm_gc_register_collectable_memory ((CL*)this, sizeof (CL), #CL " smob");                            \
                                                                \
   return s;                                                    \
 }                                                              \
@@ -62,9 +62,10 @@ size_t                                                       \
 CL::free_smob (SCM ses)                                                \
 {                                                              \
   CL * s = (CL*) SCM_CDR (ses);                                        \
-   delete s;                                                   \
-  return sizeof (CL);                                          \
-}                                                              \
+  delete s;                                                    \
+  scm_gc_unregister_collectable_memory (s, sizeof (CL), #CL " smob");  \
+  return 0;\
+}\
 ADD_SCM_INIT_FUNC (CL, CL::init_smobs)
 
 #define IMPLEMENT_SMOBS(CL)                                                    \
@@ -87,12 +88,10 @@ CL::unprotected_smobify_self ()                                                             \
     deal half-initialized objects: scm_done_malloc ( ) might trigger GC.               \
     the warning in smobs.hh is just to be doubleplus goodly sure               \
    */                                                                          \
-  SCM s;                                                                               \
-  SCM_NEWCELL (s);                                                             \
-  SCM_SETCAR (s,CL::smob_tag_);                                                        \
-  SCM_SETCDR (s, SCM_PACK (this));                                             \
+  SCM s;\
+  SCM_NEWSMOB (s, CL::smob_tag_, this);\
   self_scm_ = s;                                                               \
- scm_done_malloc (sizeof (CL));                                                        \
+ scm_gc_register_collectable_memory (this, sizeof (CL), #CL " smob");                                                  \
   return s;                                                                    \
 }
 
index bbd6f34dc3144995680c20c3754f0b54ecadc399..0ea9b3664c434f87809e9b9a1c70e4835b6d7ec2 100644 (file)
@@ -80,10 +80,7 @@ make_input (Input ip)
   Input * nip =  new Input (ip);
   SCM z;
   
-  SCM_NEWCELL (z);
-  SCM_SETCAR (z, (SCM)input_tag);
-  SCM_SETCDR (z, (SCM)nip);
-                               // fixme: done_malloc
+  SCM_NEWSMOB (z, input_tag, nip);
   return z;
 }
 
index 8de57af23b186c88d03aafb7d18245411f98f3a8..d44af366e2c294c8b9401b625eedd12253d248dd 100644 (file)
@@ -13,7 +13,6 @@
 #include "warn.hh"
 #include "ly-smobs.icc"
 
-
 IMPLEMENT_SIMPLE_SMOBS (Moment);
 IMPLEMENT_TYPE_P (Moment, "moment?");
 
index 93f437b9e8fe831cc8fb5e92e13a814cb45cee91..8fde1da2800f4a4ceb060a20d3b418414919321f 100644 (file)
@@ -2,17 +2,15 @@
 ;;           follow-into-staff :: bool
 ;;           dir-relative-to-stem :: int
 ;;           force-dir :: int
-;;           priority :: int
 
-;;TODO?      extra padding :: Real (given in staff spaces)
 
+;;           priority :: int -- lower number means closer to the  note head. 
 
 ;; TODO: generate Grob types for this, by prepending appropriate props
 ;; on top of Script (?)  
 
 
 ;; TODO: don't use 2 level indiriection, simply set
-
 ;; thumb = \script #'((feta . ( . .. ) (follow-staff .  #f))
 
 
index 96f0a43b638659b2387a330410e191ae232f95f0..bdd9f4ac5a3fb8c18cfdac074862582b0dea21d3 100644 (file)
@@ -226,7 +226,7 @@ def setup_temp ():
        return temp_dir
 
 
-def system (cmd, ignore_error = 0):
+def system (cmd, ignore_error = 0, quiet =0):
        """Run CMD. If IGNORE_ERROR is set, don't complain when CMD returns non zero.
 
        RETURN VALUE
@@ -242,7 +242,8 @@ def system (cmd, ignore_error = 0):
                name = re.match ('[ \t]*([^ \t]*)', cmd).group (1)
                msg = name + ': ' + _ ("command exited with value %d") % st
                if ignore_error:
-                       warning (msg + ' ' + _ ("(ignored)") + ' ')
+                       if not quiet:
+                               warning (msg + ' ' + _ ("(ignored)") + ' ')
                else:
                        error (msg)
 
@@ -436,12 +437,12 @@ def print_environment ():
        for (k,v) in os.environ.items ():
                sys.stderr.write ("%s=\"%s\"\n" % (k,v)) 
 
-def quiet_system (cmd, name):
+def quiet_system (cmd, name, ignore_error = 0):
        if not verbose_p:
                progress ( _("Running %s...") % name)
                cmd = cmd + ' 1> /dev/null 2> /dev/null'
 
-       return system (cmd)
+       return system (cmd, ignore_error, quiet = 1)
 
 
 def run_lilypond (files, outbase, dep_prefix):
@@ -470,8 +471,22 @@ def run_lilypond (files, outbase, dep_prefix):
 
                # for better debugging!
                print_environment ()
-       print opts, fs  
-       system ('lilypond %s %s ' % (opts, fs), 'lilypond')
+
+       cmd = 'lilypond %s %s ' % (opts, fs)
+       if  verbose_p:
+               progress ("Invoking `%s'"% cmd)
+       status = os.system (cmd)
+
+       signal = 0x0f & status
+       exit_status = status >> 8
+
+       # 2 == user interrupt.
+       if signal <> 2:
+               error("\n\nLilyPond crashed (signal %d). Please submit a bugreport to bug-lilypond@gnu.org\n" % signal)
+
+       if status:
+               error ("\n\nLilyPond failed on the input file. (exit status %d)\n" % exit_status)
+               
 
 def analyse_lilypond_output (filename, extra):
        
@@ -669,8 +684,22 @@ None
        f.close ()
 
        cmd = 'latex \\\\nonstopmode \\\\input %s' % latex_fn
-       quiet_system (cmd, 'LaTeX')
+       status = quiet_system (cmd, 'LaTeX', ignore_error = 1)
+
+       signal = 0xf & status
+       exit_stat = status >> 8
 
+       if exit_stat:
+               logstr = open (outbase + '.log').read()
+               m = re.search ("\n!", logstr)
+               start = m.start (0)
+               logstr = logstr[start:start+200]
+               
+               sys.stderr.write(_("""LaTeX failed on the output file.
+The error log is as follows:
+%s...\n""" % logstr))
+               raise 'LaTeX error'
+       
        if preview_p:
                # make a preview by rendering only the 1st line.
                preview_fn = outbase + '.preview.tex'
index ad9781b51c734b9dcf3ad48744054e4791b4b668..e3ee7da81dc8fb8d90715a11a5858d0a6945eaf2 100755 (executable)
@@ -3,6 +3,12 @@
 
 srcdir=`dirname $0`
 
+if [ stepmake/autogen.sh -nt autogen.sh ]; then
+    echo "stepmake/autogen.sh is newer. Copying file." 
+    cp -f stepmake/autogen.sh autogen.sh
+    exec ./autogen.sh
+fi
+
 # Be paranoid: check for autoconf == 2.13
 # Some setups have both autoconf 2.13 and 2.50 available through
 # a wrapper script: /usr/bin/autoconf.
@@ -10,7 +16,7 @@ srcdir=`dirname $0`
 # advertises itself as autoconf 2.13.
 # If you have such a setup, invoke this script as:
 #   autoconf=autoconf2.13 ./autogen.sh
-for i in autoconf autoconf2.13 false; do
+for i in autoconf-2.13 autoconf2.13 autoconf  false; do
   version=`$i --version 2>/dev/null | head -1 | awk '{print $NF}' | awk -F. '{print $1 * 100 + $2}'`
   if test "0$version" -eq 213; then
     autoconf=$i