diff options
author | Geoff Voelker <voelker@cs.washington.edu> | 1997-01-13 01:23:21 +0000 |
---|---|---|
committer | Geoff Voelker <voelker@cs.washington.edu> | 1997-01-13 01:23:21 +0000 |
commit | 926e2fdb931925a7cfb8de16bd4ecf8909f5787a (patch) | |
tree | 412415c1ff893852155da4e7d0ce4647fe3339e7 /lisp/w32-fns.el | |
parent | 86b54f498ed8d4035464ebb6feee76b78c776504 (diff) | |
download | emacs-926e2fdb931925a7cfb8de16bd4ecf8909f5787a.tar.gz |
(make-auto-save-file-name): Replace occurrences of
all invalid filename characters.
Diffstat (limited to 'lisp/w32-fns.el')
-rw-r--r-- | lisp/w32-fns.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el index 720fbed211b..ab26ba71cff 100644 --- a/lisp/w32-fns.el +++ b/lisp/w32-fns.el @@ -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 @@ before calling this function. You can redefine this for customization. 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)) |