[Top][All Lists]

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

Use gzip for .Z files with auto-compression-mode

From: Aaron Hawley
Subject: Use gzip for .Z files with auto-compression-mode
Date: Mon, 10 Sep 2007 12:55:38 -0400

With auto-compression mode, it would be better to open .Z files with
`gzip' rather than `uncompress'.  The gzip utility can uncompress .Z
files and is more ubiquitous than the compress package, especially on
GNU/Linux systems.

Without a compress package installed, you will get an error with
auto-compression-mode when opening a .Z file:

  Error while executing "uncompress -c < /path/to/file.Z"
  /bin/sh: uncompress: command not found

Here's a patch to use gzip by default for uncompression.

--- jka-cmpr-hook.el    2007/08/29 00:28:32
+++ jka-cmpr-hook.el    2007/09/07 15:36:41
@@ -186,7 +186,7 @@
   ;; can-append auto-mode-flag strip-extension-flag file-magic-bytes]
      "compressing"    "compress"     ("-c")
-     "uncompressing"  "uncompress"   ("-c")
+     "uncompressing"  "gzip"         ("-c" "-q" "-d")
      nil t "\037\235"]
      ;; Formerly, these had an additional arg "-c", but that fails with
      ;; "Version 0.1pl2, 29-Aug-97." (RedHat 5.1 GNU/Linux) and

Unfortunately, gzip can't write compressed files.  So after opening
the file with gzip, trying to save the file will give the error:

  /bin/sh: compress: command not found

With an old format like .Z, it's important for people to be able to open
the files, but not save them.  I would just save it uncompressed with the
.Z removed, or change it to gzip file and add the .gz to the file name.

In GNU Emacs 22.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.10.8)
 of 2007-06-26 on xenbuilder4.fedora.phx.redhat.com
Windowing system distributor `The X.Org Foundation', version 11.0.70101000
configured using `configure  '--build=i386-redhat-linux-gnu'
'--host=i386-redhat-linux-gnu' '--target=i386-redhat-linux-gnu'
'--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin'
'--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share'
'--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec'
'--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--with-pop' '--with-sound' '--with-gtk'
'build_alias=i386-redhat-linux-gnu' 'host_alias=i386-redhat-linux-gnu'
'target_alias=i386-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF
-DSYSTEM_PURESIZE_EXTRA=16777216 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fexceptions --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

Major mode: Text

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t

 National Gardening Association
 1100 Dorset Street, South Burlington, VT 05403 

reply via email to

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