From fe87e356124494b8450d12f1c23f3fb08bbf7b06 Mon Sep 17 00:00:00 2001 From: Ted Zlatanov Date: Fri, 18 Aug 2017 22:07:36 -0400 Subject: [PATCH] * lisp/files.el (make-temp-file): Fix directory use case. --- lisp/files.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/files.el b/lisp/files.el index af5d3ba53e1..a2b474f8d2b 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1419,7 +1419,8 @@ If SUFFIX is non-nil, add that at the end of the file name." (files--make-magic-temp-file absolute-prefix dir-flag suffix contents) (let ((file (make-temp-file-internal absolute-prefix (if dir-flag t) (or suffix "")))) - (write-region contents nil file nil 'silent) + (when (and (stringp text) (not dir-flag)) + (write-region contents nil file nil 'silent)) file)))) (defun files--make-magic-temp-file (absolute-prefix -- 2.39.2