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: C file recoginzed as image file Date: Mon, 8 Jan 2007 16:11:31 -0800 (PST) Message-ID: <40673.128.165.123.18.1168301491.squirrel@webmail.lanl.gov> References: 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 1168301516 456 80.91.229.12 (9 Jan 2007 00:11:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 9 Jan 2007 00:11:56 +0000 (UTC) Cc: dooglus@gmail.com, c.a.rendle@gmail.com, Stefan Monnier , rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 09 01:11:52 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 1H44ak-00071B-Gt for ged-emacs-devel@m.gmane.org; Tue, 09 Jan 2007 01:11:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H44aj-0002ol-Va for ged-emacs-devel@m.gmane.org; Mon, 08 Jan 2007 19:11:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H44aY-0002lV-G7 for emacs-devel@gnu.org; Mon, 08 Jan 2007 19:11:38 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H44aW-0002it-JF for emacs-devel@gnu.org; Mon, 08 Jan 2007 19:11:38 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H44aW-0002ip-Fu for emacs-devel@gnu.org; Mon, 08 Jan 2007 19:11:36 -0500 Original-Received: from [192.65.95.54] (helo=mailwasher-b.lanl.gov) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H44aT-0003UG-Of; Mon, 08 Jan 2007 19:11:34 -0500 Original-Received: from mailrelay1.lanl.gov (mailrelay1.lanl.gov [128.165.4.101]) by mailwasher-b.lanl.gov (8.13.8/8.13.8/(ccn-5)) with ESMTP id l090BWKj021489; Mon, 8 Jan 2007 17:11:33 -0700 Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay1.lanl.gov (8.13.8/8.13.8/(ccn-5)) with ESMTP id l090BVsM019136; Mon, 8 Jan 2007 17:11:32 -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 l090BVBf008355; Mon, 8 Jan 2007 17:11:31 -0700 Original-Received: (from apache@localhost) by webmail1.lanl.gov (8.12.11.20060308/8.12.11/Submit) id l090BV3G008353; Mon, 8 Jan 2007 16:11:31 -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; Mon, 8 Jan 2007 16:11:31 -0800 (PST) In-Reply-To: Original-To: "Juanma Barranquero" User-Agent: SquirrelMail/1.4.8-2.el3.7lanl X-Priority: 3 (Normal) Importance: Normal X-PMX-Version: 4.7.1.128075 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:65029 Archived-At: > That's more of a philosophical question, but a JPEG image is a JPEG > image. Whether you treat it like text, bytes, an image or a > pseudo-random source is another matter entirely. Your camera didn't > take a text file or a bit of random binary data, it took a picture in > JPEG format. It's a practical question: how many times that image will > be used as that, an image, as opposed to as any other thing? It's true that a JPEG image is a JPEG image, but "foo.jpg" (or even "foo.c") is not a JPEG image, it's a file (well, a filename, but consider the associated file). And a (seekable) file is a sequence of bytes, not an image. An image can be constructed from it, but just as you said it's a matter of how you treat it. The question here (for Emacs) is not "What is the source and importance of this data?" whose answer might be "A camera; it's a picture of the Thames." but rather "In what manner should these bytes with this name be presented to the user?" whose answer might be "As a C file, since its extension is `.c'." or "As a JPEG image, because JPEG images begin the same way as these bytes do.". Poorer reasons to be sure than "It's a picture of the Thames because that's where I was when I took it.", but they're the best we can hope to do; the problem is which heuristics are most useful and how to resolve conflicts in the partial information we have. Finally, remember that we don't have a concept of "that image" for counting usage: this decision has to be made the first time we see a file, regardless of its history of usage. Davis -- 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.