@{ #(ly:export (make-sequential-music (list newLa))) @}
@end example
+Scheme code is evaluated as soon as the parser encounters it. To
+define some scheme code in a macro (to be called later), use
+
+@example
+#(define (nopc)
+ (ly:set-option 'point-and-click #f))
+
+...
+#(nopc)
+@{ c'4 @}
+@end example
+
+
@refbugs
Mixing Scheme and LilyPond identifiers is not possible with the
@code{--safe} option.
+
@node Internal music representation
@subsection Internal music representation
(func music)))
@end example
-A @code{def-music-function} macro is introduced on top of
+A @code{define-music-function} macro is introduced on top of
@code{ly:make-music-function} to ease the definition of music
functions:
@example
-applyMusic = #(def-music-function (parser location func music)
+applyMusic = #(define-music-function (parser location func music)
(procedure? ly:music?)
(func music))
@end example
@lilypond[quote,verbatim,ragged-right]
withPadding =
- #(def-music-function (parser location padding music) (number? ly:music?)
+ #(define-music-function (parser location padding music) (number? ly:music?)
#{ \override TextScript #'padding = #$padding
$music
\revert TextScript #'padding #})
@subsection Markup command definition
New markup commands can be defined
-with the @code{def-markup-command} scheme macro.
+with the @code{define-markup-command} scheme macro.
@lisp
-(def-markup-command (@var{command-name} @var{layout} @var{props} @var{arg1} @var{arg2} ...)
+(define-markup-command (@var{command-name} @var{layout} @var{props} @var{arg1} @var{arg2} ...)
(@var{arg1-type?} @var{arg2-type?} ...)
..command body..)
@end lisp
@code{#'caps} for interpreting @code{Text-in-caps}.
To make the above available as @code{\smallcaps} command, we have to
-define a function using @code{def-markup-command}. The command should
+define a function using @code{define-markup-command}. The command should
take a single argument, of type markup. Therefore, the start of the
definition should read
@example
-(def-markup-command (smallcaps layout props argument) (markup?)
+(define-markup-command (smallcaps layout props argument) (markup?)
@end example
@noindent
defined @code{\smallcaps} command:
@example
-#(def-markup-command (character layout props name) (string?)
+#(define-markup-command (character layout props name) (string?)
"Print the character name in small caps, translated to the left and
top. Syntax: \\character #\"name\""
(interpret-markup layout props
@end example
@lilypond[quote,ragged-right]
-#(def-markup-command (smallcaps layout props str) (string?)
+#(define-markup-command (smallcaps layout props str) (string?)
"Print the string argument in small caps. Syntax: \\smallcaps #\"string\""
(interpret-markup layout props
(make-line-markup
#:tiny (string-upcase (substring s 1)))))
(string-split str #\Space)))))
-#(def-markup-command (character layout props name) (string?)
+#(define-markup-command (character layout props name) (string?)
"Print the character name in small caps, translated to the left and
top. Syntax: \\character #\"name\""
(interpret-markup layout props
letter a little larger:
@example
-#(def-markup-command (smallcaps layout props str) (string?)
+#(define-markup-command (smallcaps layout props str) (string?)
"Print the string argument in small caps."
(interpret-markup layout props
(make-line-markup