On 12/27/06, Kim F. Storm <[EMAIL PROTECTED]> wrote:
In contrast, the "recognize images by file contents" approach has already required three rounds of bug-fixing ... and there's no guarantee that there are not more "surprises"...
Well, I think that's not entirely fair. Patches for that approach have conflated several different things: - The possibility of adding matcher functions to `magic-mode-alist'. That's good IMO. - Fixes to regexps in `image-type-header-regexps'. These are good too. "^P[1-6]" matching PBM files would be over-eager even if `image-type-from-buffer' were not added to `magic-mode-alist'. - Adding `image-type-from-buffer' to `magic-mode-alist'. That's not good because there is one type of file (postscript) whose interpretation is ambiguous under that function. The right approach would be to add to `magic-mode-alist' a function specifically designed to detect images; it should also take into account `image-type-available-p' (it never makes sense to identify a .ps file as an image on Windows, for example, as the Windows port does not support postscript images). - Modifying `image-type-header-regexps' to support NOT-ALWAYS. Not good IMO because it adds interface complexity just to fix one case.
I strongly support installing this, _and_ reverting the recent image-mode related patches which would no longer be needed with this patch.
Not entirely true. Someone noted that he wanted Emacs to autodetect JPEG thumb files that had no recognizable extension, for example. That's not fixed by Stefan's patch (which I think is good, BTW). I think a good approach would be to add Stefan patch, remove the NOT-ALWAYS stuff and fix `magic-mode-alist' to use a function specifically designed to detect image types. /L/e/k/t/u _______________________________________________ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug