From cfbc499b05b4d656241759f46f21cc25d85d9d55 Mon Sep 17 00:00:00 2001 From: Carl Sorensen Date: Tue, 13 Jan 2009 10:20:15 -0700 Subject: [PATCH] Add docstrings to predefined identifiers. Contributed by Hajo Dezelski. --- ly/music-functions-init.ly | 26 ++++++++++++++------------ scm/music-functions.scm | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index 4353cb2578..322dfa2511 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -174,7 +174,8 @@ in a CueVoice oriented by @var{dir}.") displayLilyMusic = #(define-music-function (parser location music) (ly:music?) - (_i "Display @var{music} to the console in LilyPond input notation.") + (_i "Display the LilyPond input representation of @var{music} +to the console.") (newline) (display-lily-music music parser) music) @@ -214,9 +215,8 @@ endSpanners = (ly:input-message location (_ "argument endSpanners is not an EventChord: ~a" music)))) featherDurations= - (_i "Adjust durations of @var{music} in @var{argument}. Argument is a fraction - (numerator denominator) which controlls acceleration/deceleration. ") #(define-music-function (parser location factor argument) (ly:moment? ly:music?) + (_i "Adjust durations of music in @var{argument} by rational @var{factor}. ") (let* ((orig-duration (ly:music-length argument)) (multiplier (ly:make-moment 1 1))) @@ -239,8 +239,8 @@ featherDurations= argument)) grace = - (_i "Insert @var{music} as grace notes.") -#(def-grace-function startGraceMusic stopGraceMusic) +#(def-grace-function startGraceMusic stopGraceMusic + (_i "Insert @var{music} as grace notes.")) "instrument-definitions" = #'() @@ -254,9 +254,10 @@ addInstrumentDefinition = instrumentSwitch = - (_i "Switch instrument to @var{name}, which must be predefined with @var{\addInstrumentDefinition}.") #(define-music-function (parser location name) (string?) + (_i "Switch instrument to @var{name}, which must be predefined with +@var{\addInstrumentDefinition}.") (let* ((handle (assoc name instrument-definitions)) (instrument-def (if handle (cdr handle) '())) @@ -279,8 +280,9 @@ instrumentSwitch = #(define page-layout-parser #f) includePageLayoutFile = - (_i "Include the file @var{-page-layout.ly}.") #(define-music-function (parser location) () + (_i "Include the file @var{-page-layout.ly}. Deprecated as +part of two-pass spacing.") (if (not (ly:get-option 'dump-tweaks)) (let ((tweak-filename (format #f "~a-page-layout.ly" (ly:parser-output-name parser)))) @@ -294,9 +296,9 @@ includePageLayoutFile = (make-music 'SequentialMusic 'void #t)) keepWithTag = - (_i "Include only elements of @var{music} that are tagged with @var{tag}.") #(define-music-function (parser location tag music) (symbol? ly:music?) + (_i "Include only elements of @var{music} that are tagged with @var{tag}.") (music-filter (lambda (m) (let* ((tags (ly:music-property m 'tags)) @@ -307,9 +309,9 @@ keepWithTag = music)) removeWithTag = - (_i "Remove elements of @var{music} that are tagged with @var{tag}.") #(define-music-function (parser location tag music) (symbol? ly:music?) + (_i "Remove elements of @var{music} that are tagged with @var{tag}.") (music-filter (lambda (m) (let* ((tags (ly:music-property m 'tags)) @@ -318,10 +320,10 @@ removeWithTag = music)) killCues = - (_i "Remove cue notes from @var{music}.") #(define-music-function (parser location music) (ly:music?) + (_i "Remove cue notes from @var{music}.") (music-map (lambda (mus) (if (string? (ly:music-property mus 'quoted-music-name)) @@ -329,8 +331,8 @@ killCues = mus)) music)) label = - (_i "Create @var{label} as a bookmarking label") #(define-music-function (parser location label) (symbol?) + (_i "Create @var{label} as a bookmarking label") (make-music 'EventChord 'page-marker #t 'page-label label @@ -338,9 +340,9 @@ label = 'page-label label)))) makeClusters = - (_i "Display chords in @var{arg} as clusters") #(define-music-function (parser location arg) (ly:music?) + (_i "Display chords in @var{arg} as clusters") (music-map note-to-cluster arg)) musicMap = diff --git a/scm/music-functions.scm b/scm/music-functions.scm index d6de35852d..42a08cc344 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -737,7 +737,7 @@ Syntax: (define-music-function (parser location arg1 arg2 ...) (arg1-type? arg2-type? ...) ...function body...) " - (if (and (pair? body) (pair? (car body)) (eqv? '_i (caar body))) +(if (and (pair? body) (pair? (car body)) (eqv? '_i (caar body))) ;; When the music function definition contains a i10n doc string, ;; (_i "doc string"), keep the literal string only (let ((docstring (cadar body)) -- 2.39.5