Subject: bug#44901: closed (Re: bug#44901: 28.0.50; dired-compress-file: provide customization for compressing command)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 11 Oct 2021 12:36:06 +0000

Your bug report

#44901: 28.0.50; dired-compress-file: provide customization for compressing command

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
44901: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=44901
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#44901: 28.0.50; dired-compress-file: provide customization for compressing command
From: Stefan Kangas <[email-masked]>
To: Lars Ingebrigtsen <[email-masked]>
Cc: [email-masked], Jean Louis <[email-masked]>
Date: Mon, 11 Oct 2021 05:35:55 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Lars Ingebrigtsen <[email-masked]> writes:

> Jean Louis <[email-masked]> writes:
>
>> Additionally this variable should be updated:
>>
>> (defvar dired-compress-files-alist
>>   '(("\\.tar\\.gz\\'" . "tar -cf - %i | gzip -c9 > %o")
>>     ("\\.tar\\.bz2\\'" . "tar -cf - %i | bzip2 -c9 > %o")
>>     ("\\.tar\\.xz\\'" . "tar -cf - %i | xz -c9 > %o")
>>     ("\\.tar\\.zst\\'" . "tar -cf - %i | zstd -19 -o %o")
>>     ("\\.zip\\'" . "zip %o -r --filesync %i"))
>>
>> to be:
>>
>> (defvar dired-compress-files-alist
>>   '(("\\.tar\\.gz\\'" . "tar -cf - %i | gzip -c9 > %o")
>>     ("\\.tar\\.bz2\\'" . "tar -cf - %i | bzip2 -c9 > %o")
>>     ("\\.tar\\.xz\\'" . "tar -cf - %i | xz -c9 > %o")
>>     ("\\.tar\\.lz\\'" . "tar -cf - %i | lzip -c9 > %o") ;; new line for lzip
>>     ("\\.tar\\.lzo\\'" . "tar -cf - %i | lzop -c9 > %o") ;; new line for lzop
>>     ("\\.tar\\.zst\\'" . "tar -cf - %i | zstd -19 -o %o")
>>     ("\\.zip\\'" . "zip %o -r --filesync %i"))
>
> Makes sense; I've now pushed this to Emacs 28.

It seems like this was fixed, so I'm closing this bug report.

Subject: 28.0.50; dired-compress-file: provide customization for compressing command
From: Jean Louis <[email-masked]>
To: [email-masked]
Date: Fri, 27 Nov 2020 12:50:16 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

In the function: dired-compress-file there is hard coded gzip as
compressor:

(dired-check-process (concat "Compressing " file)
                        "gzip" "-f" file))

It would be useful to have customization as there are various other
compressors that are often used to distribute files such as these, and
all of them supprot -f option:

- bzip2
- xz
- lzip
- there may be others

Customization option could be called dired-compress-command or
similar and it could default to gzip 

(defcustom dired-compress-command "gzip"
  "Default compressing command for dired. The commpressing 
command shall support the option `-f' to force overwriting the file"
  :type 'string
  :group 'dired)

Then the part here in the function `dired-compress-file' can be changed to:

(dired-check-process (concat "Compressing " file)
                        dired-compress-command "-f" file))

Thanks,
Jean Louis
⎔ λ 🄯 𝍄 𝌡 𝌚