In regards to lisp a large amount of lisp editors are written in lisp so they do already do exactly that'
The data structure representing Lisp data (i.e. code) is stripped of relevant text editing attributes, like how it is divided into lines and using what indentation, and, oh those semicolon-delimited comments.
Text editors also have to let the user deal with bad syntax.
So it's not just a matter of, "oh, we're written in Lisp, so just hand the buffer to the Lisp reader, do something and spit it out again".