# HG changeset patch # User Geoff Voelker # Date 831147959 0 # Node ID 72a1f82a67481630fa90f0da611be0dac1d56ba8 # Parent cc3c8961d60ad3faaae493173f6b5ce558e558b3 (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. diff -r cc3c8961d60a -r 72a1f82a6748 lisp/w32-fns.el --- a/lisp/w32-fns.el Fri May 03 18:23:44 1996 +0000 +++ b/lisp/w32-fns.el Fri May 03 18:25:59 1996 +0000 @@ -154,6 +154,24 @@ (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) ""))