To get a feel for what McCain was saying, about the best account I’ve seen is Rick Hertzberg’s in The New Yorker. He was there at the townhall meeting and wrote up his account shortly thereafter.

Read the whole thing; but here’s Rick’s conclusion and response to those who even then were already saying McCain was being taken out of context …

You have to hand it to McCain. It’s impossible to imagine any of the other Republicans engaging in this kind of extended conversation with a citizen. There was more real debate in this exchange than in any of the so-called real debates.

But what the context shows, I think, is that yanking that sound bite out of context isn’t really all that unfair. McCain’s wants to stay in Iraq until no more Americans are getting killed, no matter how long it takes and how many Americans get killed achieving that goal—that is, the goal of not getting any more Americans killed. And once that goal is achieved, we’ll stay.