A screenplay that was considered for the James Bond chapter that became Skyfall ended with 007 killing M. The story of the lost screenplay is in the book Some Kind of Hero: The Remarkable Story of the James Bond Films.
Frost/Nixon scribe Peter Morgan's screenplay, titled Once Upon A Time, was ultimately rejected by Sam Mendes and producers, but a few elements were retained for Skyfall.
"We always found [the script] really, really difficult to make credible or satisfying," frequent Bond screenwriter Robert Wade reportedly said in the book. "It was very dark...The only thing that remained was that M’s past comes back to haunt her and she dies at the end.”
In Skyfall, M doesn't appear until a bit later in the film and ultimately dies at the hands of Javier Bardem's Silva. Once Upon a Time would have focused more on the spy boss' backstory as an M16 agent in Cold War Berlin. Bond is dispatched to help M escape a blackmail attempt by the son of a former suitor, and after an unspecified turn of events, Bond is forced to kill her. Kind of wish they had gone in that direction!
Who knows: there's a pretty active conspiracy theory that M didn't die at all in Skyfall, so maybe Bond will have the chance to kill her again.