:group 'emerge)
(defcustom emerge-temp-file-prefix
- (let ((env (or (getenv "TMPDIR")
- (getenv "TMP")
- (getenv "TEMP")))
- d)
- (setq d (if (and env (> (length env) 0))
- env
- "/tmp"))
- (if (= (aref d (1- (length d))) ?/)
- (setq d (substring d 0 -1)))
- (concat d "/emerge"))
+ (expand-file-name "emerge" temporary-file-directory)
"*Prefix to put on Emerge temporary file names.
-Do not start with `~/' or `~user-name/'."
+Do not start with `~/' or `~USERNAME/'."
:type 'string
:group 'emerge)
;; 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-name (concat emerge-temp-file-prefix prefix))))
- ;; create the file
- (write-region (point-min) (point-min) f nil 'no-message)
+ (let ((f (make-temp-file (concat emerge-temp-file-prefix prefix))))
(set-file-modes f emerge-temp-file-mode)
f))