[Top][All Lists]

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

RE: [found the culprit] (was: [emacs -q versus empty .emacs file])

From: Drew Adams
Subject: RE: [found the culprit] (was: [emacs -q versus empty .emacs file])
Date: Wed, 14 Nov 2018 08:17:39 -0800 (PST)

> It seems I misunderstood your original report: you wanted Z on a .tgz
> file to only uncompress it?  That indeed has been changed in Emacs 26,
> for consistency with a .tar.gz file.  I don't think it's a good idea
> to have the previous subtle difference back.
> I do think that Z on a compressed Tar archive, be it a .tar.gz or .tgz
> file, should not by default unpack the archive.  We could have a
> special prefix arg to request that, and by default we should just
> uncompress the file.  But that's a different issue.

`Z' should be its own inverse.  And there definitely
needs to be a way to compress a tar file and get it
back again from the compressed file.  Unpacking is
something else.  If `Z' compresses then if used again it
should only uncompress, returning what you started with.

It's fine to have another key that unpacks a tar, or
even another key that both uncompresses and unpacks.

Is it hard to hit two keys to uncompress + unpack?
I'm a bit surprised to see that this change was made,
after decades of the pre-26 behavior.  Was something
big gained by it?

BTW, I don't see this change called out in NEWS for
Emacs 26.  Is it there and I just missed it?

Personally, I'd prefer that a choice to both uncompress
and unpack _not_ be made via a "special prefix arg" for
`Z'.  If you can use a prefix arg with `Z' then you can
hit two keys to get the uncompress + unpack behavior.

My main reason for preferring that the prefix arg not
be co-opted for this is that in my Dired+ code I have
long co-opted it ( ;-) ) to use the following special
prefix args (and the same are used for _lots_ of Dired

 Compress or uncompress marked (or next prefix argument) files.
 A prefix argument ARG specifies files to use instead of marked.
  An integer means use the next ARG files (previous -ARG, if < 0).
  `C-u': Use the current file (whether or not any are marked).
  `C-u C-u': Use all files in Dired, except directories.
  `C-u C-u C-u': Use all files and directories, except `.' and `..'.
  `C-u C-u C-u C-u': Use all files and all directories.

What's added are the multiple `C-u' prefixes.

Vanilla Dired could benefit from the same behavior, for
dired-do-* commands generally.  To provide this behavior
I redefined macro `dired-map-over-marks' slightly:

 If ARG is a cons with element 16, 64, or 256, corresponding to
   'C-u C-u', 'C-u C-u C-u', or 'C-u C-u C-u C-u', then use all files
   in the Dired buffer, where:
     16 includes NO directories (including '.' and '..')
     64 includes directories EXCEPT '.' and '..'
    256 includes ALL directories (including '.' and '..')
 If ARG is otherwise non-nil, use the current file.

reply via email to

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