emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TUTORIAL.gz


From: Stefan Monnier
Subject: Re: TUTORIAL.gz
Date: Mon, 17 Oct 2005 10:46:43 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> !       (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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]