Subject: bug#25458: 25.1; tar mode does not handle compressed archives without specific extensions

From: Francesco Potortì <[email-masked]>
Date: Sat, 14 May 2022 00:25:36 +0200

>> From: Lars Ingebrigtsen <[email-masked]>
>> Cc: [email-masked],  [email-masked]
>> Date: Fri, 13 May 2022 17:53:15 +0200
>> 
>> Eli Zaretskii <[email-masked]> writes:
>> 
>> > But decompressing means, for most compression types, running an
>> > external program on the file.  Or does OP suggest that we link Emacs
>> > against libbz2, liblz4, liblzma, etc. to have these decompression
>> > methods available in core?
>> 
>> No, it would work just like when you read a tar.gz file -- we use
>> external decompressors for that, too, even if we then parse the
>> resulting tar file ourselves. 
>
>Then I guess I don't understand what is the problem we are asked to
>fix here.  Francesco, can you explain?

If I read foo.tar into Emacs, where foo.tar was created with

$ tar -Jcf foo.tar any.file.name

then Emacs does not recognise it as a tar file.  Instead, it should look at it, understand that it is a compressed tar file, uncompress and parse it.  If asked to save it after modification, it should compress it before saving, using the same compression method that was used in the first place.

Compression would be transparent to Emacs if it relied on Tar for parsing the tar file, because Tar manages compressed files transparently.  But since Emacs parses the tar file itself, it should behave as Tar does, that is, uncompress the file if it was compressed in the first place, and recompress when saving it after editing.