From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleh Krehel Newsgroups: gmane.emacs.devel Subject: Re: master 6d6bf46 2/2: Make dired-do-compress work for *.tar.gz files Date: Thu, 15 Oct 2015 15:07:08 +0200 Message-ID: <87zizk1ds3.fsf@gmail.com> References: <20151013135354.28594.43074@vcs.savannah.gnu.org> <87io69opbs.fsf@gmail.com> <83lhb5xw5w.fsf@gnu.org> <87wpupqo60.fsf@Rainer.invalid> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444914737 18816 80.91.229.3 (15 Oct 2015 13:12:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Oct 2015 13:12:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Achim Gratz Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 15 15:12:12 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZmiKJ-0001g3-RV for ged-emacs-devel@m.gmane.org; Thu, 15 Oct 2015 15:12:11 +0200 Original-Received: from localhost ([::1]:47413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmiHj-0005Lk-9Y for ged-emacs-devel@m.gmane.org; Thu, 15 Oct 2015 09:09:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmiFN-0003yL-5w for emacs-devel@gnu.org; Thu, 15 Oct 2015 09:07:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmiFH-0008FH-Cf for emacs-devel@gnu.org; Thu, 15 Oct 2015 09:07:05 -0400 Original-Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:35333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmiFH-0008Ec-6p for emacs-devel@gnu.org; Thu, 15 Oct 2015 09:06:59 -0400 Original-Received: by wicll6 with SMTP id ll6so40038362wic.0 for ; Thu, 15 Oct 2015 06:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=B7QBTXTw4aeCjaKBnnqPolgrEi1QSzENIDKunjP2SAk=; b=kpzXru/ukDTTWbfA9qHg1O2x/4aes/MlEKfmXPN33VVGuAwKdp9pTREos6BRhI+j7S SRbaL4HqXqHwFN8QBc4mI1SBOh46ZxLHGZTdmaAgfSC6GMTSvl+dhe8VMMpwzDfsjyA1 RIdLJmwq9I+V3LbXjODiE7iIYoQmsnav4kYYw5DRGElslaxgSNPFC14iNlJgSV8PLY29 riIhtmCnNwbZ2MMlmVsp3HiTX/LN5PowcCQmXFRZrKnEwPS2WaTXuoLAaEf9ea431yu2 nUQ/P08jcg6c8gnUCbhACkqJOsygjeqsvR7VmT9lQ3U2X4pN93CTz5C0063Ewo6BLSDi fYTw== X-Received: by 10.180.221.228 with SMTP id qh4mr10230806wic.89.1444914418245; Thu, 15 Oct 2015 06:06:58 -0700 (PDT) Original-Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by smtp.gmail.com with ESMTPSA id fz2sm22775571wic.2.2015.10.15.06.06.57 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Oct 2015 06:06:57 -0700 (PDT) In-Reply-To: <87wpupqo60.fsf@Rainer.invalid> (Achim Gratz's message of "Wed, 14 Oct 2015 20:51:19 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:191637 Archived-At: Achim Gratz writes: > This is what a reasonably recent GNU tar offers: > > Compression options: > > -a, --auto-compress use archive suffix to determine the compression > program Thanks, Achim. For creating archives I propose that we use: (defcustom dired-compress-command "tar -caf %i.tar.gz %i" "The default command for creating archives from directories. %i denotes the directory name.") which would translate to: tar -caf foo.tar.gz foo/ And leave it up to the user to customize this command. Additionally, if the user presses "m Z", prompt her for the output file name. That way, it would be possible to compress to *.tar, *.tar.bz2 or *.tar.xz sometimes, and also have the output file name different from the auto-generated one. For extracting archives, I think it's appropriate for foo.tar.gz to call: tar -xzf foo.tar.gz if that is the setting in `dired-compress-file-suffixes'. If the user has a weird tar, she should customize `dired-compress-file-suffixes', instead of Emacs running a detection in each session. This is no different from typing a command into a shell: if the command errors, the job of the shell is to output the error, instead of trying to complete command with a different tool. Finally, is it possible to compress a collection of marked files and directories into a single archive? I think Emacs should provide that option. Currently, "Z" will compress each file one-by-one. I've never had a situation when I wanted to do that. Instead, I often want to compress only a subset of the files in the current directory and name the archive. If that command isn't present, I'd like to add it, and have it bound by default to something, possibly still "Z". Oleh