* files.el (move-file-to-trash): Preserve default file modes on error.

This commit is contained in:
Paul Eggert 2011-12-29 13:08:18 -08:00
parent b9110d6a11
commit 6bb72cbd8b
2 changed files with 12 additions and 6 deletions

View file

@ -1,3 +1,7 @@
2011-12-29 Paul Eggert <eggert@cs.ucla.edu>
* files.el (move-file-to-trash): Preserve default file modes on error.
2011-12-29 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-sh.el (tramp-find-shell): Set "remote-shell" property

View file

@ -6457,12 +6457,14 @@ Otherwise, trash FILENAME using the freedesktop.org conventions,
;; Ensure that the trash directory exists; otherwise, create it.
(let ((saved-default-file-modes (default-file-modes)))
(set-default-file-modes ?\700)
(unless (file-exists-p trash-files-dir)
(make-directory trash-files-dir t))
(unless (file-exists-p trash-info-dir)
(make-directory trash-info-dir t))
(set-default-file-modes saved-default-file-modes))
(unwind-protect
(progn
(set-default-file-modes #o700)
(unless (file-exists-p trash-files-dir)
(make-directory trash-files-dir t))
(unless (file-exists-p trash-info-dir)
(make-directory trash-info-dir t)))
(set-default-file-modes saved-default-file-modes)))
;; Try to move to trash with .trashinfo undo information
(save-excursion