From: Michael Albinus <michael.albinus@gmx.de>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 44217@debbugs.gnu.org, Jean Louis <bugs@gnu.support>
Subject: bug#44217: bug#44216: 28.0.50; Incorret during delete in Tramp: Trashing...done
Date: Mon, 26 Oct 2020 14:11:27 +0100 [thread overview]
Message-ID: <87imaxuo74.fsf@gmx.de> (raw)
In-Reply-To: <87eell2q96.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 26 Oct 2020 12:14:29 +0100")
Lars Ingebrigtsen <larsi@gnus.org> writes:
Hi Lars,
>> I have the variable trash-directory set and files go to ~/tmp/Trash
>>
>> During Tramp ssh://example.com:~/ session I have delete a file and I can
>> see the message: Trashing...done which should not be during Tramp
>> session, as it gave me impression that file will be now transferred in
>> background to my local Trash directory which not the case. Not that I
>> have seen the file in Trash.
The message "Trashing...done" comes from dired, just because of the
rguments it calls delete-file with. This has nothing to do with what
Tramp does.
> Please try to give more detailed bug reports with recipes starting from
> "emacs -Q".
>
> I reproduced this bug by setting:
>
> (setq delete-by-moving-to-trash t
> trash-directory "~/Trash/")
>
> and then going to "/ssh:other-host:/tmp/" and deleting a file. As you
> say, the file isn't moved to ~/Trash.
How did you delete the file? You must give the optional argument TRASH a
non-nil value, as in
(delete-file "/ssh:other-host:/tmp/file" t)
> This is because:
>
> (defun tramp-get-remote-trash (vec)
> "Determine remote `trash' command.
> This command is returned only if `delete-by-moving-to-trash' is non-nil."
> (and delete-by-moving-to-trash
> (with-tramp-connection-property vec "trash"
> (tramp-message vec 5 "Finding a suitable `trash' command")
> (tramp-find-executable vec "trash" (tramp-get-remote-path vec)))))
>
> Tramp is looking for an executable on the remote host called "trash"?
> Which doesn't exist.
Yep. Btw, the "trash" command is part of the trash-cli package, which
exists for example for Ubuntu and Fedora.
> Shouldn't Tramp then move the file to `trash-directory' instead of
> giving up and just deleting the file?
Why that? `trash-directory' is defined as target for
`move_file_to_trash'; it has nothing to do with deleting of remote
files. And it would be a security flaw, if remote files would be moved
to the local "~/Trash" directory.
> If this is working as designed, it should at least be mentioned in the
> doc string(s) and the manual.
I believe it is mentioned. See the docstrings of `trash-directory' and
`move-file-to-trash'. Well, the latter might explicitly state that it is
not intended for remote files, but this is another game.
Best regards, Michael.
next prev parent reply other threads:[~2020-10-26 13:11 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-25 19:38 bug#44217: 28.0.50; Incorret during delete in Tramp: Trashing...done Jean Louis
2020-10-26 11:14 ` bug#44217: bug#44216: " Lars Ingebrigtsen
2020-10-26 11:51 ` Jean Louis
2020-10-26 16:56 ` Michael Albinus
2020-10-26 17:01 ` Eli Zaretskii
2020-10-26 13:11 ` Michael Albinus [this message]
2020-10-26 13:17 ` Lars Ingebrigtsen
2020-10-26 15:35 ` Michael Albinus
2020-10-27 7:42 ` Lars Ingebrigtsen
2020-10-27 15:32 ` Michael Albinus
2020-10-27 17:17 ` Jean Louis
2020-10-27 20:12 ` Michael Albinus
2020-10-28 10:54 ` Jean Louis
2020-11-01 11:59 ` Michael Albinus
2020-11-01 12:36 ` Jean Louis
2020-11-01 13:03 ` bug#44217: " Michael Albinus
2020-11-01 13:33 ` Jean Louis
2020-11-01 14:48 ` Michael Albinus
2020-10-27 17:42 ` bug#44217: (no subject) Lars Ingebrigtsen
2020-10-27 20:20 ` bug#44217: none Michael Albinus
2020-10-28 9:27 ` Lars Ingebrigtsen
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=87imaxuo74.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=44217@debbugs.gnu.org \
--cc=bugs@gnu.support \
--cc=larsi@gnus.org \
/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.