|
From: | LinSun |
Subject: | bug#47119: 28.0.50; [patch][Dired] new user option for compressing dir suffix |
Date: | Tue, 23 Mar 2021 11:00:46 +0800 |
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 |
[Prev in Thread] | Current Thread | [Next in Thread] |