Mercurial > emacs
changeset 29884:1c158fa0f918
(emerge-make-temp-file): Make sure file has proper
permissions from birth.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 23 Jun 2000 07:05:34 +0000 |
parents | 53bc9bb1f0b8 |
children | abd1315edfaf |
files | lisp/emerge.el |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/emerge.el Fri Jun 23 07:05:13 2000 +0000 +++ b/lisp/emerge.el Fri Jun 23 07:05:34 2000 +0000 @@ -2907,8 +2907,12 @@ ;; Make a temporary file that only we have access to. ;; PREFIX is appended to emerge-temp-file-prefix to make the filename prefix. (defun emerge-make-temp-file (prefix) - (let ((f (make-temp-file (concat emerge-temp-file-prefix prefix)))) - (set-file-modes f emerge-temp-file-mode) + (let (f (old-modes (default-file-modes))) + (unwind-protect + (progn + (set-default-file-modes emerge-temp-file-mode) + (setq f (make-temp-file (concat emerge-temp-file-prefix prefix)))) + (set-default-file-modes old-modes)) f)) ;;; Functions that query the user before he can write out the current buffer.