Re: 2.24 medium = \normal-weight in 2.26

Richard Shann <[email protected]>
Newsgroups gmane.comp.gnu.lilypond.general
Message-ID <[email protected]>
On Thu, 2026-08-13 at 12:16 +0100, Richard Shann wrote:
> On Thu, 2026-08-13 at 11:05 +0200, Lukas-Fabian Moser wrote:
> > Hi Richard,
> > 
> > Am 13.08.26 um 10:55 schrieb Richard Shann:
> > > Is there a way of putting something like
> > >   medium = \normal-weight
> > > in a header file to convert from uses of \medium in markup in
> > > LilyPond
> > > 2.24 to pass 2.26 (so as to aviud going through physically
> > > replacing
> > > \medium with \normal-weight?)
> > > The above doesn't work, I guess because it's being invoked inside
> > > markup...
> > 
> > The syntax is a bit more complicated in the case of markup
> > functions:
> > 
> > \markup medium = \markup \normal-weight \etc
> 
> Perfect! Thank you very much.

I looked up the docs on using ly:version? to allow older files to be
typeset in older or newer syntax and I understood this should work:

#(if (ly:version? > '(2 24))
       #{ \markup medium = \markup \normal-weight \etc #})

but this seems not to work:
%%%%%%%%%%%%%%%%%%%%%%%%%%
\version "2.26"
%\version "2.24"
#(if (ly:version? > '(2 25))
       #{ \markup medium = \markup \normal-weight \etc #})
\score  {
         \new Staff { a'4 a' 
                         \mark \markup {\bold bold1 \medium med \bold
bold2}
                         a' a' 
         } 
}
%%%%%%%%%%%%%%%%%%%%%%%%%%
gives
\markup medium = \markup \normal-weight \etc 
/tmp/frescobaldi-oorxliqz/tmp7qct88s5/document.ly:4:17: error: syntax
error, unexpected '='

I didn't manage to nail down an explanation of #{ ... #} but it seemed
like it was for inserting LilyPond syntax at that point in the file.
Help much appreciated!

Richard
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.