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 13:06:14 -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="11193"; 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 18:07:23 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 1ooRtD-0002kb-V9 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Oct 2022 18:07:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooRsz-0005p8-T5; Fri, 28 Oct 2022 12:07:10 -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 1ooRss-0005dl-Sa for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 12:07: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 1ooRss-0004BQ-Lo for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 12:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ooRss-0005Y1-GV for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 12:07: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 16:07: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.166697319421288 (code B ref 58721); Fri, 28 Oct 2022 16:07:02 +0000 Original-Received: (at 58721) by debbugs.gnu.org; 28 Oct 2022 16:06:34 +0000 Original-Received: from localhost ([127.0.0.1]:34138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooRsQ-0005XH-CU for submit@debbugs.gnu.org; Fri, 28 Oct 2022 12:06:34 -0400 Original-Received: from mail-pl1-f174.google.com ([209.85.214.174]:39684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooRsO-0005X3-QH for 58721@debbugs.gnu.org; Fri, 28 Oct 2022 12:06:33 -0400 Original-Received: by mail-pl1-f174.google.com with SMTP id f23so5222350plr.6 for <58721@debbugs.gnu.org>; Fri, 28 Oct 2022 09:06:32 -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=ntn4u6EpasMGGE7SebVMvK5yiiFnKv2KMSPvG6Y4Ifc=; b=BN0ZSiEoiOgdN67QfBkS1CxnjKVq6yr+A8zYEiWZmXvKvoJtl4X0/4SPyzrSHxhXkD cH0hB0vUr9LYIndGw80fSFz0Z1gEV0eyGUxs6G0UOg1gqPpHa7jOu6LvLQoKkInpHl9m b2V2w28EUnJ7/5rT4+0Qdr1iobWD3zZpdcpmUJouwI7+Q4TIb4omRk6cwHpI6NYY7fgz IQlKqkpqJXGLHELHBQAzkNjTSRcB9lMr+4sPtXjGz5Rev20ffj5fOLaht9HGaj3B4DTK nOOOiCK+00fUPqm04C4MM55uXH8CPE6rbtOxzYtDIRFT08eMNqepwFn/BSri/GEMTdg1 YUnQ== 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=ntn4u6EpasMGGE7SebVMvK5yiiFnKv2KMSPvG6Y4Ifc=; b=R5LvyiEcCYQgdXvlgiFaJcGVwbtP/K7S3OVcwaHhHFS5vAZxtEHvfJ4LLsSCZ6ChS6 Rx2Ca70HjF0hiX8RLT5VHtX7KSd5apd9W9Z7rCZv+h1vv9Wh/dXpOfG22sNeEDT++W8d 3KbiUJ9O0Wf299k7GI3O3o7ymBP8/xFYEDJ+2rPdpAN0n/6DyTQt7Wx70y2XI8kBBntE VzdBN5TyDZWfXBXpA7bJDVGuDFB+AfEGPBWqcOrb6gWdgddLr0aBYRzK7KwmD1/1t6xn sqVBpIK3BlLibbwv8Y+fb/HAw2WM9fRObjjkhGyN+ej26xEQE1KajIfYZDcREAoNOR/E MKUA== X-Gm-Message-State: ACrzQf3IJrtkErtcsEqL/oZCqUD5Ad9NDj+ypimgdax5W84jH03U0RvJ i50utbkI+mgA1xHLEFOX5xRZXY8dvqJ/MOcd5W0= X-Google-Smtp-Source: AMsMyM7unfGbbRoFbJK4YMKfAjNfUuzECFRft/FNt/RugcZoL6YHjFckeoylnpt32jkqiOe6ZXrc9dGWRNSOh6ybJJY= X-Received: by 2002:a17:903:283:b0:186:897e:71ea with SMTP id j3-20020a170903028300b00186897e71eamr24767plr.123.1666973186931; Fri, 28 Oct 2022 09:06:26 -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:246435 Archived-At: Hi Stefan, On Fri, 28 Oct 2022 at 12:26, Stefan Kangas 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. Thanks for trying! I'm glad I'm not mad. :-) I had missed this bit of the docstring, and you're right, of course. So, it seems we are back to `move-file-to-trash', and how it calls `rename-file'. I've redefined `move-file-to-trash' to message `new-fn` right before `rename-file' is being called. And tested both: (move-file-to-trash "/path/to/orig/barbaz") (move-file-to-trash "/path/to/orig/barbaz/") And both cases output things like: Back to top level /home//.local/share/Trash/files/barbazOfwLav Entering debugger... Back to top level /home//.local/share/Trash/files/barbazVICScf Entering debugger... Back to top level /home//.local/share/Trash/files/barbazVd4241 Entering debugger... Back to top level /home//.local/share/Trash/files/barbaz04EjUm Entering debugger... Back to top level 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.