I assumed wrongly that the problem was both with emacs
and xemacs and used emacs as the generic term.
But emacs works as I want while xemacs does not.
So all what I said before and below do apply only for xemacs
in reply to Re: problem: emacs interactive shell and cpan
in thread problem: emacs interactive shell and cpan
What I want is ^M to wrap the caret to the beginning of the
line, so that the material that come after the ^M overwrites
the previous material. Anyway the code of shell-strip-ctrl-m is certainly a good starting point. Thanks.