Generic 'scoped_no_eols' implementation.

So that it can be reused for other state variables.