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: Urs Liska
Subject: Re: How to append a git version to an output filename
Date: Tue, 16 Jan 2018 14:37:14 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2



Am 16.01.2018 um 14:27 schrieb Ben Beeson:
Hi, 

Wow, that looks very promising.  I am looking at this note on my cell phone right now, so I cannot test it just yet. I will try this later when I get home and see what happens.

But you should also look into the openLilyLib files, create a copy of the function and try removing the \markup wrapper. This \markup is added explicitly so it seems more efficient not to do that in the first place instead of removing it afterwards.

Urs


Thanks very much for this!

Cheers,

Ben




On Jan 15, 2018 21:38, "Flaming Hakama by Elaine" <address@hidden> wrote:


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?  




%% 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]