+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.
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,
"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")