bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#60460: 30.0.50; [FR] avoid putting remote files to local trash


From: Michael Albinus
Subject: bug#60460: 30.0.50; [FR] avoid putting remote files to local trash
Date: Mon, 02 Jan 2023 10:09:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]