From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#5553: 23.1.92; Archives with wrong coding system Date: Wed, 10 Feb 2010 00:19:35 +0200 Organization: JURTA Message-ID: <87k4umyrrh.fsf@mail.jurta.org> References: <87bpfzxana.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1265756076 10156 80.91.229.12 (9 Feb 2010 22:54:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Feb 2010 22:54:36 +0000 (UTC) To: 5553@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 09 23:54:33 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NeyyT-0001rm-9h for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Feb 2010 23:54:29 +0100 Original-Received: from localhost ([127.0.0.1]:40893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NeyyS-0006v2-Mq for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Feb 2010 17:54:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Neywn-0005bA-NP for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2010 17:52:45 -0500 Original-Received: from [199.232.76.173] (port=46170 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Neywn-0005ad-Bi for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2010 17:52:45 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NeywS-0002Vk-0u for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2010 17:52:43 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45220) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NeywR-0002VW-Mr for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2010 17:52:23 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NeyWv-0003Zx-Ri; Tue, 09 Feb 2010 17:26:01 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Feb 2010 22:26:01 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5553 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5553-submit@debbugs.gnu.org id=B5553.126575433513736 (code B ref 5553); Tue, 09 Feb 2010 22:26:01 +0000 Original-Received: (at 5553) by debbugs.gnu.org; 9 Feb 2010 22:25:35 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NeyWV-0003ZV-4B for submit@debbugs.gnu.org; Tue, 09 Feb 2010 17:25:35 -0500 Original-Received: from smtp-out4.starman.ee ([85.253.0.6] helo=mx2.starman.ee) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NeyWT-0003ZP-By for 5553@debbugs.gnu.org; Tue, 09 Feb 2010 17:25:33 -0500 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (82.131.55.178.cable.starman.ee [82.131.55.178]) by mx2.starman.ee (Postfix) with ESMTP id 576163F6762 for <5553@debbugs.gnu.org>; Wed, 10 Feb 2010 00:23:32 +0200 (EET) In-Reply-To: <87bpfzxana.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 09 Feb 2010 23:19:27 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 09 Feb 2010 17:26:01 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:34991 Archived-At: > When `archive-mode' is enabled for an archive file with an unknown file > extension, using the rule ("\\(PK00\\)?[P]K\003\004" . archive-mode) > from `magic-fallback-mode-alist', visiting such a file fails with the > args-out-of-range error. > > The following patch should fix this bug using the same regexp as in > `magic-fallback-mode-alist' and the same coding system as for archive > file extensions in `auto-coding-alist': The same problem exists also for images. `magic-fallback-mode-alist' contains: (image-type-auto-detected-p . image-mode) but visiting an image file with a non-standard file extension (i.e. not in `auto-mode-alist') doesn't display it as an image. The following patch fixes this problem, but it seems duplicating image regexps from `image-type-header-regexps' is too ugly? === modified file 'lisp/international/mule.el' --- lisp/international/mule.el 2010-02-09 05:00:56 +0000 +++ lisp/international/mule.el 2010-02-09 22:16:28 +0000 @@ -1655,7 +1655,14 @@ (defcustom auto-coding-regexp-alist ("\\`\xEF\xBB\xBF" . utf-8-with-signature) ("\\`;ELC\024\0\0\0" . emacs-mule) ; Emacs 20-compiled ;; For `archive-mode' in `magic-fallback-mode-alist': - ("\\(PK00\\)?[P]K\003\004" . no-conversion-multibyte))) + ("\\(PK00\\)?[P]K\003\004" . no-conversion-multibyte) + ;; For `image-mode' in `magic-fallback-mode-alist' + ;; (regexps duplicated from `image-type-header-regexps'): + ("\\`GIF8[79]a" . no-conversion) ; gif + ("\\`\x89PNG\r\n\x1a\n" . no-conversion) ; png + ("\\`\\(?:MM\0\\*\\|II\\*\0\\)" . no-conversion) ; tiff + ("\\`\xff\xd8" . no-conversion) ; jpeg + )) "Alist of patterns vs corresponding coding systems. Each element looks like (REGEXP . CODING-SYSTEM). A file whose first bytes match REGEXP is decoded by CODING-SYSTEM on reading. -- Juri Linkov http://www.jurta.org/emacs/