Subject: Re: bug#5553: 23.1.92; Archives with wrong coding system

From: Juri Linkov <[email-masked]>
Date: Wed, 10 Feb 2010 02:09:56 +0200

> Thanks, but please provide a self-contained recipe for reproducing the
> problem, starting with "emacs -Q".

AFAICS, it is not reproducible with "emacs -Q" where visited archives
and images with non-standard file extensions are visited in proper modes.

The problem appears with using Unicad (http://code.google.com/p/unicad/).
Basically what is does boils down to the following line:

  (add-to-list 'auto-coding-functions 'unicad-universal-charset-detect)

The rest is just statistical guessing of the coding system based solely
on the content of the file, and in case of archives and images, the
guess is incorrect, and `magic-fallback-mode-alist' fails to match
a mode regexp at the beginning of the buffer.

So the question is whether we should complement entries in
`magic-fallback-mode-alist' with the corresponding entries in
`auto-coding-regexp-alist' with the same regexps (like we complement
entries in `auto-mode-alist' with entries in `auto-coding-alist')?

Or every function in `auto-coding-functions' that determines a coding system
should somehow take care of exceptions in `magic-fallback-mode-alist'?

-- 
Juri Linkov
http://www.jurta.org/emacs/