# HG changeset patch # User Geoff Voelker # Date 853118601 0 # Node ID 2a3cc82fa1ea7f0a9d8d9bc1d763602cd572a2dd # Parent 06857a0ecebb02997f586bf16b803729914cb938 (make-auto-save-file-name): Replace occurrences of all invalid filename characters. diff -r 06857a0ecebb -r 2a3cc82fa1ea lisp/w32-fns.el --- a/lisp/w32-fns.el Mon Jan 13 01:10:49 1997 +0000 +++ b/lisp/w32-fns.el Mon Jan 13 01:23:21 1997 +0000 @@ -50,8 +50,7 @@ (add-hook 'shell-mode-hook '(lambda () (setq comint-completion-addsuffix '("\\" . " ")))) -;;; Avoid creating auto-save file names containing invalid characters -;;; (primarily "*", eg. for the *mail* buffer). +;; Avoid creating auto-save file names containing invalid characters. (fset 'original-make-auto-save-file-name (symbol-function 'make-auto-save-file-name)) @@ -62,8 +61,11 @@ See also `auto-save-file-name-p'." (let ((name (original-make-auto-save-file-name)) (start 0)) - ;; destructively replace occurences of * or ? with $ - (while (string-match "[?*]" name start) + ;; Skip drive letter if present. + (if (string-match "^[\/]?[a-zA-`]:" name) + (setq start (- (match-end 0) (match-beginning 0)))) + ;; Destructively replace occurrences of *?"<>|: with $ + (while (string-match "[?*\"<>|:]" name start) (aset name (match-beginning 0) ?$) (setq start (1+ (match-end 0)))) name))