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: Mon, 22 Mar 2021 20:28:48 +0800 Message-ID: <6ECADB20-F129-4024-982B-0236A5C3E719@hxcore.ol> References: <605374ce.1c69fb81.54cb0.69c6@mx.google.com>, <83lfaicdra.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="36575"; 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 Mon Mar 22 13:32:16 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 1lOJjE-0009MU-1K for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Mar 2021 13:32:16 +0100 Original-Received: from localhost ([::1]:49242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOJjC-0005ZS-Qn for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Mar 2021 08:32:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOJj0-0005W8-VZ for bug-gnu-emacs@gnu.org; Mon, 22 Mar 2021 08:32:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lOJj0-0000uE-Mp for bug-gnu-emacs@gnu.org; Mon, 22 Mar 2021 08:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lOJj0-0004k4-JA for bug-gnu-emacs@gnu.org; Mon, 22 Mar 2021 08:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: LinSun Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Mar 2021 12:32: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.161641627318142 (code B ref 47119); Mon, 22 Mar 2021 12:32:02 +0000 Original-Received: (at 47119) by debbugs.gnu.org; 22 Mar 2021 12:31:13 +0000 Original-Received: from localhost ([127.0.0.1]:56412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lOJiC-0004iX-Np for submit@debbugs.gnu.org; Mon, 22 Mar 2021 08:31:12 -0400 Original-Received: from mail-oi1-f170.google.com ([209.85.167.170]:47010) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lOJiA-0004iI-QJ for 47119@debbugs.gnu.org; Mon, 22 Mar 2021 08:31:11 -0400 Original-Received: by mail-oi1-f170.google.com with SMTP id m13so12828201oiw.13 for <47119@debbugs.gnu.org>; Mon, 22 Mar 2021 05:31:10 -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=aG6peroW74mqyjSz0+rsqmaxZ9p8D7kV9c5t9D4LKso=; b=KM10tQAMyuSzQT4dsr2z2L4D4O4nQHGdbj93JkJd5jrU8ETgbWCMcLeBX6LYp2HDjf i4Z1bQ3AGwzZl0cuh4U2uNPEztQW0SlRxzX4lbsAeAMOINJ22guov4mBFysL+epR2Rj3 Hpw9+2kmnBDmMOCoHVSrgXR4RBfn/c5tkS72c= 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=aG6peroW74mqyjSz0+rsqmaxZ9p8D7kV9c5t9D4LKso=; b=kmZLBgIE0O7FSNXcEZHMKg2vaMnK3YWvGWk7VGkapPJZkNJbkeBzKYM7rwjKfCRvoE r1l2ug4n5yZ/9oSXFA9C8n9P6e99x0p12KiDnwaaAnBI7G8S+dvddhSS8aM/AqtCKEe8 pDSMSe2lGLExqSJSZVPAfzARYPP1rm84JQA9sfG9+lML5sKcvNd75jOeDGH5Ref8Glt/ kCksYj9elo6sMy1fSYuHh2q372gBVWZ+VGMq0or7FOYPruyFKykWryQjpbMT6O1mPYg+ FZLe//YeI0e2Eb9V+aJa+zcn8xrSijBuKgnn2B2sbUbUXrc1uppdV0bf6ZmL68i6FFz0 rNww== X-Gm-Message-State: AOAM5312pP4pt1PxcVOzAdvzVU+7Vsbld7LFi44gdcDa9i8+hSrWL72g bzz/7uWpX+WALhJS5xt16gr/2g== X-Google-Smtp-Source: ABdhPJx/FsTWX6/KicpnLUiaghbrVG8zzr/vB0kDDm5fjJAxJ7JrYdDkrEKaOiTmMiAQE/EuAALvWA== X-Received: by 2002:aca:b9c1:: with SMTP id j184mr9425764oif.5.1616416265254; Mon, 22 Mar 2021 05:31:05 -0700 (PDT) Original-Received: from DESKTOP-LINSUN ([38.99.100.2]) by smtp.gmail.com with ESMTPSA id 9sm3093691oid.17.2021.03.22.05.31.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Mar 2021 05:31:05 -0700 (PDT) Thread-Topic: RE: bug#47119: 28.0.50; [patch][Dired] new user option for compressing dir suffix In-Reply-To: <83lfaicdra.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:202830 Archived-At:

Hi Eli,

&= gt; > but wouldn't it be better to use symbols instead of strings?

>Getting a string (the name of a symbol) from a symbo= l is very easy, so

>I'm not sure I understand th= e reasoning.=C2=A0 But I won't insist.

I had try us= e the symbol like following code snippet, but there is no option-items in t= he buffer after executing `customize-variable` on this variable.

(defcustom dired-compress-files-default-suffix nil "...= "

=C2=A0 :type '(choice (const :tag ".tar= .gz" .tar.gz)

=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(const :tag ".tar.bz2" \.tag\.bz2))

=C2=A0 :group 'dired :version "28.1")

Is there any special syntax request for making it work as a custo= m selectable variable?

 

> "Refer to the ..."

I= =E2=80=99ll correct it in new patch, thanks.

 

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

>Why did you remove the "\000&quo= t; entry?=C2=A0 As the comment explains, it is

>= there to allow compressing a directory.=C2=A0 To compress a directory, you<= /p>

>need to run 'tar' on it first, and the .tar.gz/= .tar.xz entries run

>'tar' on the _result_ of gz= ip/xz instead.=C2=A0 So how will compression of

>= ;directories work after your changes?=C2=A0 I feel that I'm missing

>something here, but what?

The = =E2=80=9C\000=E2=80=9D entry is special for compress directory, if you go t= hrough back, other entries in the `dired-compress-file-suffixes` is decompr= ess commands. After apply this patch, the =E2=80=9C\000=E2=80=9D entry is u= seless.

 

&= gt;> +=C2=A0 "Default suffix for compressing directory.

>=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 ^^^^^^^^^

>"directories", in= plural.

I=E2=80=99ll correct it in new patch, than= ks.

 

>&= gt; +If nil, the \".tar.gz\" will be used.=C2=A0 See `dired-compr= ess-files-alist' for \

>> +the supported suff= ixes list."=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=C2=A0=C2=A0=C2=A0=C2=A0 ^^^^

= >=C2=A0=C2=A0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^

>&q= uot;for the list of supported suffixes"

I=E2= =80=99ll correct it in new patch, thanks.

 

>> +=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 (cl-find-if

>> +=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= (lambda (x) (string-match-p (car x) suffix))

>&= gt; +=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 dired-compress-files-alist= )))

>Do we really need cl-find-if here? what's w= rong with assoc?

Yes, `assoc` is more elegant:

<= p class=3DMsoNormal>(assoc ".tar.gz" dired-compress-files-alist #= 'string-match-p)

 

Thanks

=