From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: jka-compr.el doesn't recognise gzipped files from their magic bytes Date: Fri, 21 Sep 2007 15:21:03 +0900 Message-ID: <87wsuk1quo.fsf@uwakimon.sk.tsukuba.ac.jp> References: <87vea8wsqo.fsf@uwakimon.sk.tsukuba.ac.jp> <87tzpswmjm.fsf@uwakimon.sk.tsukuba.ac.jp> <877imnia0p.fsf@uwakimon.sk.tsukuba.ac.jp> <87sl592moj.fsf@uwakimon.sk.tsukuba.ac.jp> <878x70yl6u.fsf@uwakimon.sk.tsukuba.ac.jp> <871wcs394l.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1190355646 26317 80.91.229.12 (21 Sep 2007 06:20:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Sep 2007 06:20:46 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, eliz@gnu.org, christopher.ian.moore@gmail.com, monnier@iro.umontreal.ca To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 21 08:20:44 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 1IYbsU-0000pw-OM for ged-emacs-devel@m.gmane.org; Fri, 21 Sep 2007 08:20:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IYbsS-0005yR-M6 for ged-emacs-devel@m.gmane.org; Fri, 21 Sep 2007 02:20:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IYbsL-0005wI-Bi for emacs-devel@gnu.org; Fri, 21 Sep 2007 02:20:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IYbsF-0005tm-6e for emacs-devel@gnu.org; Fri, 21 Sep 2007 02:20:28 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IYbsE-0005tg-UU for emacs-devel@gnu.org; Fri, 21 Sep 2007 02:20:22 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IYbsE-0003Lw-OY for emacs-devel@gnu.org; Fri, 21 Sep 2007 02:20:22 -0400 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IYbre-000852-J8 for emacs-pretest-bug@gnu.org; Fri, 21 Sep 2007 02:19:46 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1IYbsB-0003LN-1S for emacs-pretest-bug@gnu.org; Fri, 21 Sep 2007 02:20:22 -0400 Original-Received: from mtps01.sk.tsukuba.ac.jp ([130.158.97.223]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IYbs5-0003KQ-QU; Fri, 21 Sep 2007 02:20:14 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (unknown [130.158.99.156]) by mtps01.sk.tsukuba.ac.jp (Postfix) with ESMTP id 340201535BC; Fri, 21 Sep 2007 15:20:12 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 1216E1A2E12; Fri, 21 Sep 2007 15:21:04 +0900 (JST) In-Reply-To: X-Mailer: VM 7.17 under 21.5 (beta28) "fuki" (+CVS-20070621) XEmacs Lucid X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) 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:79421 gmane.emacs.pretest.bugs:19959 Archived-At: Kenichi Handa writes: > Sorry, I have not followed this thread. Could someone > please explain how CCL is related here? I'm drawing an analogy between (1) looking at a text stream (process or file) with autodetection, then decoding the text accroding to the detected coding system, and (2) looking at the magic in a file, and decoding it according to that magic. The example of (2) discussed here is a gzipped stream. The problem to solve is that jka-compr doesn't recognize such a stream unless it's a file with a name with .gz extension. Eli claims that looking at magic and then decoding the file would necessarily introduce a lot of overhead, and I say that that is not true, because it's not true for autodetected coding systems. I also claim that for coding that can be implemented inside of Emacs, the coding system framework could be adapted to this (or perhaps even used directly, Ben Wing has demonstrated this in XEmacs with zlib, but XEmacs is a quite different implementation from current Emacs). The point about CCL is simply that a CCL coding system is completely separate from the detector, and so must work on buffered input. You have to be able to seek to the beginning of the input stream and then translate it.