diff options
author | Geoff Voelker <voelker@cs.washington.edu> | 1996-05-03 18:25:59 +0000 |
---|---|---|
committer | Geoff Voelker <voelker@cs.washington.edu> | 1996-05-03 18:25:59 +0000 |
commit | 4e0cd0df0ded9fb4b20ec429ec606d20fba5b7f3 (patch) | |
tree | 200d1ca02a1099a247678e688787271d1c87dbff /lisp/w32-fns.el | |
parent | 6c89f572f229020c8727d56f10b8f9e33bbda6bc (diff) | |
download | emacs-4e0cd0df0ded9fb4b20ec429ec606d20fba5b7f3.tar.gz |
(original-make-auto-save-file-name): New symbol bound
to old value of make-auto-save-file-name.
(make-auto-save-file-name): New function overriding old.
Diffstat (limited to 'lisp/w32-fns.el')
-rw-r--r-- | lisp/w32-fns.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el index aef3d5550c2..0502fe9986a 100644 --- a/lisp/w32-fns.el +++ b/lisp/w32-fns.el @@ -154,6 +154,24 @@ against the file name, and TYPE is nil for text, t for binary.") (remove-hook 'write-file-hooks 'save-to-unix-hook) (remove-hook 'after-save-hook 'revert-from-unix-hook)))) +;;; Avoid creating auto-save file names containing illegal characters +;;; (primarily "*", eg. for the *mail* buffer). +(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 ((name (original-make-auto-save-file-name)) + (start 0)) + ;; destructively replace occurences of * or ? with $ + (while (string-match "[?*]" name start) + (aset name (match-beginning 0) ?$) + (setq start (1+ (match-end 0)))) + name)) + ;;; Fix interface to (X-specific) mouse.el (defalias 'x-set-selection 'ignore) (fset 'x-get-selection '(lambda (&rest rest) "")) |