]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/music-functions.scm (make-ottava-set):
authorhanwen <hanwen>
Mon, 16 Jun 2003 23:05:11 +0000 (23:05 +0000)
committerhanwen <hanwen>
Mon, 16 Jun 2003 23:05:11 +0000 (23:05 +0000)
only do ottavation if centralCPosition is set.

* lily/translator-scheme.cc (ly:context-property-where-defined):
return '() if not found.

ChangeLog
input/test/gourlay.ly
lily/translator-scheme.cc
scm/music-functions.scm

index 5801b8d8721b331f7661025a1190ca8900475123..10bacef6686eb6a174d90073c9834948c1f6afa3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-06-17  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * scm/music-functions.scm (make-ottava-set): 
+       only do ottavation if centralCPosition is set.
+
+       * lily/translator-scheme.cc (ly:context-property-where-defined):
+       return '() if not found.
+
 2003-06-17  Heikki Junes  <hjunes@cc.hut.fi>
 
        * lilypond-mode.el (LilyPond-un-comment-region): removed.
index ef7572e0cd238863c32167db522f8f16989aee04..1b0a170ccd346fbbf0567df8aed7fd5a1562fce7 100644 (file)
@@ -1,6 +1,12 @@
 \version "1.7.18"
-\header{ texidoc="@cindex Gourlay
-This is taken from Gourlay's paper on breaking lines. " }
+\header{
+
+    texidoc="@cindex Gourlay
+
+This is taken from Gourlay's paper on
+breaking lines.  "
+
+}
 
 \score{
        \notes \context Staff  \relative c'' <
index 2ced54dbf190604829883a751fc5c7bbbc32b78c..da08478faed95ea0725b5535d4547878874b11d1 100644 (file)
@@ -54,7 +54,10 @@ LY_DEFINE(ly_context_property_where_defined,
   SCM_ASSERT_TYPE(tr, context, SCM_ARG1, __FUNCTION__, "Context");
   SCM_ASSERT_TYPE(gh_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
 
-  return tr->where_defined (name)->self_scm();
+
+  tr = tr->where_defined (name);
+  if (tr)
+    return tr?  tr->self_scm():  SCM_EOL;
 }
 
 LY_DEFINE(ly_unset_context_property,
index 266b0d66d196f0f7ea897a47a07fd6cac0f743e0..3945e10a557144e60471bc43f9d203413b32cb88 100644 (file)
@@ -308,31 +308,33 @@ a property set for MultiMeasureRestNumber."
     "Either reset centralCPosition to the stored original,
 or remember old centralCPosition, add OCTAVATION to centralCPosition,
 and set OTTAVATION to `8va', or whatever appropriate."
-    (if (= octavation 0)
-       (let*
-           ((where (ly:context-property-where-defined context 'centralCPosition))
-            (oc0 (ly:get-context-property context 'originalCentralCPosition)) )
-
-         (ly:set-context-property context 'centralCPosition oc0)
-         (ly:unset-context-property where 'originalCentralCPosition)
-         (ly:unset-context-property where 'ottavation))
-
-       (let*
-           ((where (ly:context-property-where-defined context 'centralCPosition))
-            (c0 (ly:get-context-property context 'centralCPosition))
-            (new-c0 (+ c0 (* -7 octavation)))
-            (string (cdr
-                     (assoc octavation '((2 . "15ma")
-                                         (1 . "8va")
-                                         (0 . #f)
-                                         (-1 . "8va bassa")
-                                         (-2 . "15ma bassa"))))))
-
-         (ly:set-context-property context 'centralCPosition new-c0)
-         (ly:set-context-property context 'originalCentralCPosition c0)
-         (ly:set-context-property context 'ottavation string)
-         
-         )))
+    (if (number? (ly:get-context-property  context 'centralCPosition))
+       
+       (if (= octavation 0)
+           (let*
+               ((where (ly:context-property-where-defined context 'centralCPosition))
+                (oc0 (ly:get-context-property context 'originalCentralCPosition)))
+
+             (ly:set-context-property context 'centralCPosition oc0)
+             (ly:unset-context-property where 'originalCentralCPosition)
+             (ly:unset-context-property where 'ottavation))
+
+           (let*
+               ((where (ly:context-property-where-defined context 'centralCPosition))
+                (c0 (ly:get-context-property context 'centralCPosition))
+                (new-c0 (+ c0 (* -7 octavation)))
+                (string (cdr
+                         (assoc octavation '((2 . "15ma")
+                                             (1 . "8va")
+                                             (0 . #f)
+                                             (-1 . "8va bassa")
+                                             (-2 . "15ma bassa"))))))
+
+             (ly:set-context-property context 'centralCPosition new-c0)
+             (ly:set-context-property context 'originalCentralCPosition c0)
+             (ly:set-context-property context 'ottavation string)
+             
+             ))))
 
   (ly:set-mus-property! m 'procedure  ottava-modify)
   (context-spec-music m "Staff")