From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ruslan Bekenev Newsgroups: gmane.emacs.bugs Subject: bug#69117: 30.0.50; Cannot trash directory, if such exists in trash can Date: Wed, 10 Apr 2024 16:55:52 +1000 Message-ID: References: <875xyyawwu.fsf@lco.mail-host-address-is-not-set> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_2FCBB064-4F44-4C2A-82D2-8710BE7E9F0A" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40686"; mail-complaints-to="usenet@ciao.gmane.io" To: bug#69117 <69117@debbugs.gnu.org> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 10 08:57:09 2024 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 1ruRtM-000ATF-RQ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Apr 2024 08:57:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruRtB-00088e-Uj; Wed, 10 Apr 2024 02:56:57 -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 1ruRt9-00088S-Lc for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2024 02:56:55 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ruRt9-00081B-Cv for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2024 02:56:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ruRtH-0004AB-Qa for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2024 02:57:03 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <875xyyawwu.fsf@lco.mail-host-address-is-not-set> Resent-From: Ruslan Bekenev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Apr 2024 06:57:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69117 X-GNU-PR-Package: emacs Original-Received: via spool by 69117-submit@debbugs.gnu.org id=B69117.171273218315601 (code B ref 69117); Wed, 10 Apr 2024 06:57:03 +0000 Original-Received: (at 69117) by debbugs.gnu.org; 10 Apr 2024 06:56:23 +0000 Original-Received: from localhost ([127.0.0.1]:51945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruRsc-00043Z-Ri for submit@debbugs.gnu.org; Wed, 10 Apr 2024 02:56:23 -0400 Original-Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:45253) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruRsb-00042b-BB for 69117@debbugs.gnu.org; Wed, 10 Apr 2024 02:56:22 -0400 Original-Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1e24c889618so51967255ad.2 for <69117@debbugs.gnu.org>; Tue, 09 Apr 2024 23:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712732165; x=1713336965; darn=debbugs.gnu.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=I0vQ5EYvPwsRDh8DqbTprQ78JnQqcn7f9wcKJ2rU8+A=; b=b0JLYYU6bUSO8uH34HS6Ydsq279AyZT9jW7GBKvv+1K2Y+4mvLsImcwB92dWyZzQGe LJqlD8ZeYgoHW/OVwRKKcUUycgib1lKY/plfLvwE2ErEb9exTGXxZvQkON5Xmv4YnnM+ V36st2G4nw3qQWW8aDtSdXcHkW6qVz7duuMPo3e6A9pKPCFHNefNldP6b3sk93R71ICT FmwB61zk0VzsZRhu0bYp1f8AbItRfiZx59GGKGw9g2cSGW/Kwn1lblFkFBI5T123sd3w p7lQlmg5ep7xEVYFwDo1jPHHizWOeP0K6QTuEG5poycyMJJe3HZlACJVwuMHpsELLdRl Z1Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712732165; x=1713336965; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=I0vQ5EYvPwsRDh8DqbTprQ78JnQqcn7f9wcKJ2rU8+A=; b=ekvycHDH8mBfOXrCmtK21m5AKoVux7YJg26p1Iun05sg3w8ui9udY5x0fTKoYVHaO9 vtFSooXdYou4+6GeYS8/6RJTh7ioYeAkyQaFaJGbyN6GaoJcOpVh4Jq+SCN3oS51UHSl 50MRoLZAQOedN97G22g8Y9tNyAfgdqrkLq9X/Ibz8xdil0qYi71D16c9VNeKaQ83o2Dp OHBYW4GfeLHVUl++AF+O9h0Cf6fBsTXm34va4hGR8BGyhhfLDWtJqJ1uuXxFzU8vDgVx m+l312vhErMq80y6Sv8+wO13BDNmpnbIFYKRpjXm7Y07IzofaLhf/855rYRAihs8CGWz F7tA== X-Gm-Message-State: AOJu0YzoL6ck2GdJiAv3YNM/4lxJSeNff6GOY70oRjx7O9WuZFTnMTOH WXmzDrf+DONIRsrQ8NHWGTVlgV/53UOScfgBBPVho6+CCFYnuWn5NtbC2Me6 X-Google-Smtp-Source: AGHT+IEuna2JRbHzeI9m6x6PyjhgKGLbkgVrxyqHNNcMQ3EOC2x2DG03PGnrV56yucCanY188h6TEA== X-Received: by 2002:a17:902:d2d1:b0:1e4:436e:801b with SMTP id n17-20020a170902d2d100b001e4436e801bmr1640456plc.67.1712732165083; Tue, 09 Apr 2024 23:56:05 -0700 (PDT) Original-Received: from smtpclient.apple (180-150-37-223.b49625.bne.nbn.aussiebb.net. [180.150.37.223]) by smtp.gmail.com with ESMTPSA id kq12-20020a170903284c00b001e29acb2d18sm10088038plb.4.2024.04.09.23.56.03 for <69117@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Apr 2024 23:56:04 -0700 (PDT) X-Mailer: Apple Mail (2.3774.500.171.1.1) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283028 Archived-At: --Apple-Mail=_2FCBB064-4F44-4C2A-82D2-8710BE7E9F0A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > I cannot trash this directory I tried to reproduce it and it seems working fine on my end. The = file/dir is renamed and then stored in the trash can. In your case it = should just rename the kaidan directory to kaidan~1~ Could you please share your ~system-move-file-to-trash~ variable value?=20= I came up with the test for this use-case. It seems passing. I hope someone can review the test case and see if = there is better way to replicate the issue.=20 P.S. I initially sent this email to the wrong location. My apologies if it = brought a little mess. Ruslan --Apple-Mail=_2FCBB064-4F44-4C2A-82D2-8710BE7E9F0A Content-Disposition: attachment; filename=0001-Test-dired-delete-functionality.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Test-dired-delete-functionality.patch" Content-Transfer-Encoding: quoted-printable =46rom=20b202131097e2774a8e96f0d0e72c07c693977008=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Ruslan=20Bekenev=20=0A= Date:=20Wed,=2010=20Apr=202024=2012:58:07=20+1000=0ASubject:=20[PATCH]=20= Test=20dired=20delete=20functionality=0A=0AAdd=20test=20for=20= https://debbugs.gnu.org/69117=0AThe=20issue=20described=20in=20the=20bug=20= is=20that=20a=20file=20cannot=20be=20trashed=0Aif=20a=20file=20with=20= the=20same=20name=20already=20exists=20in=20the=20trash=20bin.=0AThe=20= test=20checks=20this=20functionality=20and=20ensures=20that=20the=20= dired=20delete=0Afunctionality=20works=20even=20in=20case=20trash=20bin=20= already=20has=20the=20file=20with=0Athe=20same=20name.=0A---=0A=20= test/lisp/dired-tests.el=20|=2046=20= ++++++++++++++++++++++++++++++++++++++++=0A=201=20file=20changed,=2046=20= insertions(+)=0A=0Adiff=20--git=20a/test/lisp/dired-tests.el=20= b/test/lisp/dired-tests.el=0Aindex=20651b77500a1..d6773ac8a56=20100644=0A= ---=20a/test/lisp/dired-tests.el=0A+++=20b/test/lisp/dired-tests.el=0A@@=20= -609,5=20+609,51=20@@=20dired-test-directory-files-and-attributes=0A=20=20= =20=20=20=20=20(let=20((default-directory=20test-dir-other))=0A=20=20=20=20= =20=20=20=20=20(files-tests--insert-directory-shows-given-free=20= test-dir)))))=0A=20=0A+(ert-deftest=20dired-test-bug69117=20()=0A+=20=20= "Test=20for=20https://debbugs.gnu.org/69117."=0A+=20=20(let*=20= ((delete-by-moving-to-trash=20t)=0A+=20=20=20=20=20=20=20=20=20= (dired-recursive-deletes=20'always)=0A+=20=20=20=20=20=20=20=20=20= (dired-deletion-confirmer=20(lambda=20(_)=20t))=0A+=20=20=20=20=20=20=20=20= =20(testdir=20(expand-file-name=20"bug69117"=20default-directory))=0A+=20= =20=20=20=20=20=20=20=20(trash-directory=20(expand-file-name=20= "trashdir"=20default-directory))=0A+=20=20=20=20=20=20=20=20=20= (dir-to-delete=20"dir-to-delete"))=0A+=20=20=20=20(fmakunbound=20= 'system-move-file-to-trash)=20;;=20make=20sure=20file=20aren't=20moved=20= to=20system=20trash=0A+=20=20=20=20(unwind-protect=0A+=20=20=20=20=20=20=20= =20(progn=0A+=20=20=20=20=20=20=20=20=20=20(mapc=20(lambda=20(d)=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(when=20= (file-directory-p=20d)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(delete-directory=20d=20t)))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(list=20trash-directory=20testdir))=0A+=20=20= =20=20=20=20=20=20=20=20(make-directory=20trash-directory)=0A+=20=20=20=20= =20=20=20=20=20=20(make-directory=20testdir)=0A+=20=20=20=20=20=20=20=20=20= =20(when=20(file-directory-p=20trash-directory)=0A+=20=20=20=20=20=20=20=20= =20=20=20=20(progn=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20(when=20= (file-directory-p=20dir-to-delete)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(delete-directory=20dir-to-delete))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20;;=20create=20dir-to-delete=20and=20delete=20it=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(make-directory=20(expand-file-name=20= dir-to-delete=20testdir))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (dired=20testdir)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (dired-toggle-marks)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (should=20(=3D=202=20(length=20(directory-files=20trash-directory))))=20= ;;=20.=20and=20..=20folders=20are=20there=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(should=20(=3D=201=20(length=20(dired-get-marked-files))))=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20(dired-do-delete=20nil)=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(dired-toggle-marks)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(should=20(=3D=200=20(length=20= (dired-get-marked-files))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (should=20(=3D=203=20(length=20(directory-files=20trash-directory))))=0A= +=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20create=20= dir-to-delete=20and=20delete=20it=20again=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(make-directory=20(expand-file-name=20dir-to-delete=20= testdir))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20(revert-buffer)=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20(dired-toggle-marks)=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(should=20(=3D=201=20(length=20= (dired-get-marked-files))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (dired-do-delete=20nil)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (dired-toggle-marks)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (should=20(=3D=200=20(length=20(dired-get-marked-files))))=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(should=20(=3D=204=20(length=20= (directory-files=20trash-directory)))))))=0A+=20=20=20=20=20=20(mapc=20= (lambda=20(d)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20(when=20= (file-directory-p=20d)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (delete-directory=20d=20t)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20= (list=20trash-directory=20testdir)))))=0A+=0A=20(provide=20'dired-tests)=0A= =20;;;=20dired-tests.el=20ends=20here=0A--=20=0A2.44.0=0A=0A= --Apple-Mail=_2FCBB064-4F44-4C2A-82D2-8710BE7E9F0A--