I would like to globally change the usual binding of a key in Emacs. For instance, `Return` runs the command `newline` by default, and I would like it to run `electric-newline-and-maybe-indent` instead. I currently execute

```
(local-set-key [return] 'electric-newline-and-maybe-indent)

```

via a `find-file-hooks` function. Unfortunately this breaks some modes, such as `po-mode`, where `Return` has a special meaning. I would like to know some clean way to do the rebinding so that such special meanings are not affected. In particular, I don't want to list specific modes, because I may not know them in advance.

I think that on this example, doing the rebinding only when the initial command bound to `Return` is `newline` could be a solution. But how to do this? Or is there a better solution?