From: Eli Zaretskii <eliz@gnu.org>
To: Lin Sun <lin.sun@zoom.us>
Cc: sunlin7@yahoo.com, 47119@debbugs.gnu.org
Subject: bug#47119: 28.0.50; [patch][Dired] new user option for compressing dir suffix
Date: Sat, 20 Mar 2021 12:37:13 +0200 [thread overview]
Message-ID: <83lfaicdra.fsf@gnu.org> (raw)
In-Reply-To: <605374ce.1c69fb81.54cb0.69c6@mx.google.com> (message from Lin Sun on Thu, 18 Mar 2021 23:41:53 +0800)
> Date: Thu, 18 Mar 2021 23:41:53 +0800
> From: Lin Sun <lin.sun@zoom.us>
> Cc: "47119@debbugs.gnu.org" <47119@debbugs.gnu.org>,
> sunlin <sunlin7@yahoo.com>
>
> > but wouldn't it be better to use symbols instead of strings?
>
> The new option `dired-compress-files-default-suffix` can be “.tar.gz” or “.tar.xz”… and it should work with
> variable ` dired-compress-file-suffixes` while this variable maybe extended by user. So the type:string is
> simple for implementation.
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.
> ++++
> +*** New user option 'dired-compress-files-default-suffix'.
> +This user option controls default suffix for compressing directory. If it's
> +nil, the ".tar.gz" will be used. Refer the 'dired-compress-files-alist' for
> +supported suffix list. ^^^^^^^^^
"Refer to the ..."
> - ;; This item controls the compression of directories. Its REGEXP
> - ;; element should never match any valid file name.
> - ("\000" ".tar.gz" "tar -cf - %i | gzip -c9 > %o"))
> + ("\\.tar\\'" ".tgz" nil))
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?
> +(defcustom dired-compress-files-default-suffix nil
> + "Default suffix for compressing directory.
^^^^^^^^^
"directories", in plural.
> +If nil, the \".tar.gz\" will be used. See `dired-compress-files-alist' for \
> +the supported suffixes list." ^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^
"for the list of supported suffixes"
> + (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?
Thanks.
next prev parent reply other threads:[~2021-03-20 10:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-13 3:55 bug#47119: 28.0.50; [patch][Dired] new user option for compressing dir suffix Lin Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-13 7:37 ` Eli Zaretskii
2021-03-13 7:50 ` Lin Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-18 15:41 ` bug#47119: " Lin Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-02 0:57 ` Sun Lin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-17 16:04 ` Lars Ingebrigtsen
2021-05-18 1:21 ` Sun Lin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-18 14:55 ` Glenn Morris
2021-05-18 15:49 ` Lars Ingebrigtsen
2021-05-19 0:12 ` Sun Lin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-19 15:47 ` Glenn Morris
2021-05-20 10:20 ` LinSun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-25 4:56 ` Lars Ingebrigtsen
2021-03-18 15:41 ` bug#47119: " Lin Sun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-20 10:37 ` Eli Zaretskii [this message]
2021-03-22 12:28 ` LinSun via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-03-22 17:43 ` Eli Zaretskii
2021-03-23 3:00 ` LinSun via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83lfaicdra.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=47119@debbugs.gnu.org \
--cc=lin.sun@zoom.us \
--cc=sunlin7@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.