diff options
author | Gerd Moellmann <gerd@gnu.org> | 2000-06-23 07:06:02 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2000-06-23 07:06:02 +0000 |
commit | 78c56e706293a2a91660def4cab1f842b083e29a (patch) | |
tree | 3ade9dd237d67b3e11110f9c16ac94236255d386 /lisp/emerge.el | |
parent | db7ae45bd7d6bee6123c4fd9956316e787d557bb (diff) | |
download | emacs-78c56e706293a2a91660def4cab1f842b083e29a.tar.gz |
(emerge-make-temp-file): Make sure file has proper
permissions from birth.
Diffstat (limited to 'lisp/emerge.el')
-rw-r--r-- | lisp/emerge.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/emerge.el b/lisp/emerge.el index b876c1c1192..332c8b46995 100644 --- a/lisp/emerge.el +++ b/lisp/emerge.el @@ -2907,8 +2907,12 @@ keymap. Leaves merge in fast mode." ;; 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. |