bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#4953: 23.1.50; Dired does not deal well with xz-compressed files


From: Sven Joachim
Subject: bug#4953: 23.1.50; Dired does not deal well with xz-compressed files
Date: Sat, 21 Nov 2009 22:56:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

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  <address@hidden>

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


Cheers,
       Sven





reply via email to

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