GNU bug report logs - #44901
28.0.50; dired-compress-file: provide customization for compressing command

Previous Next

Package: emacs;

Reported by: Jean Louis <bugs <at> gnu.support>

Date: Fri, 27 Nov 2020 09:51:02 UTC

Severity: wishlist

Found in version 28.0.50

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Kangas <stefan <at> marxist.se>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#44901: closed (28.0.50; dired-compress-file: provide
 customization for compressing command)
Date: Mon, 11 Oct 2021 12:36:05 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 11 Oct 2021 05:35:55 -0700
with message-id <CADwFkm=2T7r6gHNM38BD2iBJDKYy7T4VTjLH_VD2sszeTUerUg <at> mail.gmail.com>
and subject line Re: bug#44901: 28.0.50; dired-compress-file: provide customization for compressing command
has caused the debbugs.gnu.org bug report #44901,
regarding 28.0.50; dired-compress-file: provide customization for compressing command
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
44901: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=44901
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jean Louis <bugs <at> gnu.support>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50;
 dired-compress-file: provide customization for compressing command
Date: Fri, 27 Nov 2020 12:50:16 +0300
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
⎔ λ 🄯 𝍄 𝌡 𝌚


[Message part 3 (message/rfc822, inline)]
From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 44901-done <at> debbugs.gnu.org, Jean Louis <bugs <at> gnu.support>
Subject: Re: bug#44901: 28.0.50; dired-compress-file: provide customization
 for compressing command
Date: Mon, 11 Oct 2021 05:35:55 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Jean Louis <bugs <at> gnu.support> 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.


This bug report was last modified 3 years and 223 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.