This way, 'file --mime-type $buffer' is called only once per file rather than once per filetype detection hook.
(with scope a prefix of global,buffer or window)