Electric instead of diesel?

So here is a question to put out there. I got in a discussion last night with a couple sailing buddies about putting out the old diesel an and putting in an electric motor (for the main power-plant). I am wondering if there is anyone out there that has done that to there boat or knows of someone that has. I know that range maybe an issue, but with the right solar and wind generation I am thinking that the range would be no issues.