;; Make sure auto-save file names don't contain characters
;; invalid for the underlying filesystem.
(if (and (memq system-type '(ms-dos windows-nt cygwin))
- ;; Don't modify remote (ange-ftp) filenames
- (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" result)))
+ ;; Don't modify remote filenames
+ (not (file-remote-p result)))
(convert-standard-filename result)
result))))
((file-writable-p "/var/tmp/") "/var/tmp/")
("~/")))))
(if (and (memq system-type '(ms-dos windows-nt cygwin))
- ;; Don't modify remote (ange-ftp) filenames
- (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" fname)))
+ ;; Don't modify remote filenames
+ (not (file-remote-p fname)))
;; The call to convert-standard-filename is in case
;; buffer-name includes characters not allowed by the
;; DOS/Windows filesystems. make-temp-file writes to the
(file-exists-p tramp-auto-save-directory))
(make-directory tramp-auto-save-directory t))
- (let ((system-type 'not-windows)
+ (let ((system-type
+ (if (and (stringp tramp-auto-save-directory)
+ (file-remote-p tramp-auto-save-directory))
+ 'not-windows
+ system-type))
(auto-save-file-name-transforms
(if (null tramp-auto-save-directory)
auto-save-file-name-transforms))
(string-equal
(make-auto-save-file-name)
;; This is taken from original `make-auto-save-file-name'.
- (expand-file-name
- (format
- "#%s#"
- (subst-char-in-string
- ?/ ?! (replace-regexp-in-string "!" "!!" tmp-name1)))
- temporary-file-directory)))))
+ ;; We call `convert-standard-filename', because on
+ ;; MS Windows the (local) colons must be replaced by
+ ;; exclamation marks.
+ (convert-standard-filename
+ (expand-file-name
+ (format
+ "#%s#"
+ (subst-char-in-string
+ ?/ ?! (replace-regexp-in-string "!" "!!" tmp-name1)))
+ temporary-file-directory))))))
;; No mapping.
(let (tramp-auto-save-directory auto-save-file-name-transforms)