aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii <[email protected]>2001-09-16 10:22:43 +0000
committerEli Zaretskii <[email protected]>2001-09-16 10:22:43 +0000
commit8aee7d4464554a657a1dd0bb10c5f1492c54784b (patch)
tree3d6a91e796405586b3bd48237e1a6c16a1d1e6ba
parentf68113db5149037e525e5624caf50c26884e1df2 (diff)
(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.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/dos-fns.el19
2 files changed, 24 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 42f897fb98..e69e04dd55 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
2001-09-16 Eli Zaretskii <[email protected]>
+ * dos-fns.el (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.
+
* mail/rmail.el (top-level): Require mule-utils when compiling.
(rmail-decode-babyl-format): Use detect-coding-with-priority
instead of detect-coding-region, to favor detection of emacs-mule
diff --git a/lisp/dos-fns.el b/lisp/dos-fns.el
index 1a727f139d..3751cc76d2 100644
--- a/lisp/dos-fns.el
+++ b/lisp/dos-fns.el
@@ -172,6 +172,25 @@ with a definition that really does change some file names."
(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)