From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mike Kupfer Newsgroups: gmane.emacs.bugs Subject: bug#58721: 28.2; dired with delete-by-moving-to-trash can't trash directory twice Date: Sun, 30 Oct 2022 17:01:41 -0700 Message-ID: <58149.1667174501@alto> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6476"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 58721@debbugs.gnu.org To: Gustavo Barros Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 31 01:02:18 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 1opIFu-0001Ze-6J for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Oct 2022 01:02:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opIFh-0002ZB-9g; Sun, 30 Oct 2022 20:02:05 -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 1opIFe-0002Yy-ST for bug-gnu-emacs@gnu.org; Sun, 30 Oct 2022 20:02:03 -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 1opIFe-0007gR-6M for bug-gnu-emacs@gnu.org; Sun, 30 Oct 2022 20:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1opIFe-000474-0X for bug-gnu-emacs@gnu.org; Sun, 30 Oct 2022 20:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mike Kupfer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 Oct 2022 00:02:01 +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.166717451215794 (code B ref 58721); Mon, 31 Oct 2022 00:02:01 +0000 Original-Received: (at 58721) by debbugs.gnu.org; 31 Oct 2022 00:01:52 +0000 Original-Received: from localhost ([127.0.0.1]:39231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opIFT-00046g-Pm for submit@debbugs.gnu.org; Sun, 30 Oct 2022 20:01:52 -0400 Original-Received: from shell1.rawbw.com ([198.144.192.42]:49988 ident=root) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opIFQ-00046W-To for 58721@debbugs.gnu.org; Sun, 30 Oct 2022 20:01:49 -0400 Original-Received: from alto (135-180-174-133.dsl.dynamic.sonic.net [135.180.174.133] (may be forged)) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id 29V01f3h058462 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 30 Oct 2022 17:01:46 -0700 (PDT) (envelope-from mkupfer@alum.berkeley.edu) X-Authentication-Warning: shell1.rawbw.com: Host 135-180-174-133.dsl.dynamic.sonic.net [135.180.174.133] (may be forged) claimed to be alto In-Reply-To: Your message of "Sun, 30 Oct 2022 20:10:04 -0300." X-Mailer: MH-E 8.6+git; nmh 1.7.1; Emacs 29.0.50 Content-ID: <58148.1667174501.1@alto> 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:246658 Archived-At: Gustavo Barros wrote: > I may be wrong but, as far as my reading goes, I think this might > misbehave if the "directory" is a symlink. `is-directory' is built as > `(file-directory-p fn)' which returns t even if it is a symlink to a > directory. Good point, thanks. I think this points out a pre-existing issue with move-file-to-trash, in that the code to create a unique trash name will create a directory, rather than a file. > Besides that, in general, imho I cannot think of this issue as > something else other than a misbehavior of `rename-file', so that the > patch in these terms feels like a workaround. I agree that it's an inconsistency in the behavior of rename-file. If the thing being renamed is a file, the target gets replaced, whether or not we're crossing filesystems. But if it's a directory, the target gets replaced if it's in the same filesystem, but it's an error if the target is in a different filesystem. If I understand Eli's concern, it's a question of whether making the behavior more consistent is worth the risk that it would break existing code--code that could assume the current behavior. I'd like to resolve the symlink behavior before pushing any fix. But I've been feeling increasingly unwell as the day has progressed, so I think I'll stop work on this bug until I'm feeling better. mike