lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: \parenthesize and optional arguments


From: David Kastrup
Subject: Re: \parenthesize and optional arguments
Date: Sat, 04 Jul 2015 11:48:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Marc Hohl <address@hidden> writes:

> Now I got
>
> \version "2.19.20"
>
> lparenthesize =
> #(define-music-function (arg) (ly:music?)
>    (_i "Tag @var{arg} to be left parenthesized.)
>    (if (memq 'event-chord (ly:music-property arg 'types))
>        ;; arg is an EventChord -> set the parenthesize property
>        ;; on all child notes and rests
>        (for-each
>         (lambda (ev)
>           (if (or (memq 'note-event (ly:music-property ev 'types))
>                   (memq 'rest-event (ly:music-property ev 'types)))
>               (set! (ly:music-property ev 'parenthesize) #t)))
>         (ly:music-property arg 'elements))
>        ;; No chord, simply set property for this expression:
>        (set! (ly:music-property arg 'parenthesize) #t))
>
>     #{ \tweak ParenthesesItem.stencils #(lambda (grob)
>           (let ((par-list (parentheses-item::calc-parenthesis-stencils
> grob)))
>           (list (car par-list) point-stencil))) #arg #})
>
>
> { \parenthesize c }
>
> which results in an error message that I don't understand:
>
> Lilypond parenthesize.ly
> GNU LilyPond 2.19.23
> »parenthesize.ly« wird verarbeitet
> Analysieren...
> parenthesize.ly:4:2: Fehler: GUILE signalisierte einen Fehler für den
> hier beginnenden Ausdruck
> #
>  (define-music-function (arg) (ly:music?)
> parenthesize.ly:23:5: illegal character in escape sequence: #\p
> parenthesize.ly:4:2: Fehler: syntax error, unexpected EVENT_IDENTIFIER
> #
>  (define-music-function (arg) (ly:music?)
> parenthesize.ly:23:4: Fehler: EOF innerhalb einer Zeichenkette gefunden
> { \
>    parenthesize c }
> schwerer Fehler: gescheiterte Dateien: "parenthesize.ly"
>
> I remember getting such error messages in combination with some
> unbalanced parentheses, but my editor tells me that this is not the
> case here :-(

Reread the penultimate error message (the last one with an error
location).  The other error messages are merely lead-up errors.

Your parentheses don't balance, by the way.

If I tell _my_ editor M-x check-parens RET, it flags the problematic
location _exactly_.

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]