From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#60460: 30.0.50; [FR] avoid putting remote files to local trash Date: Mon, 02 Jan 2023 10:09:11 +0100 Message-ID: <87358tfglk.fsf@gmx.de> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20920"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: ruijie@netyu.xyz To: 60460@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 02 10:10:13 2023 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 1pCGph-0005Ic-Dw for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Jan 2023 10:10:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCGpY-0001VY-QT; Mon, 02 Jan 2023 04:10:04 -0500 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 1pCGpX-0001Uz-1x for bug-gnu-emacs@gnu.org; Mon, 02 Jan 2023 04:10:03 -0500 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 1pCGpW-0002ly-Or for bug-gnu-emacs@gnu.org; Mon, 02 Jan 2023 04:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pCGpW-0005xa-HH for bug-gnu-emacs@gnu.org; Mon, 02 Jan 2023 04:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Jan 2023 09:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60460 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: Ruijie Yu , 60460@debbugs.gnu.org Original-Received: via spool by 60460-submit@debbugs.gnu.org id=B60460.167265056222825 (code B ref 60460); Mon, 02 Jan 2023 09:10:02 +0000 Original-Received: (at 60460) by debbugs.gnu.org; 2 Jan 2023 09:09:22 +0000 Original-Received: from localhost ([127.0.0.1]:42475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCGos-0005w5-5d for submit@debbugs.gnu.org; Mon, 02 Jan 2023 04:09:22 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:34835) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCGoo-0005vl-97 for 60460@debbugs.gnu.org; Mon, 02 Jan 2023 04:09:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1672650552; bh=2LCBLJiBJqE+NJrrfOjg6ha2SAoPKWiRGyS2SlSouQk=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=GeGI39IhDV3/yWQUTy/+yJ+9srL/9OP5hMRAofKhKSFtEZj+okSvMFMMwlmILGViC xubX5gomMDMLyP72Mo7HDZlzk91kKVYFo8PMxx4Va2yRxWtHVAgC44ZPPXyE3U9ucR 9pwi5rTuv+6xmiHR6D2SVrTdEHNsprb2UUOVEdwcCZav1YfEwhkhtyvY8+LR/cubfC 7fvB+9P/yx40UgpGUwyVZq+WXCm8ZTtSU7WRn6j4l9ZWN4oOx9/HvrpBP/suwDK/Nw 2j8A83qeval1xsB/evxuqAwHPCAKu9wVsEURolpUZ0LZ7BHdQKQWemOKhQzlYl9Ler AgY5XNISQ/CGQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.37.45]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mzhj9-1oqSbZ0BAv-00vcyJ; Mon, 02 Jan 2023 10:09:12 +0100 In-Reply-To: (Ruijie Yu via's message of "Sat, 31 Dec 2022 10:34:16 -0600") X-Provags-ID: V03:K1:yTi8BUZKFcdIhDI5LIsAXyqCWnCrfPX/UY1wxVGRTxNaj4uT+TP lJ8oz7TE5kLi+DbUrh71b4uiuG9A21lb+9h3c3IFbvLE9QHbU5rHS+cDOks4nePUm4bAF/l 03E8tWSmjq/QWNFd0jRJ2yBxIqVxF5k7AK5qEUsh+n9hfo2EebefmRCsoGZPwsJwllyYfis XSSoWq336eaHcq0GnhUnQ== UI-OutboundReport: notjunk:1;M01:P0:Dx1QALoe9M4=;fY3qA0wNmMXciDZQd+rJ7ivFc+U v0y8ZFElKFDdHNH4GozsmRlTGwbGs/59aUe9MIIXLuYDjfWYf98sBNGMk46oQj3ywkaQKHUNE VNJ2nBswQG3t4V3Y/JzwOk/njXDTSuFinLjYofZb0zUFsGbhcr+/dZEKZcZDvVMVrYGzcT6cD 54t0SpLSpQ/URBZQlMtMepDJtAQfmCnQarpP2Xj2ivNUTR1fvuvttMYXpOiWliTxnVwwPuI5+ p5k4KpS0yyYHbgfDg7xeVa1IhEdK9uH6ut47pPWWxMqzsTGM8u3zXT1f7XmjIB6sRS05pP18T AE7HiR5NuKVvhtv8X/QO+WgJwDNiEO6lD0PpAZp97Rj3/gTIS2+vP9u28jwsyptI5TZKWjN2Q S2m9tds5CR+BqbOhLpRYgbuLVRAFpHpjFfZ83Rm/+lkzQKJ8WJj+Ipf26o0dN28K5LJjOSgRd MhZyA+9rySFgPag5bM94BO0LKPGZjI5bEesLagBCQxBy9uwkJO+Sa12tqzm1AcVad9GsQ/CFS 75gNwMCuCJs47T1TyrKoGOBgWn6ye3FLn6R5JAMsEFVzSLNt2X2arPex5coIBkQSdYutq3u2p c27msu80qRxH9RDzzsNxWrbSCmphCjsEYyqFlwwN397ldTR2d1CMke9k1QdK9uHpN9a8BFDkJ zLdWdAhglt7elLAIaplwgNVeYzWtlDPMxoq09TRP9sPTfflw2cBAxUjMjWKsCzBLxcTWBdftz EVfIys3fuWybhsv62aSBo8QWAHTy2RqeJ70X/ZAUe6KNdgW12mskwa4yIPqDDptV17z9ntMU 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:252314 Archived-At: Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Hello, Hi, > I have been organizing my files lately over multiple devices using > tramp. One issue I find with my current setup is that since I set > `delete-by-moving-to-trash' to t, all files, even the remote ones, are > moved to my trash directory. > > This, unfortunately, harms my workflow because the files I wanted to > delete include some random multi-gig files, as well as many .git > directories, both of which greatly bottleneck my file-deletion process. > I also don't want to disable trashing globally, because I think putting > local files to trash (which do not introduce a significant delay) is > still a good idea. > > In response to this, I want to propose a change to the logic under which > trashing is performed rather than deletion. However, I am not sure > which one of my following two ideas is more appropriate. > > 1. Allow the user to disable "moving to local trash" only for remote > files. I imagine this would entail allowing the user to set > `delete-by-moving-to-trash' to 'local, and modifying `delete-file', > `delete-directory', `dired-internal-do-deletions' among other functions > accordingly. Alternatively we can have a dedicated variable for this > purpose. > > In this case, if `delete-by-moving-to-trash' is set to 'local, whenever > a user deletes a remote file such as "/sudo::/etc/os-release", it is > simply deleted as if via "/sudo:://bin/rm", whereas when the user > deletes a local file ".bashrc", it is moved to trash as normal. We could use connection-local variables for achieving this effect. Just set `delete-by-moving-to-trash' to nil by this mechanism. Alternatively, we could add a new user option `remote-file-name-inhibit-delete-by-moving-to-trash' (*), which would force deletion when set to t. We have similar user options already for other purposes, like `remote-file-name-inhibit-cache', `remote-file-name-inhibit-locks' and `remote-file-name-inhibit-auto-save-visited'. (*): I'm open for another, shorter name. > Best, > > RY Best regards, Michael.