Windows 10, Emacs 25.1
In my init.el
I set:
delete-by-moving-to-trash t
So as result when I delete file it move to trash. Nice. But how I restore delete file from trash by Emacs?
Windows 10, Emacs 25.1
In my init.el
I set:
delete-by-moving-to-trash t
So as result when I delete file it move to trash. Nice. But how I restore delete file from trash by Emacs?
I don't use trash, so this is a bit of a guess. And I don't find anything about restoring trashed files in the Emacs or Elisp manuals. You might want to just check your system docs for info about restoring from your system trash can.
Anyway...
First, customize option trash-directory
, if you have not already. Thereafter, trashed files will be put in that directory.
To restore a file that has been trashed there, use C-x d
to open Dired on that directory, then use R
to move one or more trashed files to another directory. R
moves all marked files (or just the file of the current line, if none are marked). At the prompt, type the name of the target directory.
If you have not set option trash-directory
then files get trashed to your system recycle bin (trash can), provided function system-move-file-to-trash
is defined.
In that case, use C-x d
to open your system trash folder (it may be $trash/files
).
However, See https://specifications.freedesktop.org/trash-spec/trashspec-latest.html for information about the kind of trash can that is used by default, and how to obtain the original file name of a trashed file.
You can use Trashed in MELPA. This package provides you a simple but convenient user interface to manage trashed files. It supports both MS Windows Recycle Bin and freedesktop.org Trash Can. See https://github.com/shingo256/trashed