From: Michael Albinus <michael.albinus@gmx.de>
To: 60460@debbugs.gnu.org
Cc: ruijie@netyu.xyz
Subject: bug#60460: 30.0.50; [FR] avoid putting remote files to local trash
Date: Mon, 02 Jan 2023 10:09:11 +0100 [thread overview]
Message-ID: <87358tfglk.fsf@gmx.de> (raw)
In-Reply-To: <sdv4jtb8rcn.fsf@fw.net.yu> (Ruijie Yu via's message of "Sat, 31 Dec 2022 10:34:16 -0600")
Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@gnu.org> 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.
next prev parent reply other threads:[~2023-01-02 9:09 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-31 16:34 bug#60460: 30.0.50; [FR] avoid putting remote files to local trash Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-01 16:41 ` Drew Adams
2023-01-01 16:47 ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-01 18:20 ` Drew Adams
2023-01-02 3:40 ` Jean Louis
2023-01-02 9:09 ` Michael Albinus [this message]
2023-01-02 10:35 ` Jean Louis
2023-01-02 10:47 ` Michael Albinus
2023-01-02 16:28 ` Jean Louis
2023-01-02 18:30 ` Michael Albinus
2023-01-02 20:37 ` Jean Louis
2023-01-03 8:47 ` Michael Albinus
2023-01-03 13:53 ` Jean Louis
2023-01-07 3:53 ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-07 12:48 ` Michael Albinus
2023-01-08 0:37 ` Jean Louis
2023-01-08 9:20 ` Michael Albinus
2023-01-08 18:29 ` Michael Albinus
2023-02-02 8:56 ` Michael Albinus
-- strict thread matches above, loose matches on Subject: below --
2023-01-01 14:20 bug#60462: " Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-31 21:46 ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
[not found] ` <handler.60462.D60462.16726054692608.notifdone@debbugs.gnu.org>
2023-01-02 9:16 ` bug#60460: " Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87358tfglk.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=60460@debbugs.gnu.org \
--cc=ruijie@netyu.xyz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.