The difference between the who/whom debate and the preposition-ending debate is that the former has its root in a long tradition of English grammar, while the latter arose from the editorial labours of an extremely picky generation of classicists.
The use of who/whom as distinct subject/object pronouns (like thou/thee) has largely atrophied, but until barely a century ago it was prevalent and common. It was second nature to most native speakers to use them appropriately. The same distinction was made in the Saxon and Norman (Germanic and Romance) languages that contributed to English, and some modern Germanic and Romance languages still employ distinct subject and object relative pronouns. However, since their use is understood but largely ignored in modern English, they are now considered an optional nicety.
As for avoiding ending a sentence with a preposition, there was no such rule in medieval English. It was only the belief of those linguists who were educated in Latin and convinced that Latin is the true root of English (and therefore English grammar should conform with Latin) that caused this phenomenon to arise, in spite of there being no evidence of such a rule in earlier English writings. However, the myth prevailed to the point where it was accepted as "correct" grammar, and the resultant torturous grammatical constructions that have been perpetrated in the name of correctness make one feel ill.
So, in summary:
- Who are you talking to?
This is unambiguous and commonly used, and therefore mostly acceptable.
- Whom are you talking to?
This is a pleasant nicety, but not necessary. Certainly acceptable.
- To whom are you talking?
This is "correct", but will get you a filthy look and possibly a kick in the nuts in all but the most snobbish company.
For a really damning and amusing exposition of the whole issue, I strongly recommend Bill Bryson's excellent book, The Mother Tongue.
I think I found the answer. It's Focus.
Here's what McCawley 1998 says, page 68, Chapter 3
(Tests for Deep and Surface Constituent Structures):
iv. Placement of Elements with Focus
There are a number of words in English (only, even, too, also) that are associated with a focus: an element that is implicitly constrasted with other items, as in John drinks only beer, where only serves to contrast beer with such other items as wine or vodka; that is, John drinks only beer says that John doesn't drink wine, that he doesn't drink vodka, and so on.
Only usually precedes its focus, but need not immediately precede it; for example, John only drinks beer can be interpreted with beer as focus even though only is separated from it by drinks. ...
While only can be separated from its focus, it cannot be put in front of just any matter that precedes the focus.
The rule for only is that
- only can precede
- either the focus itself,
- or any constituent containing the focus.
(or any constituent containing that constituent, ad infinitum)
This means that, in the sentences
- He needed to talk only about tomatoes.
- He needed to talk about only tomatoes.
there is no difference in meaning or grammaticality.
Only can come immediately before the focus tomatoes, or it can come before the preposition phrase about tomatoes, which contains the focus. Indeed, only can come before the verb phrase needed to talk about tomatoes, which also contains the focus, with no change in meaning or grammaticality.
- He only needed to talk about tomatoes.
Of course, the further away only is from its focus, the more ambiguity is possible, because there are more possible focusses in a large constituent; that means that the focus is normally stressed heavily to identify it. This is not possible in writing, since there's no written intonation or stress except in the mind's ear. So keeping such an item close to its focus is usually good advice for writers.
Though it's not a grammar rule.
The grammar rule is as stated.
Best Answer
The 'rule' for prepositions is that they should be placed before their complement, hence the name - pre-position. Failure to do this (and the 'never end a sentence with a preposition' rule...) is called preposition stranding.
Having said that, the 'rule' that prepositions should preceded their complement has no real basis, and was probably made up by John Dryden when he grumbled about Ben Jonson writing "the bodies that those souls were frightened from".
Maybe because of this, preposition stranding in English is very common:
in Wh- questions, because the preposition complement is the wh-, which has been fronted to make a question - "He talked about what?" > "What did he talk about?"
in relative clauses, again because the preposition complement gets moved - "I told you about this restaurant" > "This restaurant is the one [that] I told you about"
in passives/false passives - "He has slept in this bed" > "This bed has been slept in."