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, 19 Jan 2007 18:10:47 +0100 Message-ID: References: <20070114025247.GB2401@kobe.laptop> <45AB9A3C.5030406@gnu.org> <45B0F2CA.9060808@gnu.org> 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 1169226851 15684 80.91.229.12 (19 Jan 2007 17:14:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 19 Jan 2007 17:14:11 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 19 18:14:07 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 1H7xJO-0004mF-Ki for ged-emacs-devel@m.gmane.org; Fri, 19 Jan 2007 18:13:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7xJO-00030B-0G for ged-emacs-devel@m.gmane.org; Fri, 19 Jan 2007 12:13:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H7xGQ-0000Vw-Ku for emacs-devel@gnu.org; Fri, 19 Jan 2007 12:10:54 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H7xGN-0000Q5-Lq for emacs-devel@gnu.org; Fri, 19 Jan 2007 12:10:53 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7xGM-0000OT-N0 for emacs-devel@gnu.org; Fri, 19 Jan 2007 12:10:50 -0500 Original-Received: from [66.249.92.172] (helo=ug-out-1314.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H7xGK-0003Fp-Un for emacs-devel@gnu.org; Fri, 19 Jan 2007 12:10:50 -0500 Original-Received: by ug-out-1314.google.com with SMTP id j3so562054ugf for ; Fri, 19 Jan 2007 09:10:48 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bSfJNk5mRPEzhrKmqW0HReBzOqHsF5w5dzdhSKAzfcLj47eZfZWmQmOiftR2MK4NKz1Q+tkInY7/qgheK57gj0mx46qqiVZh0m2Hn1OwGT5j31ZHc1dXsBQUVeGGoSa2X7EwJCwL8fIJeeeUM7pUT3BC6+CuNyIUSambfWotjRo= Original-Received: by 10.67.119.13 with SMTP id w13mr3316371ugm.1169226647829; Fri, 19 Jan 2007 09:10:47 -0800 (PST) Original-Received: by 10.67.105.7 with HTTP; Fri, 19 Jan 2007 09:10:47 -0800 (PST) Original-To: "Jason Rumney" In-Reply-To: <45B0F2CA.9060808@gnu.org> 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:65307 Archived-At: On 1/19/07, Jason Rumney wrote: > OK. I didn't look closely enough to determine for sure, just thought I'd > raise the alarm for whoever implemented this to check that their fix > really prevented the bugs it was intended to. It looks like it is > probably a straightforward case of avoiding displaying the image then. This is an example patch that implements the idea discussed. It's as simple as it gets. I'm not entirely happy because I don't like the idea of perverting `magic-mode-alist' to set a minor mode instead of a major mode, but perhaps it can be accepted as a special deal for the potentially-dangerous image libraries. Of course, if this is accepted some other function's docstrings would need a little bit of polishing. /L/e/k/t/u Index: lisp/files.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/files.el,v retrieving revision 1.877 diff -u -2 -r1.877 files.el --- lisp/files.el 6 Jan 2007 21:50:14 -0000 1.877 +++ lisp/files.el 19 Jan 2007 16:32:03 -0000 @@ -2128,5 +2128,5 @@ (defvar magic-mode-alist - `((image-type-auto-detected-p . image-mode) + `((image-type-auto-detected-p . image-minor-mode) ;; The < comes before the groups (but the first) to reduce backtracking. ;; TODO: UTF-16