[Top][All Lists]

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

auto-compression-mode doesn't work on backups of .bz2 files

From: Chris Moore
Subject: auto-compression-mode doesn't work on backups of .bz2 files
Date: Tue, 13 Feb 2007 23:55:07 +0100

If I have auto-compression-mode turned on and edit file.txt.gz~ or
file.txt.gz.~23~ then the files are decompressed on the fly before
being shown to me.  This is good.

However, if instead I edit file.txt.bz2~ or file.txt.bz2.~23~ then the
files aren't decompressed on the fly.

This patch fixes the problem:

--- lisp/Backup/jka-cmpr-hook.el.~1~    2007-01-28 04:47:56.000000000 +0100
+++ lisp/jka-cmpr-hook.el       2007-02-13 23:46:00.000000000 +0100
@@ -191,7 +191,7 @@
      ;; Formerly, these had an additional arg "-c", but that fails with
      ;; "Version 0.1pl2, 29-Aug-97." (RedHat 5.1 GNU/Linux) and
      ;; "Version 0.9.0b, 9-Sept-98".
-    ["\\.bz2\\'"
+    ["\\.bz2\\(~\\|\\.~[0-9]+~\\)?\\'"
      "bzip2ing"        "bzip2"         nil
      "bunzip2ing"      "bzip2"         ("-d")
      nil t "BZh"]

I notice also that backups of .tgz and .tbz files aren't handled, but
that's less of a problem because tar-mode fails to make backups when I
edit tar archives, so I've never seen a .tgz~ or .tbz~ file.  tar-mode
uses tar-mode-write-file to save modified tar buffers, which in turn
uses write-region, which doesn't make backups.  Perhaps this should be
fixed as well.

In GNU Emacs (i686-pc-linux-gnu, GTK+ Version 2.8.20)
 of 2007-02-13 on trpaslik
configured using `configure  '--with-gtk' '--prefix' '/usr/local' '--with-xpm' 
'--with-jpeg' '--with-png' '--with-gif''

reply via email to

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