Reapply link on state change.

This allows better use of relative state links, especially of the next
and prev kind.