Setting return globally to newline-and-indent only works on XEmacs.
Set programming modes individually in Emacs.