Subject: Re: bug#44059: 28.0.50; Trash files cannot be deleted properly if delete-by-moving-to-trash is set

From: Jean Louis <[email-masked]>
Date: Mon, 19 Oct 2020 14:30:50 +0300

* Lars Ingebrigtsen <[email-masked]> [2020-10-19 12:55]:
> Jean Louis <[email-masked]> writes:
> 
> > then I cannot delete files in Trash, you can see what is happening,
> > files may get a backup in Trash directory, but they do not get deleted,
> > I need to invoke shell command or disable delete-by-moving-to-trash
> 
> I'm not sure whether that's a malfeature or not -- if you've told Emacs
> that everything you delete should go to the trash can, then even
> deleting things in the trash can should perhaps go there?
> 
> Perhaps a new value to delete-by-moving-to-trash that would mean "delete
> if we're trying to delete in the trash can"?
> 
> And... there doesn't seem to be any commands in Emacs for emptying the
> trash can?  Shouldn't there be?

I think that is related to Dired and maybe some functions without
Dired.

I have solved the problem by adding in ~/tmp/Trash/.dir-locals.el

;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((dired-mode . ((delete-by-moving-to-trash . nil))))

In my opinion, if the delete-by-moving-to-trash is true, that file
should be made there read-only and user should be informed in Info
manual or in the setting of that variable including setting of
variable for trash location.

Practical error case is that I was recording screen and deleting
various videos, screen recording was taking so much space, I lost all
space on hard disk. And I could not delete things inside of the
Trash. It was emergency already to do something, my solution was
above.