Commit a8abaf83 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(make-auto-save-file-name): Try a few directories

to get one we can write in.
parent 85ea1a28
......@@ -2471,8 +2471,14 @@ See also `auto-save-file-name-p'."
(substring buffer-name (match-end 0))))
(setq limit (1+ (match-end 0))))
(expand-file-name (format "#%s#%s#" buffer-name (make-temp-name ""))))))
;; Generate the file name.
(format "#%s#%s#" buffer-name (make-temp-name ""))
;; Try a few alternative directories, to get one we can write it.
((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'.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment