Key signature before spacer note completely misplaced

Mats Bengtsson <[email protected]> Mon, 30 Sep 2024 12:52:28 +0200
Newsgroups gmane.comp.gnu.lilypond.bugs
Message-ID <[email protected]>
Hi,

While trying to do an Urtext edition of an old score, I stumbled on a 
bug that is illustrated by the following reasonable minimal example. 
Obviously, there are several possible workarounds (such as correcting 
the rhythmic mistake of the original, or scaling durations or moving the 
spacer note before the key change), but it's really weird that the key 
change is typeset several bars too late, when it's followed by a spacer 
note.

\version "2.24.4"

\fixed c' {
\time 2/4
c4 d |
e \key d \major s8 fis |
\repeat unfold 3 g2 |
c |
}

Lilypond spits out the warning:
programming error: Loose column does not have right side to attach to.

Version 2.25.20 gives the same result. The bug is probably very old, I 
tried back to version 2.17 with the same result.

    /Mats