[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 299b190: Fix auto-save-file-name problem in Tramp o
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] master 299b190: Fix auto-save-file-name problem in Tramp on MS Windows |
Date: |
Tue, 17 Jan 2017 16:35:35 +0000 (UTC) |
branch: master
commit 299b190a6b54ae6df5a5d38205c3137b6578689d
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>
Fix auto-save-file-name problem in Tramp on MS Windows
* lisp/files.el (make-auto-save-file-name): Use `file-remote-p'
rather than an ange-ftp regexp.
* lisp/net/tramp.el (tramp-handle-make-auto-save-file-name):
Fix a problem when running on MS Windows.
* test/lisp/net/tramp-tests.el (tramp-test31-make-auto-save-file-name):
Adapt test.
---
lisp/files.el | 8 ++++----
lisp/net/tramp.el | 6 +++++-
test/lisp/net/tramp-tests.el | 16 ++++++++++------
3 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/lisp/files.el b/lisp/files.el
index b57e35b..f60282b 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -6074,8 +6074,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 "^/address@hidden:" result)))
+ ;; Don't modify remote filenames
+ (not (file-remote-p result)))
(convert-standard-filename result)
result))))
@@ -6112,8 +6112,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 "^/address@hidden:" 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
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 3697d50..fc7fdd3 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4063,7 +4063,11 @@ this file, if that variable is non-nil."
(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))
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 02e5d18..0c3068a 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -1991,12 +1991,16 @@ This tests also `make-symbolic-link', `file-truename'
and `add-name-to-file'."
(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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 299b190: Fix auto-save-file-name problem in Tramp on MS Windows,
Michael Albinus <=