From 75244a672adc068f9502b910756a1263b281ea12 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 3 Mar 2002 21:57:59 +0000 Subject: [PATCH] (make-auto-save-file-name): Use make-temp-file. --- lisp/files.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index e748b6069ce..f5ab220ba15 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3342,13 +3342,14 @@ See also `auto-save-file-name-p'." (setq buffer-name (replace-match replacement t t buffer-name)) (setq limit (1+ (match-end 0))))) ;; Generate the file name. - (expand-file-name - (format "#%s#%s#" buffer-name (make-temp-name "")) - ;; Try a few alternative directories, to get one we can write it. - (cond - ((file-writable-p default-directory) default-directory) - ((file-writable-p "/var/tmp/") "/var/tmp/") - ("~/")))))) + (make-temp-file + (expand-file-name + (format "#%s#" buffer-name) + ;; Try a few alternative directories, to get one we can write it. + (cond + ((file-writable-p default-directory) default-directory) + ((file-writable-p "/var/tmp/") "/var/tmp/") + ("~/"))))))) (defun auto-save-file-name-p (filename) "Return non-nil if FILENAME can be yielded by `make-auto-save-file-name'. -- 2.39.5