Werner LEMBERG escreveu: >>> Good question. Perhaps `\concat { f i }' should be really >>> identical to `fi', contrary to \line with word-space set to >>> zero... >> It's your call. You could try to inspect the arguments, and if they >> are strings or simple markups, concatenate the strings. > > OK, here it is. Please comment -- especially my Scheme code since I'm > not really acquainted with it.
> #(define-markup-command (concat layout props args) (markup-list?) > "Concatenate @var{args} in a horizontal line, without spaces inbetween. > Strings and simple markups are concatenated on the input level, allowing > ligatures. For example, @code{\\concat @{ \"f\" \\simple #\"i\" @}} is > equivalent to @code{\"fi\"}." > > (define (concat-string-args arg-list) > (do ((arg-list arg-list (cdr arg-list)) > (result-list '() result-list) > (result #f (car result-list))) > ((null? arg-list) (reverse result-list)) > (let ((arg (car arg-list))) > (if (and (pair? arg) (eqv? (car arg) simple-markup)) > (set! arg (cadr arg))) > (if (and (string? result) (string? arg)) > (set! result-list (cons (string-append result arg) > (cdr result-list))) > (set! result-list (cons arg result-list)))))) This is unschemey. I think it's better to use a a functional approach. The signature should probably be something like (concat-string-args args-todo done) and have a recursion (concat-string-args (cdr args-todo) (if (string? ..) ..string-append onto (car done).. (cons (car args-todo) done))) another option is to use fold-left or fold-right (srfi-1 IIRC) to do the list looping -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen LilyPond Software Design -- Code for Music Notation http://www.lilypond-design.com _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel