From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gustavo Barros Newsgroups: gmane.emacs.bugs Subject: bug#58721: 28.2; dired with delete-by-moving-to-trash can't trash directory twice Date: Fri, 28 Oct 2022 16:07:23 -0300 Message-ID: References: <83r0ytl042.fsf@gnu.org> <83bkpxkwcd.fsf@gnu.org> <838rl1ku1b.fsf@gnu.org> <837d0lks02.fsf@gnu.org> <83lep0jspb.fsf@gnu.org> <83edusjhpe.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17738"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 58721@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 28 21:08:29 2022 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 1ooUiT-0004V2-Ej for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Oct 2022 21:08:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooUi8-0004ox-Bo; Fri, 28 Oct 2022 15:08:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooUi2-0004oh-MP for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 15:08:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ooUi2-000104-EN for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 15:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ooUi2-0001eK-94 for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 15:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gustavo Barros Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Oct 2022 19:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58721 X-GNU-PR-Package: emacs Original-Received: via spool by 58721-submit@debbugs.gnu.org id=B58721.16669840636315 (code B ref 58721); Fri, 28 Oct 2022 19:08:02 +0000 Original-Received: (at 58721) by debbugs.gnu.org; 28 Oct 2022 19:07:43 +0000 Original-Received: from localhost ([127.0.0.1]:34290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooUhj-0001dn-4U for submit@debbugs.gnu.org; Fri, 28 Oct 2022 15:07:43 -0400 Original-Received: from mail-pf1-f179.google.com ([209.85.210.179]:34692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooUhh-0001dT-9u for 58721@debbugs.gnu.org; Fri, 28 Oct 2022 15:07:41 -0400 Original-Received: by mail-pf1-f179.google.com with SMTP id f140so5567834pfa.1 for <58721@debbugs.gnu.org>; Fri, 28 Oct 2022 12:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PRWeiuHWb/HMfBHgDGPv0WeDqg/kCRUgVbnpMQyx5+M=; b=Bb8csV2KkqdwT5kn4+vn7MsJVB9XviKYiFSdwLMSW2e4F6YcsEBZTW08gcQTFQMZ+u OKRFLveSjAqMfMOVcJ7NxD3ZX73NtajFrCNeZrKxV5+hL0xWHdBU109X+vvzzChEL1iU My+ICcSj2KfIsyOspnxD4lziGo2q7v2S8z1R/CR9ci2v6Z3QrJBgeSr3yZ9GShPuI9B0 c6tQFu7NVOmLQTDnbROnkhi0P4r/AIck0t+Gw8ZTCe6zQkUuhnEJy0bn0YDSbgY2UMSi 1NJf6btYsxME8ujOn+3eqm7196Xu3jE2+lB+QlCbT2iasFEnBX8mn2H77dJHWoYs9SpX TBSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PRWeiuHWb/HMfBHgDGPv0WeDqg/kCRUgVbnpMQyx5+M=; b=UdfVFwyVMUUFwNTTYIUhmmW6mH3HleurCmwfp4Bs/qDiuqrT38JfK8qR6Gf3zNxPHA Il8sGipoDjx7ijwoRJIfD/7TDVBtFvUqTnzJtQZdtr0u/zM/xrS4exEU8mJtpAgXMvMJ 6HKrASmNLVjib+ROamomNPqTUuIBt/FsmXBbmJj9qZ/+L6GpVQYe8ukqBfkmV3XtxGJe +h/QBEdFjEEzL0Y9iv7UlT7IDWA1i/ub/km3aqixx9LmpZ6cPcPcSKc/DeKhwTVR/77y mId4o8DhKMd5tEjYz7Jr6UbH7blCqXnEV5bK0ln421bm4Wj1koqj3L4xTq5f1Ba6mUAa Xf2Q== X-Gm-Message-State: ACrzQf1zAYk5Erbv3lCqChO2h23JJPH7r4Icb1IkU34f3PAxs82Dc2ax I/P7nw1WrP84orJ6SIQIDvsN4WUDHx2CpuCqRIY= X-Google-Smtp-Source: AMsMyM76gUTeZ1ZvSTNPwYNMMOXVBjP4CRG00H/WO6o6nUjJweMEtSldr2Vb8wVuS9A+rPCvS25dYg3k01zn+/aYHec= X-Received: by 2002:a63:84c2:0:b0:46e:f239:354c with SMTP id k185-20020a6384c2000000b0046ef239354cmr817945pgd.147.1666984055294; Fri, 28 Oct 2022 12:07:35 -0700 (PDT) In-Reply-To: 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246448 Archived-At: On Fri, 28 Oct 2022 at 13:06, Gustavo Barros wrote: > > I get the same result. But I think this is expected, as the > > `rename-file' docstring says: > > > > For NEWNAME to be recognized as a directory name, it should > > end in a slash. > > > > So this function seems to be working as documented. > That is, no end slash appended to the directory at > `move-file-to-trash'. So, it appears we have a good suspect. Why it > works when the filesystem is the same still beats me. Uhm, it is still not this. The previous sentence in the docstring you (Stefan) mentioned is: If NEWNAME is a directory name, rename FILE to a like-named file under NEWNAME. For NEWNAME to be recognized as a directory name, it should end in a slash. And, indeed, if we do: (rename-file "/path/to/orig/barbaz" "/path/to/dest/barbaz-foobar/" t) the operation succeeds, but the result is: /path/to/dest/barbaz-foobar/barbaz/zero.file And that's not what we want, or not what `move-file-to-trash' is trying to do. And that is precisely why it is passing the `ok-if-already-exists' as `t' there in the first place. In other words, as far as I can see, the sentence: For NEWNAME to be recognized as a directory name, it should end in a slash. should not imply that if `ok-if-already-exists' is `t' `rename-file' should fail to overwrite, whether the `newname' is a directory or not.