summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/files.el b/lisp/files.el
index b57e35b9a0a..25392fdcc71 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3723,7 +3723,8 @@ Return the new variables list."
(let* ((file-name (or (buffer-file-name)
;; Handle non-file buffers, too.
(expand-file-name default-directory)))
- (sub-file-name (if file-name
+ (sub-file-name (if (and file-name
+ (file-name-absolute-p file-name))
;; FIXME: Why not use file-relative-name?
(substring file-name (length root)))))
(condition-case err
@@ -6074,8 +6075,8 @@ See also `auto-save-file-name-p'."
;; 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))))
@@ -6112,8 +6113,8 @@ See also `auto-save-file-name-p'."
((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