X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdisplay-lily.scm;h=6a53f1eded020df0ef754212fe4ac49fcdee5add;hb=3af0951f9a11677240efa6228683dd4fcea13eaf;hp=f67125337b574bf0a3ffe0614ceb4dac836ac3b9;hpb=652ed35a2013489d0a14fede6307cd2595abb2c4;p=lilypond.git diff --git a/scm/display-lily.scm b/scm/display-lily.scm index f67125337b..6a53f1eded 100644 --- a/scm/display-lily.scm +++ b/scm/display-lily.scm @@ -2,7 +2,7 @@ ;;; ;;; ;;; -;;; Copyright (C) 2005--2012 Nicolas Sceaux +;;; Copyright (C) 2005--2015 Nicolas Sceaux ;;; ;;; - This file defines the procedures used to define display methods for each @@ -11,10 +11,10 @@ ;;; Display methods are stored in the `display-methods' property of each music ;;; type. ;;; -;;; - `music->lily-string' return a string describing a music expression using -;;; LilyPond notation. The special variables *indent*, *previous-duration*, -;;; and *force-duration* influence the indentation level and the display of -;;; music durations. +;;; - `music->lily-string' return a string describing a music +;;; expression using LilyPond notation. The special variables *indent* +;;; and *omit-duration* influence the indentation level and the +;;; display of music durations. ;;; ;;; - `with-music-match' can be used to destructure a music expression, extracting ;;; some interesting music properties. @@ -41,7 +41,7 @@ `display-methods' property of the music type entry found in the `music-name-to-property-table' hash table. Print methods previously defined for that music type are lost. -Syntax: (define-display-method MusicType (expression parser) +Syntax: (define-display-method MusicType (expression) ...body...))" `(let ((type-props (hashq-ref music-name-to-property-table ',music-type '())) @@ -99,7 +99,7 @@ display method will be called." (scheme-expr->lily-string val)))) (ly:music-property expr 'tweaks)))) -(define-public (music->lily-string expr parser) +(define-public (music->lily-string expr) "Print @var{expr}, a music expression, in LilyPond syntax." (if (ly:music? expr) (let* ((music-type (ly:music-property expr 'name)) @@ -107,7 +107,7 @@ display method will be called." music-type '()) 'display-methods)) (result-string (and procs (any (lambda (proc) - (proc expr parser)) + (proc expr)) procs)))) (if result-string (format #f "~a~a~a" @@ -248,7 +248,7 @@ Generate binding forms by looking for ?var symbol in pattern." (cdr prop-elements)))) elements-list)))) -(define-macro (with-music-match music-expr+pattern . body) +(defmacro-public with-music-match (music-expr+pattern . body) "If `music-expr' matches `pattern', call `body'. `pattern' should look like: '(music property value @@ -282,11 +282,8 @@ inside body." ;;; indentation (define-public *indent* (make-parameter 0)) -;;; set to #t to force duration printing -(define-public *force-duration* (make-parameter #f)) - -;;; last duration found -(define-public *previous-duration* (make-parameter (ly:make-duration 2))) +;;; set to #t to omit duration printing +(define-public *omit-duration* (make-parameter #f)) ;;; Set to #t to force a line break with some kinds of expressions (eg sequential music) (define *force-line-break* (make-parameter #t))