From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.devel Subject: Re: C file recoginzed as image file Date: Fri, 5 Jan 2007 20:02:26 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1168023817 6454 80.91.229.12 (5 Jan 2007 19:03:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 5 Jan 2007 19:03:37 +0000 (UTC) Cc: Charles Rendleman , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 05 20:03:36 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H2uLa-0003xF-PT for ged-emacs-devel@m.gmane.org; Fri, 05 Jan 2007 20:03:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H2uLa-0000bx-6o for ged-emacs-devel@m.gmane.org; Fri, 05 Jan 2007 14:03:22 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H2uKl-0008Fg-TL for emacs-devel@gnu.org; Fri, 05 Jan 2007 14:02:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H2uKi-0008BL-Vv for emacs-devel@gnu.org; Fri, 05 Jan 2007 14:02:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H2uKi-0008B2-Om for emacs-devel@gnu.org; Fri, 05 Jan 2007 14:02:28 -0500 Original-Received: from [66.249.92.174] (helo=ug-out-1314.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H2uKh-0002Ew-7Q for emacs-devel@gnu.org; Fri, 05 Jan 2007 14:02:28 -0500 Original-Received: by ug-out-1314.google.com with SMTP id j3so6470200ugf for ; Fri, 05 Jan 2007 11:02:26 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AskCKIRWYiTwdPH5cnTCUeZNvo+DKN2Mtx4Pa/Gq5apxMahh3fdlc1ARTO99DHkNtvhRhnWls+yo4G1i0vcleSDR5iGPHlKgqJ6YtRKiRA7OyBpBe4WTbZtjvKIj0JiJttY3E1lEX0wylf5X4VZ5XhWXzC8Ah4bFc88+Fz94KXs= Original-Received: by 10.82.120.14 with SMTP id s14mr2141708buc.1168023746111; Fri, 05 Jan 2007 11:02:26 -0800 (PST) Original-Received: by 10.82.147.2 with HTTP; Fri, 5 Jan 2007 11:02:26 -0800 (PST) Original-To: "Chris Moore" In-Reply-To: Content-Disposition: inline X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:64831 Archived-At: On 1/5/07, Chris Moore wrote: > I'm thinking it would be safer to use auto-mode-alist before > magic-mode-alist. `magic-mode-alist' is more specific. The problem is that some of these regexps are too permissive. Supposing that anything that starts with "#define " is a XBM file makes no sense. I think it'd be good to apply the following patch, so auto-detection of images by content is disabled, but available to these wanting to set it up. (And we should mention `image-type-auto-detectable' in NEWS.) /L/e/k/t/u Index: lisp/image.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/image.el,v retrieving revision 1.66 diff -u -2 -r1.66 image.el --- lisp/image.el 30 Dec 2006 01:51:24 -0000 1.66 +++ lisp/image.el 5 Jan 2007 18:53:41 -0000 @@ -65,12 +65,12 @@ (defvar image-type-auto-detectable - '((pbm . t) - (xbm . t) - (bmp . maybe) - (gif . maybe) - (png . maybe) - (xpm . maybe) - (jpeg . maybe) - (tiff . maybe) + '((pbm . nil) + (xbm . nil) + (bmp . nil) + (gif . nil) + (png . nil) + (xpm . nil) + (jpeg . nil) + (tiff . nil) (postscript . nil)) "Alist of (IMAGE-TYPE . AUTODETECT) pairs used to auto-detect image files.