From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rudi C Newsgroups: gmane.emacs.devel Subject: Re: PR: dired-do-create-files now checks for trailing slashes in the target Date: Wed, 29 Sep 2021 16:50:50 +0330 Message-ID: References: <831r58k0cx.fsf@gnu.org> <87tui4qyni.fsf@gnu.org> <83tui4iift.fsf@gnu.org> <874ka43rp1.fsf@gnu.org> <83ee97il43.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000a2c5e505cd22335e" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1188"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, stefankangas@gmail.com, Tassilo Horn To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 29 15:41:42 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mVZq8-000Aaq-1s for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Sep 2021 15:41:40 +0200 Original-Received: from localhost ([::1]:57672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVZq6-0004o2-Kl for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Sep 2021 09:41:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVZWE-0005BM-OK for emacs-devel@gnu.org; Wed, 29 Sep 2021 09:21:06 -0400 Original-Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]:37754) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVZWC-0007A6-Rb; Wed, 29 Sep 2021 09:21:06 -0400 Original-Received: by mail-il1-x12e.google.com with SMTP id i13so2788125ilm.4; Wed, 29 Sep 2021 06:21:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lgRQsP3h+rqpL3Be5EO9YKKOKOkesJzKmop2BeI9H3o=; b=D7aRoZ8vZPkbu60W76C+OZJ6k07g/THXfPKpkvd96qFult2tX4pwIAn3WvwkwABexC o62Hsc60Fgr8Tod4y9i0SJrBPC9ORo/H7yW7zFCCO1Zqa3p9oMzqWlrDjrI/NWyOU2ga RKxgxQTyEGcvDj2AyQDL7EgoDwtERx2ix+P4MLy80W1j1Y/QAHvTwkvr4KJe655iGpX1 /3Z4ARrDPqWUV4HITR8ZV7dbuJX8gaULGMX+tJ16/tUVofPQmSnQbslhcdb8d0si/mOV 19L2jTxpv0W+Ox8Na0SihZtqirU7RkW41Y/ZOK4sQRgztYKmwp64cnV4e1R/gihigdyx 9rOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lgRQsP3h+rqpL3Be5EO9YKKOKOkesJzKmop2BeI9H3o=; b=CkFUSR7TtbqlEiVO3oca/vrFA36QOBKmYkjbWjI0wcnAQMVDF9sv04sbhPKmbcVlCI gr+RM3nKsWIGMb8MXE0bbAS12waI+NIuBTR03fz5tHgYbnh4TUU44wPZiYLTWxfnThaS P4vnWp/f05ElEi+4wevMTquy4URuDiFfsshTrcgopkXaKd8/w3umluKJzenuyfyz6HOP WTlfX745qXRag0SjE77l71P876zfsPG36Bz5VgkSpj1Gk0rW1LYOwAhoxqzhnvysQw4U 5eag4cEVy9DnEH2knJpzPYxIhtuaAoaYTlpvD7jg19sgPcwIOdI2RGuU8wcV20P2g0xX PTGw== X-Gm-Message-State: AOAM531nZB+A6tHsEulqizlAMdo7UarL+NzoKibkvEqXxBxpeENCjDny P8EsbqOYpO+qtQhD3QZV1uu983QDSUrw4QMOhIhG/sN6VDJ2pA== X-Google-Smtp-Source: ABdhPJzvJOM6Aduy8VIfUJCN8wpCRWapGdBYb3IHe/m8iM+XF8dDep6B2Szt3bQu8u+/lB8FLdguY8CJTeT5jEwAgVA= X-Received: by 2002:a92:cd8d:: with SMTP id r13mr8379345ilb.244.1632921662439; Wed, 29 Sep 2021 06:21:02 -0700 (PDT) In-Reply-To: <83ee97il43.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::12e; envelope-from=rudiwillalwaysloveyou@gmail.com; helo=mail-il1-x12e.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:275792 Archived-At: --000000000000a2c5e505cd22335e Content-Type: text/plain; charset="UTF-8" > how do I rename old_name into new_name so that it overwrites new_name Overwriting a directory is a highly destructive activity. It would be better to make the user explicitly delete the old directory, and then do the rename IMO. But we can add a new custom variable. I am all for giving everyone options. I don't think it can integrate with `dired-create-destination-dirs' though; `dired-create-destination-dirs-trailing-slash-special'? On Wed, Sep 29, 2021 at 4:39 PM Eli Zaretskii wrote: > > From: Tassilo Horn > > Cc: rudiwillalwaysloveyou@gmail.com, stefankangas@gmail.com, > > emacs-devel@gnu.org > > Date: Wed, 29 Sep 2021 06:46:04 +0200 > > > > > So the behavior will now differ depending on whether new_name already > > > exists or not? > > > > Right. And also `dired-create-destination-dirs' has to be non-nil for > > the new behavior which conforms to its documentation. I have that set > > to 'ask, and when I apply Rudi's patch and do the recipe, it'll ask if a > > new directory new_name/ should be created. > > > > > because if the user types > > > > > > R /new_ TAB > > > > > > Emacs will complete it to "/new_name/", including the trailing slash. > > > > But only if it exists, and then the patch makes no difference in > > behavior. > > Isn't that exactly the problem? If both old_name and new_name exist, > how do I rename old_name into new_name so that it overwrites new_name > instead of becoming its subdirectory? I must carefully type new_name > RET so as to avoid having a slash at its end. > > I would support such a change only if it had an explicit defcustom to > control it. (It could be a new value of > dired-create-destination-dirs, if that makes sense.) > --000000000000a2c5e505cd22335e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> how do I rename old_name into new_name so that it ove= rwrites new_name

Overwriting a directory is a highly des= tructive activity. It would be better to make the user explicitly delete th= e old directory, and then do the rename IMO.

But w= e can add a new custom variable. I am all for giving everyone options. I do= n't think it can integrate with `dired-create-destination-dirs' tho= ugh; `dired-create-destination-dirs-trailing-slash-special'?

On We= d, Sep 29, 2021 at 4:39 PM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Tassilo Horn <tsdh@gnu.org>
> Cc: rudiwillalwaysloveyou@gmail.com, stefankangas@gmail.com,
>=C2=A0 emacs-d= evel@gnu.org
> Date: Wed, 29 Sep 2021 06:46:04 +0200
>
> > So the behavior will now differ depending on whether new_name alr= eady
> > exists or not?
>
> Right.=C2=A0 And also `dired-create-destination-dirs' has to be no= n-nil for
> the new behavior which conforms to its documentation.=C2=A0 I have tha= t set
> to 'ask, and when I apply Rudi's patch and do the recipe, it&#= 39;ll ask if a
> new directory new_name/ should be created.
>
> > because if the user types
> >
> >=C2=A0 =C2=A0R /new_ TAB
> >
> > Emacs will complete it to "/new_name/", including the t= railing slash.
>
> But only if it exists, and then the patch makes no difference in
> behavior.

Isn't that exactly the problem?=C2=A0 If both old_name and new_name exi= st,
how do I rename old_name into new_name so that it overwrites new_name
instead of becoming its subdirectory?=C2=A0 I must carefully type new_name<= br> RET so as to avoid having a slash at its end.

I would support such a change only if it had an explicit defcustom to
control it.=C2=A0 (It could be a new value of
dired-create-destination-dirs, if that makes sense.)
--000000000000a2c5e505cd22335e--