unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44901: 28.0.50; dired-compress-file: provide customization for compressing command
@ 2020-11-27  9:50 Jean Louis
  2020-11-27 10:02 ` Jean Louis
  0 siblings, 1 reply; 4+ messages in thread
From: Jean Louis @ 2020-11-27  9:50 UTC (permalink / raw)
  To: 44901


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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#44901: 28.0.50; dired-compress-file: provide customization for compressing command
  2020-11-27  9:50 bug#44901: 28.0.50; dired-compress-file: provide customization for compressing command Jean Louis
@ 2020-11-27 10:02 ` Jean Louis
  2021-01-23 23:35   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Jean Louis @ 2020-11-27 10:02 UTC (permalink / raw)
  To: Jean Louis; +Cc: 44901

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.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#44901: 28.0.50; dired-compress-file: provide customization for compressing command
  2020-11-27 10:02 ` Jean Louis
@ 2021-01-23 23:35   ` Lars Ingebrigtsen
  2021-10-11 12:35     ` Stefan Kangas
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-23 23:35 UTC (permalink / raw)
  To: Jean Louis; +Cc: 44901

Jean Louis <bugs@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#44901: 28.0.50; dired-compress-file: provide customization for compressing command
  2021-01-23 23:35   ` Lars Ingebrigtsen
@ 2021-10-11 12:35     ` Stefan Kangas
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Kangas @ 2021-10-11 12:35 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 44901-done, Jean Louis

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Jean Louis <bugs@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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-11 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27  9:50 bug#44901: 28.0.50; dired-compress-file: provide customization for compressing command Jean Louis
2020-11-27 10:02 ` Jean Louis
2021-01-23 23:35   ` Lars Ingebrigtsen
2021-10-11 12:35     ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).