> On Aug 7, 2021, at 3:54 PM, Aaron Hill <lilyp...@hillvisions.com> wrote: > > Perhaps something like this: > > %%%% > \version "2.22.0" > > ifCompiledDirectly = > #(define-scheme-function (scm) (scheme?) > (let ((file (car (ly:input-file-line-char-column (*location*))))) > (if (member file (command-line)) scm))) > > \ifCompiledDirectly \markup "Compiled directly..." > \ifCompiledDirectly \score { { b'4 4 2 } } > %%%% > > The logic is simple: check to see if the command-line arguments contain the > name of the file being processed.
Is there a way to apply this to variable definitions? I.e. have a variable be defined only if the file is being compiled directly? Alternatively, is there a way to force LilyPond to stop reading a file at a certain point (i.e. some equivalent to TeX’s `\endinput`) that could be used in combination with the negative of this so that the example occurs after this command? ✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝ Fr. Samuel, OSB (R. Padraic Springuel) St. Anselm’s Abbey 4501 South Dakota Ave, NE Washington, DC, 20017 202-269-2300 (c) 202-853-7036 PAX ☧ ΧΡΙΣΤΟΣ