1) (what you want): Declare that it was never intended to swallow the space. Then the current behaviour is buggy.
Yes. I do consider this as a bug. A comment inset should not change the output of the original paragraph.
2) (what I think is correct): Realize that the current behaviour is a mistake, but acknowledge that it is like that and implement the new behaviour with a file format change and lyx2lyx support.
What I can not see is where lyx2lyx is involved. Do you want to tell lyx: for format xxx, do not add {} before ' b', and for xxx+1, add it? Even for this scenario, lyx2lyx is not involved, only lyx.
Since I would be very upset if an upgrade from 1.4.2 to 1.4.3 would rearrange the output of e.g. a carefully crafted book.
The only case this can affect the user is that he had this problem and changed his lyx file to a[comment]\ b so that he can force a blank between a and b. Adding {} will not change this. I would be really surprised that someone would *intentionally* write a[comment] b for an output of ab.
Please don't commit anything until Jean-Marc is back. If he accepts 1) the patch can go both in 1.4 and trunk, but if he does not we should change the file format in trunk at the same time when the patch goes in.
I can register the patch to bugzilla.
BTW, did you check what happens to the other note environments?
lyxcomment does not generate latex output, so it is fine. Grayout works fine as well. I did not test other environments.
Maybe it is even better to remove the offending % and output \end{...} at the end of the previous line?
No. \end{comment} is required, and % is not involved in the processing of the ' b' line.
I confirmed the bug (please ask Jean-Marc that he sets the confirm bit on your bugzilla account when he is back).
I will do that. Bo