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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 44901 in the body.
You can then email your comments to 44901 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#44901; Package emacs. (Fri, 27 Nov 2020 09:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jean Louis <bugs <at> gnu.support>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 27 Nov 2020 09:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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
⎔ λ 🄯 𝍄 𝌡 𝌚




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44901; Package emacs. (Fri, 27 Nov 2020 10:06:01 GMT) Full text and rfc822 format available.

Message #8 received at 44901 <at> debbugs.gnu.org (full text, mbox):

From: Jean Louis <bugs <at> gnu.support>
To: Jean Louis <bugs <at> gnu.support>
Cc: 44901 <at> debbugs.gnu.org
Subject: Re: bug#44901: 28.0.50; dired-compress-file: provide customization
 for compressing command
Date: Fri, 27 Nov 2020 13:02:25 +0300
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"))

Updating that function with those compressors is useful and related
this wish to have "gzip" also customizable. As dired-x supports
decompressing various files but user have no possibility to customize
the compressor command.

There are also pbzip2, pigz, pixz, pixz that offer parallel
compression that could be included in future.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44901; Package emacs. (Sat, 23 Jan 2021 23:36:01 GMT) Full text and rfc822 format available.

Message #11 received at 44901 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Jean Louis <bugs <at> gnu.support>
Cc: 44901 <at> debbugs.gnu.org
Subject: Re: bug#44901: 28.0.50; dired-compress-file: provide customization
 for compressing command
Date: Sun, 24 Jan 2021 00:35:33 +0100
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.

This change was small enough to apply without assigning copyright to the
FSF, but for future patches you want to submit, it might make sense to
get the paperwork started now, so that subsequent patches can be applied
speedily. Would you be willing to sign such paperwork?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Mon, 11 Oct 2021 12:36:05 GMT) Full text and rfc822 format available.

Notification sent to Jean Louis <bugs <at> gnu.support>:
bug acknowledged by developer. (Mon, 11 Oct 2021 12:36:06 GMT) Full text and rfc822 format available.

Message #16 received at 44901-done <at> debbugs.gnu.org (full text, mbox):

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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 09 Nov 2021 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 140 days ago.

Previous Next


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