From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Image mode Date: Sun, 11 Feb 2007 23:55:02 -0500 Message-ID: References: <87k5yxeg19.fsf@jurta.org> <87iregmafd.fsf@stupidchicken.com> <86irefojcc.fsf@lola.quinscape.zz> <86tzxzn0bx.fsf@lola.quinscape.zz> <86ps8nmy95.fsf@lola.quinscape.zz> <86d54nmve9.fsf@lola.quinscape.zz> <868xfbmthh.fsf@lola.quinscape.zz> <39229.128.165.123.18.1170864622.squirrel@webmail.lanl.gov> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1171256198 27777 80.91.229.12 (12 Feb 2007 04:56:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Feb 2007 04:56:38 +0000 (UTC) Cc: lekktu@gmail.com, cyd@stupidchicken.com, emacs-devel@gnu.org To: herring@lanl.gov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 12 05:56:31 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 1HGTEt-000727-KZ for ged-emacs-devel@m.gmane.org; Mon, 12 Feb 2007 05:56:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGTEt-0003Oj-7r for ged-emacs-devel@m.gmane.org; Sun, 11 Feb 2007 23:56:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HGTEj-0003Oe-Gl for emacs-devel@gnu.org; Sun, 11 Feb 2007 23:56:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HGTEi-0003OS-NC for emacs-devel@gnu.org; Sun, 11 Feb 2007 23:56:20 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGTEi-0003OP-Hs for emacs-devel@gnu.org; Sun, 11 Feb 2007 23:56:20 -0500 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HGTEi-0007Ig-77 for emacs-devel@gnu.org; Sun, 11 Feb 2007 23:56:20 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1HGTDS-0001br-9B; Sun, 11 Feb 2007 23:55:02 -0500 In-reply-to: <39229.128.165.123.18.1170864622.squirrel@webmail.lanl.gov> (herring@lanl.gov) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:66278 Archived-At: The point is that all users, whether they know about the risks or not, mean for Emacs to render a JPEG if they M-x find-file foo.jpg, because that is really the only useful thing Emacs could do there. When -some- users M-x find-file foo.txt, they are specifically wanting Emacs -not- to render the file as an image, because they are being careful and dealing only in text. Other users who would see the JPEG data and think only "huh, this is garbage" rather than "wow, it really was an image posing as text" would benefit from image-minor-mode and its helpful minibuffer message about C-c C-c. In either case, starting the major mode associated with the file's extension is probably appropriate. So for some users, recognizing but failing to render an image.txt is helpful, and for others it does no real harm. And for all users, recognizing and rendering an image.jpg is sensible. I think you have convinced me that there is some benefit in treating the contents-extension mismatch case differently from the case where they match. So I am led to think of these rules: 1. If the file name indicates an image type and the contents match it, use image mode. 2. If the file name has no meaning and the contents indicate an image, use Fundamental mode and Image minor mode. 3. If the file name has a meaning which conflicts with the image type, obey the file name. #3 is mostly the case after Yidong's latest change. The only change proposed in #3 is that a file foo.jpg which contains a PNG should be treated as a case of #3. All of this is separate from the question of whether to display an image immediately even in case 1.