From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: TUTORIAL.gz Date: Mon, 17 Oct 2005 10:46:43 -0400 Message-ID: References: <5144DE50-461F-4BB0-BF1B-1F3769AFB084@gmail.com> <7DD3FE7A-06BE-4D1C-9B2F-0B3B976FF11D@gmail.com> <877jcch4hg.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1129560803 8356 80.91.229.2 (17 Oct 2005 14:53:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2005 14:53:23 +0000 (UTC) Cc: David Reitter , rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 17 16:53:13 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ERWIS-0007qe-6O for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2005 16:49:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ERWIR-0004Po-Kn for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2005 10:49:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ERWIE-0004PN-Pc for emacs-devel@gnu.org; Mon, 17 Oct 2005 10:48:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ERWID-0004P5-T7 for emacs-devel@gnu.org; Mon, 17 Oct 2005 10:48:50 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ERWIC-0004Ov-9d for emacs-devel@gnu.org; Mon, 17 Oct 2005 10:48:49 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ERWGb-0005EC-2V; Mon, 17 Oct 2005 10:47:09 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 33C712CF648; Mon, 17 Oct 2005 10:46:58 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 9C1EA4AC00A; Mon, 17 Oct 2005 10:46:43 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 7E70BE6C16; Mon, 17 Oct 2005 10:46:43 -0400 (EDT) Original-To: Juri Linkov In-Reply-To: <877jcch4hg.fsf@jurta.org> (Juri Linkov's message of "Mon, 17 Oct 2005 11:34:03 +0300") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.85, requis 5, autolearn=not spam, AWL 0.05, BAYES_00 -4.90) X-MailScanner-From: monnier@iro.umontreal.ca 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:44185 Archived-At: > ! (setq file (expand-file-name filename data-directory)) > ! (unless (file-exists-p file) > ! (if (file-exists-p (concat file ".gz")) > ! (setq file (concat file ".gz")) > ! (error "%s does not exist" file))) > ! (let ((auto-compression-mode t)) > ! (find-file file)) > ========= > Note that insert-file-contents on a special buffer was used to protect > novices for accidently overwriting the original TUTORIAL file while > trying different editing commands. So replacing it with find-file is > not a good idea. But you can still leave insert-file-contents with > let-binding ((auto-compression-mode t)) around it, because compression > mode can handle compressed files on low-level file functions (including > insert-file-contents). Agreed. Except that let-binding auto-compression-mode doesn't do much if anything. Better just check whether auto-compression-mode is nil and if so don't try to load the .gz file. Actually, jka-compr.el should provide a list of extensions it understands, so we wouldn't have to hard-code .gz here. I guess jka-compr-load-suffixes could be used for that. The code in info.el that handles compressed files could/should also be merged in. Stefan