]> git.donarmstrong.com Git - lilypond.git/commitdiff
Undocument the Scheme interface to make-simple closure
authorKeith OHara <k-ohara5a5a@oco.net>
Sun, 27 Jul 2014 20:15:18 +0000 (13:15 -0700)
committerKeith OHara <k-ohara5a5a@oco.net>
Sat, 2 Aug 2014 20:04:37 +0000 (13:04 -0700)
in favor of lambdas; issue 3993

Documentation/extending/programming-interface.itely
scm/define-grobs.scm
scm/output-lib.scm

index 9c4cbe7805fd2eace8878c056101853a9f15ffc7..be580034424071d97736417ecff76010be2b3fdb 100644 (file)
@@ -1375,38 +1375,6 @@ can by found in the Internals Reference or the file 'define-grobs.scm':
 @}
 @end example
 
-If routines with multiple arguments must be called, the current grob
-can be inserted with a grob closure.  Here is a setting from
-@code{RehearsalMark},
-
-@example
-`(X-offset .
-   ,(ly:make-simple-closure
-     `(,+
-        ,(ly:make-simple-closure
-          (list ly:break-alignable-interface::self-align-callback))
-        ,(ly:make-simple-closure
-          (list ly:self-alignment-interface::x-aligned-on-self)))))
-@end example
-
-@noindent
-In this example, both @code{ly:break-alignable-interface::self-align-callback} and
-@code{ly:self-alignment-interface::x-aligned-on-self} are called
-with the grob as argument.  The results are added with the @code{+}
-function.  To ensure that this addition is properly executed, the whole
-thing is enclosed in @code{ly:make-simple-closure}.
-
-In fact, using a single procedure as property value is equivalent to
-
-@example
-(ly:make-simple-closure (ly:make-simple-closure (list @var{proc})))
-@end example
-
-@noindent
-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:
 
index ea606ece065b3b0edf7a2b41636b79f08eadab80..05a843de58534ed201d023d6a7756fe365945462 100644 (file)
         (self-alignment-X . ,RIGHT)
         (side-axis . ,Y)
         (stencil . ,ly:text-interface::print)
-        (X-offset . ,(ly:make-simple-closure
-                      `(,+
-                        ,(ly:make-simple-closure
-                          (list ly:break-alignable-interface::self-align-callback))
-                        ,(ly:make-simple-closure
-                          (list ly:self-alignment-interface::x-aligned-on-self)))))
+        (X-offset . ,self-alignment-interface::self-aligned-on-breakable)
         (Y-offset . ,side-position-interface::y-aligned-side)
         (Y-extent . ,grob::always-Y-extent-from-stencil)
         (meta .
         (stencil . ,ly:text-interface::print)
         (vertical-skylines . ,grob::always-vertical-skylines-from-stencil)
         (Y-offset . ,side-position-interface::y-aligned-side)
-        (X-offset . ,(ly:make-simple-closure
-                      `(,+
-                        ,(ly:make-simple-closure
-                          (list ly:break-alignable-interface::self-align-callback))
-                        ,(ly:make-simple-closure
-                          (list ly:self-alignment-interface::x-aligned-on-self)))))
+        (X-offset . ,self-alignment-interface::self-aligned-on-breakable)
         (self-alignment-X . ,LEFT)
         (break-align-symbols . (time-signature))
         (non-break-align-symbols . (paper-column-interface))
         (self-alignment-X . ,CENTER)
         (stencil . ,ly:text-interface::print)
         (vertical-skylines . ,grob::always-vertical-skylines-from-stencil)
-        (X-offset . ,(ly:make-simple-closure
-                      `(,+
-                        ,(ly:make-simple-closure
-                          (list ly:break-alignable-interface::self-align-callback))
-                        ,(ly:make-simple-closure
-                          (list ly:self-alignment-interface::x-aligned-on-self)))))
+        (X-offset . ,self-alignment-interface::self-aligned-on-breakable)
         (Y-offset . ,side-position-interface::y-aligned-side)
         (Y-extent . ,grob::always-Y-extent-from-stencil)
         (meta . ((class . Item)
index c607fe4122805ab0e3baa92539fc26c8f1ea3ac0..2df06bd528bdd29bcbc3dc73e290c1445618326a 100644 (file)
    ly:self-alignment-interface::y-aligned-on-self
    ly:self-alignment-interface::pure-y-aligned-on-self))
 
+(define-public (self-alignment-interface::self-aligned-on-breakable grob)
+  "Return the @code{X-offset} that places @var{grob} according to its
+   @code{self-alignment-X} over the reference point defined by the
+   @code{break-align-anchor-alignment} of a @code{break-aligned} item
+   such as a @code{Clef}."
+  (+ (ly:break-alignable-interface::self-align-callback grob)
+     (ly:self-alignment-interface::x-aligned-on-self grob)))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; staff symbol