And thanks also for these coding suggestions, they’re very good and I’ve incorporated them.

Am 07.09.2014 um 00:37 schrieb David Nalesnik:



On Sat, Sep 6, 2014 at 5:20 PM, David Nalesnik <david.nales...@gmail.com <mailto:david.nales...@gmail.com>> wrote:


    Here's an unrelated suggestion.

    When you use \wordcompress with a value which triggers the
    warning, the music function doesn't return music, so you end up
    with a fatal error (rather defeating the gentle purpose of a
    simple warning!)

    Why not something like:

    wordcompress =
    #(define-music-function (parser location num) (number?)
       (cond
        ((> num 0.5)
         (and (ly:warning "Attention: 0.4 is a rather large value for
    \\wordcompress already!")
              (make-music 'Music)))
        ((< num 0)
         (ly:error "\\wordcompress should get a non-negative value."))
        (else #{
          \override LyricWord.after-line-breaking =
    #(lyric-word-compressor num)
          \override LyricHyphen.minimum-distance = #0
          \override LyricSpace.minimum-distance = #1
          #})))


Or perhaps issue a warning and let the override proceed with the odd value?

wordcompress =
#(define-music-function (parser location num) (number?)
   (cond
    ((< num 0)
     (ly:error "\\wordcompress should get a non-negative value."))
    (else
     (begin
      (if (> num 0.5)
(ly:warning "Attention: 0.4 is a rather large value for \\wordcompress already!"))
      #{
\override LyricWord.after-line-breaking = #(lyric-word-compressor num)
        \override LyricHyphen.minimum-distance = #0
        \override LyricSpace.minimum-distance = #1
      #}))))

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to