When auto-mode-alist decides the buffer should use mode Foo and
magic-mode-alist thinks it should be type Bar, we have the
following possibilities:
- the file name's extension is wrong: we should use Bar.
- the magic code is wrong: we should use Foo.
- both are wrong.
- both are correct.
My guess is that in 99% of the cases, both are "correct".
So I suggest something like: magic-mode-alist doesn't take precedence over
auto-mode-alist. Instead, we look them up both, and if there's a conflict,
we lookup a new var `mode-precedence-alist' to see if the user prefers one
over the other. If that doesn't resolve the conflict, check
`derived-mode-p'. If the conflict is still not resolved, prompt the user.