I think LyX should not try to be more clever than the user. We know from other Word processors where this ends. Particularly, ERT is supposed to pass code _as is_ without any addition or modification. Doing clever tricks is impossible to get right.
Dieter Jurzitza wrote: > 1.) put automatically a blank as whitespace at the end of each TeX-insert > before closing it. For instance, inserting active babel characters will most likely break with your proposal, e.g. German "Weihnachtstage und <ERT>"~</ERT>nächte" or "(Wunsch-)<ERT>""</ERT>zettel" must not be followed by a blank. > 2.) protect a whitespace follwing a TeX-insert if there is one - assume > that the user intentionally puts a whitespace there. And if the assumption is wrong? How is the user supposed to get rid of the whitespace again? Jürgen