diff options
| -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 @@ | |||
| 50 | (add-hook 'shell-mode-hook | 50 | (add-hook 'shell-mode-hook |
| 51 | '(lambda () (setq comint-completion-addsuffix '("\\" . " ")))) | 51 | '(lambda () (setq comint-completion-addsuffix '("\\" . " ")))) |
| 52 | 52 | ||
| 53 | ;;; Avoid creating auto-save file names containing invalid characters | 53 | ;; Avoid creating auto-save file names containing invalid characters. |
| 54 | ;;; (primarily "*", eg. for the *mail* buffer). | ||
| 55 | (fset 'original-make-auto-save-file-name | 54 | (fset 'original-make-auto-save-file-name |
| 56 | (symbol-function 'make-auto-save-file-name)) | 55 | (symbol-function 'make-auto-save-file-name)) |
| 57 | 56 | ||
| @@ -62,8 +61,11 @@ before calling this function. You can redefine this for customization. | |||
| 62 | See also `auto-save-file-name-p'." | 61 | See also `auto-save-file-name-p'." |
| 63 | (let ((name (original-make-auto-save-file-name)) | 62 | (let ((name (original-make-auto-save-file-name)) |
| 64 | (start 0)) | 63 | (start 0)) |
| 65 | ;; destructively replace occurences of * or ? with $ | 64 | ;; Skip drive letter if present. |
| 66 | (while (string-match "[?*]" name start) | 65 | (if (string-match "^[\/]?[a-zA-`]:" name) |
| 66 | (setq start (- (match-end 0) (match-beginning 0)))) | ||
| 67 | ;; Destructively replace occurrences of *?"<>|: with $ | ||
| 68 | (while (string-match "[?*\"<>|:]" name start) | ||
| 67 | (aset name (match-beginning 0) ?$) | 69 | (aset name (match-beginning 0) ?$) |
| 68 | (setq start (1+ (match-end 0)))) | 70 | (setq start (1+ (match-end 0)))) |
| 69 | name)) | 71 | name)) |