|
From: | LinSun |
Subject: | bug#47119: 28.0.50; [patch][Dired] new user option for compressing dir suffix |
Date: | Mon, 22 Mar 2021 20:28:48 +0800 |
Hi Eli, > > but wouldn't it be better to use symbols instead of strings? >Getting a string (the name of a symbol) from a symbol is very easy, so >I'm not sure I understand the reasoning. But I won't insist. I had try use the symbol like following code snippet, but there is no option-items in the buffer after executing `customize-variable` on this variable. (defcustom dired-compress-files-default-suffix nil "..." :type '(choice (const :tag ".tar.gz" .tar.gz) (const :tag ".tar.bz2" \.tag\.bz2)) :group 'dired :version "28.1") Is there any special syntax request for making it work as a custom selectable variable? > "Refer to the ..." I’ll correct it in new patch, thanks. >> - ("\000" ".tar.gz" "tar -cf - %i | gzip -c9 > %o")) >Why did you remove the "\000" entry? As the comment explains, it is >there to allow compressing a directory. To compress a directory, you >need to run 'tar' on it first, and the .tar.gz/.tar.xz entries run >'tar' on the _result_ of gzip/xz instead. So how will compression of >directories work after your changes? I feel that I'm missing >something here, but what? The “\000” entry is special for compress directory, if you go through back, other entries in the `dired-compress-file-suffixes` is decompress commands. After apply this patch, the “\000” entry is useless. >> + "Default suffix for compressing directory. > ^^^^^^^^^ >"directories", in plural. I’ll correct it in new patch, thanks. >> +If nil, the \".tar.gz\" will be used. See `dired-compress-files-alist' for \ >> +the supported suffixes list." ^^^^ > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ >"for the list of supported suffixes" I’ll correct it in new patch, thanks. >> + (rule (cl-find-if >> + (lambda (x) (string-match-p (car x) suffix)) >> + dired-compress-files-alist))) >Do we really need cl-find-if here? what's wrong with assoc? Yes, `assoc` is more elegant: (assoc ".tar.gz" dired-compress-files-alist #'string-match-p) Thanks |
[Prev in Thread] | Current Thread | [Next in Thread] |