From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: C file recoginzed as image file Date: Sat, 06 Jan 2007 00:12:51 +0000 Message-ID: <459EE983.9040008@gnu.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1168042447 11997 80.91.229.12 (6 Jan 2007 00:14:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 6 Jan 2007 00:14:07 +0000 (UTC) Cc: Juanma Barranquero , Charles Rendleman , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 06 01:14:02 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 1H2zCD-0002Cn-4v for ged-emacs-devel@m.gmane.org; Sat, 06 Jan 2007 01:14:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H2zCC-0000GH-H6 for ged-emacs-devel@m.gmane.org; Fri, 05 Jan 2007 19:14:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H2zBy-0000GB-Fx for emacs-devel@gnu.org; Fri, 05 Jan 2007 19:13:46 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H2zBx-0000Fq-JC for emacs-devel@gnu.org; Fri, 05 Jan 2007 19:13:46 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H2zBx-0000Fn-D9 for emacs-devel@gnu.org; Fri, 05 Jan 2007 19:13:45 -0500 Original-Received: from [194.106.33.237] (helo=outmail1.freedom2surf.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H2zBw-0000Oi-UY for emacs-devel@gnu.org; Fri, 05 Jan 2007 19:13:45 -0500 Original-Received: from [127.0.0.1] (i-83-67-23-108.freedom2surf.net [83.67.23.108]) by outmail1.freedom2surf.net (Postfix) with ESMTP id B34FA510AE; Sat, 6 Jan 2007 00:13:00 +0000 (GMT) User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) Original-To: Chris Moore In-Reply-To: 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:64843 Archived-At: Chris Moore wrote: > On 1/5/07, Juanma Barranquero wrote: > >> `magic-mode-alist' is more specific. The problem is that some of these >> regexps are too permissive. > > Even if magic-mode-alist was just right, and it only opened files as > images when they contain images, I don't want this mysterious .c file > I just received in the mail being opened as an image, because who > knows what it might do... I think this can be fixed by using image-mode-maybe in magic-mode-alist, instead of image-mode. image-mode-maybe also needs to bind magic-mode-alist to nil to avoid infinite recursion. Index: files.el =================================================================== RCS file: /sources/emacs/emacs/lisp/files.el,v retrieving revision 1.876 diff -c -r1.876 files.el *** files.el 4 Jan 2007 22:14:32 -0000 1.876 --- files.el 6 Jan 2007 00:09:43 -0000 *************** *** 2126,2132 **** associated with that interpreter in `interpreter-mode-alist'.") (defvar magic-mode-alist ! `((image-type-auto-detected-p . image-mode) ;; The < comes before the groups (but the first) to reduce backtracking. ;; TODO: UTF-16