From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: LinSun via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#47119: 28.0.50; [patch][Dired] new user option for compressing dir suffix Date: Tue, 23 Mar 2021 11:00:46 +0800 Message-ID: References: <605374ce.1c69fb81.54cb0.69c6@mx.google.com>, <83lfaicdra.fsf@gnu.org> <6ECADB20-F129-4024-982B-0236A5C3E719@hxcore.ol>,<83pmzr9j8y.fsf@gnu.org> Reply-To: LinSun Mime-Version: 1.0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14022"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "sunlin7@yahoo.com" , "47119@debbugs.gnu.org" <47119@debbugs.gnu.org> To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 23 04:02:44 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOXJb-0003Tu-Hg for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Mar 2021 04:02:43 +0100 Original-Received: from localhost ([::1]:38824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOXJa-0001cw-I0 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Mar 2021 23:02:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOXIx-0001av-Am for bug-gnu-emacs@gnu.org; Mon, 22 Mar 2021 23:02:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lOXIx-0005Lq-2X for bug-gnu-emacs@gnu.org; Mon, 22 Mar 2021 23:02:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lOXIw-0007vL-7E for bug-gnu-emacs@gnu.org; Mon, 22 Mar 2021 23:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: LinSun Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Mar 2021 03:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47119 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 47119-submit@debbugs.gnu.org id=B47119.161646847930409 (code B ref 47119); Tue, 23 Mar 2021 03:02:02 +0000 Original-Received: (at 47119) by debbugs.gnu.org; 23 Mar 2021 03:01:19 +0000 Original-Received: from localhost ([127.0.0.1]:59220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lOXIE-0007uP-M0 for submit@debbugs.gnu.org; Mon, 22 Mar 2021 23:01:19 -0400 Original-Received: from mail-oi1-f179.google.com ([209.85.167.179]:46926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lOXIC-0007uB-0d for 47119@debbugs.gnu.org; Mon, 22 Mar 2021 23:01:17 -0400 Original-Received: by mail-oi1-f179.google.com with SMTP id m13so15472989oiw.13 for <47119@debbugs.gnu.org>; Mon, 22 Mar 2021 20:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zoom.us; s=google; h=mime-version:date:from:subject:thread-topic:in-reply-to:message-id :references:to:cc:content-transfer-encoding; bh=aSQZugLKF9uu8B7nIFlcHdIijChId9/mavhmO3Fir4c=; b=gj2x0Oym6pqFO3oOgifrwc3OQEu/PkIt4ntsh83b5kMN4+pv4E/BkQYyQ99D6z9nl7 WP2PKvlP7T/OtDTrwCdBdk6NQ//7TNiLXHNLbvrNpRZL053Rjdqnlxa+9OF4qqce3jJ7 ggtJad06AXvasng3fuSTP47j1DwyADhyJGr6U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:from:subject:thread-topic :in-reply-to:message-id:references:to:cc:content-transfer-encoding; bh=aSQZugLKF9uu8B7nIFlcHdIijChId9/mavhmO3Fir4c=; b=BMDt2rSNpEMdPA3eWpx3sch2unhAC3ilxzgmAaRDIU5yzGY0w5BaOyOBr3d+wJ4cvG +bIBE1TDZqTD6BBGx0eEYXOBaeiANOrm4OX3zq/IybTzw/0l0hdkmcZeUwFq+QxMT9Cn XwcSI/SO4Y0P4fBFvgOFjR21X0AjyfC5LzorGVQXc2e1s8K2SvhMIjyAxumbhgRHqM7q ZUlAQFyX1nDX0D3Fg3R7raotlM+s0eEsyJ5sCqXi5+jEc1FX6DRlAT7cxdSiNyv+HMpG vI6llQAXkk0oBlcQCySkvKv8chNNbwXq+cUADQaakIYtYpTIOsOFpOoJm5in3lPpjikl Tfug== X-Gm-Message-State: AOAM5300fEufg/y2N4BjQV5LhLq8uEaP7p/r6wV+llW9YEU6/JGS5kjh IftOf/NASLz3UOy0+zMunG304A== X-Google-Smtp-Source: ABdhPJxnfah3URYuuKv+ZZSp8/BR7EdAAYHZeupluL1ednWUDGqSN/QgPLIKJeeFEglWDXuE15Q6eA== X-Received: by 2002:aca:a8cb:: with SMTP id r194mr1674095oie.2.1616468470067; Mon, 22 Mar 2021 20:01:10 -0700 (PDT) Original-Received: from DESKTOP-LINSUN ([38.99.100.2]) by smtp.gmail.com with ESMTPSA id h9sm3479480ooi.22.2021.03.22.20.01.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Mar 2021 20:01:09 -0700 (PDT) Thread-Topic: RE: bug#47119: 28.0.50; [patch][Dired] new user option for compressing dir suffix In-Reply-To: <83pmzr9j8y.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:202877 Archived-At:

Hi El= i,

 

The at= tachment is the updated patch.

When we browse a fo= lder by (find-file "/tmp/"), and try compress a folder by pressin= g =E2=80=98Z=E2=80=99, 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

=E2=80=A6

-=C2=A0=C2=A0=C2=A0 ("\000" ".tar.gz" "tar = -cf - %i | gzip -c9 > %o"))

=E2=80=A6

-=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (setq su= ffix (cdr (assoc "\000" dired-compress-file-suffixes)))

The `suffix` is from `dired-compress-file-suffixes` and it= =E2=80=99s =E2=80=98(".tar.gz" "tar -cf - %i | gzip -c9 >= %o"), so the format string for compress command line is "tar -cf= - %i | gzip -c9 > %o".

 

+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (rule (assoc suffix dired-compress-files-alist

=

+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 #'string-match-p)))

The= `rule` is from ` dired-compress-files-alist`, and it=E2=80=99s ("\\.t= ar\\.gz\\'" . "tar -cf - %i | gzip -c9 > %o") for =E2=80= =9C.tar.gz=E2=80=9D, so the format string for compress command line is &quo= t;tar -cf - %i | gzip -c9 > %o".

 = ;

And the command format strings in variable = `dired-compress-file-suffixes` are for decompression except the last entry = =E2=80=9C\000=E2=80=9D, which can be safely removed by this patch.

 

Thanks

 

=