Subject: bug#25611: 26.0.50; dired-do-compress unpacks .tgz files

From: Glenn Morris <[email-masked]>
Date: Fri, 03 Feb 2017 12:42:18 -0500

Mike Kupfer wrote:

> Suppose I have a .tar file, I move point to that file in a dired buffer,
> and I press "Z".  My file gets converted to a .tgz file.  Okay so far.
>
> If I then press "Z" again, I expect to get the original .tar file back.
> Instead, the contents of the .tar file are extracted, and the .tgz file
> is left where it was.

Looks like this was added in https://debbugs.gnu.org/20384#11 ?
I've cc'd the author of that change.

> First problem: no .tar file.
>
> Second problem: this violates the principle of Least Surprise.  The
> prompt just talked about (de)compressing the file, it didn't say
> anything about unpacking it.  (Not to mention this is a departure from
> earlier behavior of "Z", and it's different behavior than what you'd get
> with a plain old text file.)
>
> Corollary to second problem: this can overwrite the user's existing
> files, causing the user to lose data.
>
> I can see the utility of the new behavior, but I think it should either
> be non-default behavior or bound to a different character in dired.  (I
> suppose you could just fix the prompt, but you'd lose the invertibility
> of the old "Z" behavior, which seems like a step backward.)