emacs-devel
[Top][All Lists]
Advanced

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

Re: master 6d6bf46 2/2: Make dired-do-compress work for *.tar.gz files


From: Oleh Krehel
Subject: Re: master 6d6bf46 2/2: Make dired-do-compress work for *.tar.gz files
Date: Thu, 15 Oct 2015 15:07:08 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

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




reply via email to

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