changeset 39301:5be08a776a76

(original-make-auto-save-file-name): New. (make-auto-save-file-name): New function, overrides the definition on files.el and calls the original function via original-make-auto-save-file-name.
author Eli Zaretskii <eliz@gnu.org>
date Sun, 16 Sep 2001 10:21:44 +0000
parents 8b178b9f2ee1
children fc35af97f024
files lisp/dos-fns.el
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/dos-fns.el	Sun Sep 16 08:07:55 2001 +0000
+++ b/lisp/dos-fns.el	Sun Sep 16 10:21:44 2001 +0000
@@ -172,6 +172,25 @@
 		    (dos-8+3-filename dir))
 		  string))))))
 
+;; Make sure auto-save file names don't contain characters invalid for
+;; the underlying filesystem.  This is particularly annoying with
+;; `compose-mail's *mail* buffers: `*' is not allowed in file names on
+;; DOS/Windows, so Emacs bitches on you each time it tries to autosave
+;; the message being composed.
+(fset 'original-make-auto-save-file-name
+      (symbol-function 'make-auto-save-file-name))
+
+(defun make-auto-save-file-name ()
+  "Return file name to use for auto-saves of current buffer.
+Does not consider `auto-save-visited-file-name' as that variable is checked
+before calling this function.  You can redefine this for customization.
+See also `auto-save-file-name-p'."
+  (let ((filename (original-make-auto-save-file-name)))
+    ;; Don't modify remote (ange-ftp) filenames
+    (if (string-match "^/\\w+@[-A-Za-z0-9._]+:" filename)
+	filename
+      (convert-standard-filename filename))))
+
 ;; See dos-vars.el for defcustom.
 (defvar msdos-shells)