diff options
| author | Paul Eggert | 2011-12-29 13:08:18 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-12-29 13:08:18 -0800 |
| commit | 6bb72cbd8b784aebbc8212dfc28bbfcfbb4b8867 (patch) | |
| tree | 63ea14005c9f70fceeee40d697c3d3ee50e1aed0 | |
| parent | b9110d6a11deb9b1035da53812473f792891ad34 (diff) | |
| download | emacs-6bb72cbd8b784aebbc8212dfc28bbfcfbb4b8867.tar.gz emacs-6bb72cbd8b784aebbc8212dfc28bbfcfbb4b8867.zip | |
* files.el (move-file-to-trash): Preserve default file modes on error.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/files.el | 14 |
2 files changed, 12 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 37286d0780c..d1f00198ca8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2011-12-29 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * files.el (move-file-to-trash): Preserve default file modes on error. | ||
| 4 | |||
| 1 | 2011-12-29 Michael Albinus <michael.albinus@gmx.de> | 5 | 2011-12-29 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 6 | ||
| 3 | * net/tramp-sh.el (tramp-find-shell): Set "remote-shell" property | 7 | * net/tramp-sh.el (tramp-find-shell): Set "remote-shell" property |
diff --git a/lisp/files.el b/lisp/files.el index 0f7386511f6..4cb033617c7 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -6457,12 +6457,14 @@ Otherwise, trash FILENAME using the freedesktop.org conventions, | |||
| 6457 | 6457 | ||
| 6458 | ;; Ensure that the trash directory exists; otherwise, create it. | 6458 | ;; Ensure that the trash directory exists; otherwise, create it. |
| 6459 | (let ((saved-default-file-modes (default-file-modes))) | 6459 | (let ((saved-default-file-modes (default-file-modes))) |
| 6460 | (set-default-file-modes ?\700) | 6460 | (unwind-protect |
| 6461 | (unless (file-exists-p trash-files-dir) | 6461 | (progn |
| 6462 | (make-directory trash-files-dir t)) | 6462 | (set-default-file-modes #o700) |
| 6463 | (unless (file-exists-p trash-info-dir) | 6463 | (unless (file-exists-p trash-files-dir) |
| 6464 | (make-directory trash-info-dir t)) | 6464 | (make-directory trash-files-dir t)) |
| 6465 | (set-default-file-modes saved-default-file-modes)) | 6465 | (unless (file-exists-p trash-info-dir) |
| 6466 | (make-directory trash-info-dir t))) | ||
| 6467 | (set-default-file-modes saved-default-file-modes))) | ||
| 6466 | 6468 | ||
| 6467 | ;; Try to move to trash with .trashinfo undo information | 6469 | ;; Try to move to trash with .trashinfo undo information |
| 6468 | (save-excursion | 6470 | (save-excursion |