lilypond-user
[Top][All Lists]
Advanced

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

Re: How to append a git version to an output filename


From: Flaming Hakama by Elaine
Subject: Re: How to append a git version to an output filename
Date: Mon, 15 Jan 2018 18:38:08 -0800



On Sun, Jan 14, 2018 at 4:10 PM, Urs Liska <address@hidden> wrote:
Hi Ben,

Actually I misread your original post and referred you to what you already had.

Elaine's hint is true but won't bring you any further because that's what is already happening in the background when you use the \gitCommittish function.

The point is (I think) that the function is explicitly making a markup from a string - and in order to concatenate a string for the file name you should simply avoid that step.

Urs
 
So, the \gitCommitish returns a markup, and it needs to be a string? 
If so, does this help?  

http://lsr.di.unimi.it/LSR/Item?id=747


%% http://lsr.di.unimi.it/LSR/Item?id=747
%% see also http://lilypond.org/doc/v2.18/Documentation/notation/text

%% TODO markup->string is in the source
%% test, if it can be deleted here

% mup = markup argument
% conc = boolean whether to concat or not
#(define (markup->string mup conc)
        (let ((result ""))
             (map (lambda (x)
                          (begin
                            ;; if this is a concat-markup, do not insert blanks between string
                            (if (eq? x concat-markup)(set! conc #t))
                            (if (list? x)
                                (set! result 
                                  ;; if we are concatenating or we start with an empty result, don't add a blank
                                  (if (or conc (string=? result ""))
                                      (string-append result (markup->string x conc))
                                      (string-append result " " (markup->string x conc)))))
                            (if (string? x)
                                (set! result 
                                  ;; if we are concatenating or we start with an empty result, don't add a blank
                                  (if (or conc (string=? result ""))
                                      (string-append result x)
                                      (string-append result " " x))))
                            result))
                  mup)
             result)
)
#(define-markup-command (plain-text layout props arg)(markup?)
                        (interpret-markup layout props (markup (markup->string arg #f))))


#(define output-suffix \plain-text \gitCommitish ... )





David Elaine Alt
415 . 341 .4954                                           "Confusion is highly underrated"
address@hidden
skype: flaming_hakama
Producer ~ Composer ~ Instrumentalist
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 


reply via email to

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