GNU bug report logs - #4953
23.1.50; Dired does not deal well with xz-compressed files

Previous Next

Package: emacs;

Reported by: Sven Joachim <svenjoac <at> gmx.de>

Date: Wed, 18 Nov 2009 09:05:04 UTC

Severity: wishlist

Tags: patch

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 4953 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Sven Joachim <svenjoac <at> gmx.de>
To: 4953 <at> debbugs.gnu.org
Cc: Glenn Morris <rgm <at> gnu.org>
Subject: Re: bug#4953: 23.1.50; Dired does not deal well with xz-compressed files
Date: Sat, 21 Nov 2009 22:56:47 +0100
tags 4953 + patch
thanks

On 2009-11-19 08:55 +0100, Sven Joachim wrote:

> On 2009-11-19 08:42 +0100, Glenn Morris wrote:
>
>> Sven Joachim wrote:
>>
>>> - dired-do-shell-command does not offer anything for file.tar.xz
>>
>> I don't know what this means. M-x dired-do-shell-command for
>> foo.tar.gz doesn't seem to do anything special.
>
> You need to load dired-x first (Info "(dired-x) Shell Command Guessing").

Here is a patch that adds support for xz-compressed files to
dired-guess-shell-alist-default, emulating the case of bzip2-compressed
files:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 4da19f6..dce8685 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -1017,6 +1017,16 @@ dired."
 	 ;; Optional decompression.
 	 "bunzip2")
 
+   ;; xz'ed archives
+   (list "\\.t\\(ar\\.\\)?xz$"
+	 "unxz -c * | tar xvf -"
+	 ;; Extract files into a separate subdirectory
+	 '(concat "mkdir " (file-name-sans-extension file)
+		  "; unxz -c * | tar -C "
+		  (file-name-sans-extension file) " -xvf -")
+	 ;; Optional decompression.
+	 "unxz")
+
    '("\\.shar\\.Z$" "zcat * | unshar")
    '("\\.shar\\.g?z$" "gunzip -qc * | unshar")
 
@@ -1098,6 +1108,7 @@ dired."
    (list "\\.g?z$" '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
    (list "\\.dz$" "dictunzip")
    (list "\\.bz2$" "bunzip2")
+   (list "\\.xz$" "unxz")
    (list "\\.Z$" "uncompress"
 	 ;; Optional conversion to gzip format.
 	 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
--8<---------------cut here---------------end--------------->8---

Suggested Changelog entry:

2009-11-21  Sven Joachim  <svenjoac <at> gmx.de>

	* dired-x.el (dired-guess-shell-alist-default): Support xz format.


Cheers,
       Sven



This bug report was last modified 15 years and 238 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.