LyX is a phenomenal text editor. Has anyone considered building a code editor on top of LyX? I think it would be very useful to be able to mingle formulas, text, images and source code.
A filter could generate proper *.c or *.java files from the appropriate blocks in the documentation. And source code would be as beatiful as documents created with LyX.