Hi Eli,
The attachment is the updated patch.
When we browse a folder by (find-file "/tmp/"), and try compress a folder by pressing ‘Z’, it will always produce *.tar.gz file, but I prefer *.tar.xz for its high compress ratio on text files.
I try my best to explain the changes:
(defvar dired-compress-file-suffixes
…
- ("\000" ".tar.gz" "tar -cf - %i | gzip -c9 > %o"))
…
- (setq suffix (cdr (assoc "\000" dired-compress-file-suffixes)))
The `suffix` is from `dired-compress-file-suffixes` and it’s ‘(".tar.gz" "tar -cf - %i | gzip -c9 > %o"), so the format string for compress command line is "tar -cf - %i | gzip -c9 > %o".
+ (rule (assoc suffix dired-compress-files-alist
+ #'string-match-p)))
The `rule` is from ` dired-compress-files-alist`, and it’s ("\\.tar\\.gz\\'" . "tar -cf - %i | gzip -c9 > %o") for “.tar.gz”, so the format string for compress command line is "tar -cf - %i | gzip -c9 > %o".
And the command format strings in variable `dired-compress-file-suffixes` are for decompression except the last entry “\000”, which can be safely removed by this patch.
Thanks