all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sven Joachim <svenjoac@gmx.de>
To: 4953@emacsbugs.donarmstrong.com
Subject: bug#4953: 23.1.50; Dired does not deal well with xz-compressed files
Date: Sat, 21 Nov 2009 22:56:47 +0100	[thread overview]
Message-ID: <877htjczj4.fsf@turtle.gmx.de> (raw)
In-Reply-To: <87d43fkkxf.fsf@turtle.gmx.de> (Sven Joachim's message of "Thu, 19 Nov 2009 08:55:56 +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@gmx.de>

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


Cheers,
       Sven





  reply	other threads:[~2009-11-21 21:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <ja7hti2i7o.fsf@fencepost.gnu.org>
2009-11-18  8:58 ` bug#4953: 23.1.50; Dired does not deal well with xz-compressed files Sven Joachim
2009-11-19  7:42   ` Glenn Morris
2009-11-19  7:55     ` Sven Joachim
2009-11-21 21:56       ` Sven Joachim [this message]
2009-11-21 22:05         ` Processed: " Emacs bug Tracking System
2009-11-23  0:40   ` bug#4953: marked as done (23.1.50; Dired does not deal well with xz-compressed files) Emacs bug Tracking System

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877htjczj4.fsf@turtle.gmx.de \
    --to=svenjoac@gmx.de \
    --cc=4953@emacsbugs.donarmstrong.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.