[Top][All Lists]

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

`auto-compression-mode' is dangerous (and not needed) in Emacs 21, and o

From: Eric Hanchrow
Subject: `auto-compression-mode' is dangerous (and not needed) in Emacs 21, and ought to be disabled.
Date: 07 Jan 2002 19:40:34 -0800

In GNU Emacs 21.1.1 (i386-debian-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2001-12-06 on raven, modified by Debian
configured using `configure  i386-debian-linux-gnu --prefix=/usr 
--sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib 
--infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --with-x=yes 
--with-x-toolkit=athena --without-gif'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: 
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

I had `(auto-compression-mode 1)' in my .emacs, probably as a leftover
from Emacs20 or perhaps even Emacs19, and until Emacs21, it caused no
trouble.  But with Emacs21, it interferes with saving compressed files.

To see what I mean, do the following steps:

* Create a small compressed text file like this:

        echo hey you | gzip > /tmp/hey.gz

* Try to visit it with auto-compression-mode turned on:

        emacs21 --eval='(auto-compression-mode 1)' -q /tmp/hey.gz 

  So far, so good: the file's contents appear on screen.

* Now edit the file by appending some text to it:

        M-> What up? 

* Try to save:

        C-x C-s

  Note that Emacs asks you if you'd like to `Write hey.gz using
  gzip'.  Since that sounds reasonable, answer yes by typing `y'.
  Now Emacs asks you to select a coding system.  I have no idea what
  this means, but accepting the default (utf-8) seems like the
  reasonable thing to do, so hit RET.  Note that Emacs asks the same
  question again.  This is puzzling.  Hit RET again.  Now Emacs seems
  happy -- it prints `Wrote /tmp/hey.gz' in the echo area.

  However, examine the file /tmp/hey.gz, and you'll see that it
  doesn't contain what I'd expect it to: you can uncompress it with
  `uncompress /tmp/hey.gz', but the resulting file isn't the words
  `hey you What up?', but rather a bunch of apparently random
  characters, which the `file' program describes as merely `data'.
  This is scary.

Now it's possible that some combination of answers to Emacs' various
questions (`Write using gzip', `coding system') might make things work
out, but there are eight such combinations, and I didn't bother trying
them all.  Instead, I simply removed `(auto-compression-mode 1)' from
my .emacs, and Emacs21 reads and writes compressed files just fine on
its own.

Since auto-compression-mode seems not to be required with Emacs21, and
in fact seems to at least cause confusing behavior, I suggest it be
disabled under Emacs 21.

PGP Fingerprint: 3E7B A3F3 96CA 8958 ACC5  C8BD 6337 0041 C01C 5276

reply via email to

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