]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/extending/programming-interface.itely
Doc: Update deprecated \relative syntax.
[lilypond.git] / Documentation / extending / programming-interface.itely
index 1bf87c7fd5559a23bec398d38b8f7ada80fbaeeb..7045b49daf552eb39878b956aedb8ae00773d19b 100644 (file)
@@ -70,7 +70,11 @@ expression.
 The variable type checkers are scheme procedures that will return
 @code{#t} if a variable is of a given type.  Some common types
 are shown in the table below.  Other types can be found in the files
-@file{lily/music-scheme.cc} and @file{scm/c++.scm}.
+@file{lily/music-scheme.cc} and @file{scm/c++.scm}.  The complete
+list of named type checkers for LilyPond is found in the
+@var{type-p-name-alist} of @file{scm/lily.scm}.
+
+@c TODO -- automatically document type-p-name-alist
 
 @multitable @columnfractions .33 .66
 @headitem Input type          @tab @var{vari-type?} notation
@@ -173,7 +177,7 @@ manualBeam =
   \once \override Beam #'positions = #$beg-end
 #@})
 
-\relative @{
+\relative c' @{
   \manualBeam #'(3 . 6) c8 d e f
 @}
 @end example
@@ -192,7 +196,7 @@ manualBeam =
   \once \override Beam #'positions = #(cons $beg $end)
 #})
 
-\relative {
+\relative c' {
   \manualBeam #3 #6 c8 d e f
 }
 @end lilypond
@@ -599,7 +603,7 @@ and the text. So we will introduce a new property,
 @code{box-padding} will be used for the inner padding.  The new code is
 now as follows:
 
-@lisp 
+@lisp
 #(define-markup-command (double-box layout props text) (markup?)
   #:properties ((inter-box-padding 0.4)
                 (box-padding 0.6))
@@ -683,7 +687,7 @@ Then, a property for setting the gap between two lines is added, called
 @lisp
 (define-markup-command (draw-double-line layout props dest)
   (number-pair?)
-  #:properties ((thickness 1) 
+  #:properties ((thickness 1)
                 (line-gap 0.6))
   "..documentation.."
   ...
@@ -695,8 +699,8 @@ stencils are combined using @code{ly:stencil-add}:
 
 @lilypond[quote,verbatim,ragged-right]
 #(define-markup-command (my-draw-line layout props dest)
-  (number-pair?) 
-  #:properties ((thickness 1) 
+  (number-pair?)
+  #:properties ((thickness 1)
                 (line-gap 0.6))
   "..documentation.."
   (let* ((th (* (ly:output-def-lookup layout 'line-thickness)
@@ -846,7 +850,7 @@ note-heads on the center-line:
             (eq? (ly:grob-property grob 'staff-position) 0))
        (set! (ly:grob-property grob 'transparent) #t)))
 
-\relative {
+\relative c' {
   e4 g8 \applyOutput #'Voice #blanker b d2
 }
 @end lilypond
@@ -922,6 +926,13 @@ The inner @code{ly:make-simple-closure} supplies the grob as argument
 to @var{proc}, the outer ensures that result of the function is
 returned, rather than the @code{simple-closure} object.
 
+From within a callback, the easiest method for evaluating a markup is
+to use grob-interpret-markup.  For example:
+
+@example
+my-callback = #(lambda (grob)
+                 (grob-interpret-markup grob (markup "foo")))
+@end example
 
 @node Inline Scheme code
 @section Inline Scheme code