From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stuart D. Herring" Newsgroups: gmane.emacs.devel Subject: Re: Image mode Date: Thu, 8 Feb 2007 08:55:05 -0800 (PST) Message-ID: <40908.128.165.123.18.1170953705.squirrel@webmail.lanl.gov> References: <87k5yxeg19.fsf@jurta.org> <873b5h4vv7.fsf@stupidchicken.com> <39521.128.165.123.18.1170877435.squirrel@webmail.lanl.gov> <45CAEE65.9050306@gnu.org> Reply-To: herring@lanl.gov NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1170953742 15834 80.91.229.12 (8 Feb 2007 16:55:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Feb 2007 16:55:42 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org, Jason Rumney To: "Stefan Monnier" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 08 17:55:35 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 1HFCYT-0006oX-43 for ged-emacs-devel@m.gmane.org; Thu, 08 Feb 2007 17:55:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HFCYS-00076X-Nf for ged-emacs-devel@m.gmane.org; Thu, 08 Feb 2007 11:55:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HFCYD-000744-0O for emacs-devel@gnu.org; Thu, 08 Feb 2007 11:55:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HFCYA-00072t-Gn for emacs-devel@gnu.org; Thu, 08 Feb 2007 11:55:12 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HFCY9-00072g-Rr for emacs-devel@gnu.org; Thu, 08 Feb 2007 11:55:09 -0500 Original-Received: from mailwasher.lanl.gov ([192.65.95.54] helo=mailwasher-b.lanl.gov) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HFCY7-0001RZ-1c; Thu, 08 Feb 2007 11:55:07 -0500 Original-Received: from mailrelay3.lanl.gov (mailrelay3.lanl.gov [128.165.4.104]) by mailwasher-b.lanl.gov (8.13.8/8.13.8/(ccn-5)) with ESMTP id l18Gt67E019864; Thu, 8 Feb 2007 09:55:06 -0700 Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay3.lanl.gov (8.13.8/8.13.8/(ccn-5)) with ESMTP id l18Gt5A9016085; Thu, 8 Feb 2007 09:55:06 -0700 Original-Received: from webmail1.lanl.gov (localhost.localdomain [127.0.0.1]) by webmail1.lanl.gov (8.12.11.20060308/8.12.11) with ESMTP id l18Gt5DP012932; Thu, 8 Feb 2007 09:55:05 -0700 Original-Received: (from apache@localhost) by webmail1.lanl.gov (8.12.11.20060308/8.12.11/Submit) id l18Gt5wJ012930; Thu, 8 Feb 2007 08:55:05 -0800 X-Authentication-Warning: webmail1.lanl.gov: apache set sender to herring@lanl.gov using -f Original-Received: from 128.165.123.18 (SquirrelMail authenticated user 196434) by webmail.lanl.gov with HTTP; Thu, 8 Feb 2007 08:55:05 -0800 (PST) In-Reply-To: User-Agent: SquirrelMail/1.4.8-2.el3.7lanl X-Priority: 3 (Normal) Importance: Normal X-PMX-Version: 4.7.1.128075 X-detected-kernel: Linux 2.4-2.6 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:66125 Archived-At: >>>> Thirdly, make the function image-type-auto-detected-p scan >>>> auto-mode-alist for a non-image-mode match, and returns nil if one is >>>> found. >>> >>> This should return nil unless auto-mode-alist suggests image mode > >> That is pointless. We might as well remove image-mode from >> magic-mode-alist. > > I thought it was the beauty of his proposal. Yes, let's remove it from > magic-mode-alist. `image-mode' isn't on `magic-mode-alist'; `image-mode-maybe' is, and although perhaps Stefan's stance of nixing it entirely is best, it seems to me that the -maybe function belongs there. Visiting foo.bar with a JPEG header in it ought to load Image Minor Mode, provide the C-c C-c message, and leave the buffer in Fundamental Mode, just as visiting foo.c with the same contents should load, provide, and leave in C mode. I think (I hope) that's what the effect of Chong Yidong's proposal with my suggestions, and I think that that's what `image-mode-maybe' is for. (I also suggested that visiting foo.png with the same contents should load in image-mode without displaying, but that part is less important.) Davis PS - As far as implementing this, and dealing with the nasty hacks of interacting magic and auto lists, wouldn't it work to change FUNCTION in magic-mode-alist (if not in auto-mode-alist as well) into (FUNCTION . CONTINUE), where CONTINUE non-nil would cause the rest of the list to be scanned for further applicable functions (and would allow the processing of other variables if no later line with CONTINUE nil matched)? It seems that such a generalization would be useful without being too heavy-handed; for compatibility, for a while, a symbol (as most instances of FUNCTION are) could be treated as (list SYMBOL). -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.