aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2016-01-09 13:55:02 +0100
committerMichael Albinus2016-01-09 13:55:02 +0100
commit90fd798aacbf92a330cf43d2670479499daf3fb1 (patch)
treeb4be06f61e63aea068c3d2a4598d77732bc9b3fa
parente985a0e9eed9542716c4c03e0e9a1a973de97a7a (diff)
downloademacs-90fd798aacbf92a330cf43d2670479499daf3fb1.tar.gz
emacs-90fd798aacbf92a330cf43d2670479499daf3fb1.zip
Fix coding system for Tramp on OS X.
* lisp/net/tramp-compat.el: Require ucs-normalize. * lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): Set coding system to `utf-8-hfs' for Mac OS X. * test/automated/tramp-tests.el (tramp-test29-vc-registered): Flush directory properties when needed. (tramp--test-utf8): Include Chinese file name, again.
-rw-r--r--lisp/net/tramp-compat.el2
-rw-r--r--lisp/net/tramp-sh.el14
-rw-r--r--test/automated/tramp-tests.el7
3 files changed, 16 insertions, 7 deletions
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index c6de1837e9a..44923aee895 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -56,6 +56,8 @@
56 (require 'custom) 56 (require 'custom)
57 (require 'format-spec) 57 (require 'format-spec)
58 (require 'shell) 58 (require 'shell)
59 ;; Introduced in Emacs 23.2.
60 (require 'ucs-normalize nil 'noerror)
59 61
60 (require 'trampver) 62 (require 'trampver)
61 (require 'tramp-loaddefs) 63 (require 'tramp-loaddefs)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index ca0707f5941..1357db0ac42 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4214,10 +4214,8 @@ process to set up. VEC specifies the connection."
4214 (cons 'undecided 'undecided))) 4214 (cons 'undecided 'undecided)))
4215 cs-decode cs-encode) 4215 cs-decode cs-encode)
4216 (when (symbolp cs) (setq cs (cons cs cs))) 4216 (when (symbolp cs) (setq cs (cons cs cs)))
4217 (setq cs-decode (car cs)) 4217 (setq cs-decode (or (car cs) 'undecided)
4218 (setq cs-encode (cdr cs)) 4218 cs-encode (or (cdr cs) 'undecided))
4219 (unless cs-decode (setq cs-decode 'undecided))
4220 (unless cs-encode (setq cs-encode 'undecided))
4221 (setq cs-encode 4219 (setq cs-encode
4222 (tramp-compat-coding-system-change-eol-conversion 4220 (tramp-compat-coding-system-change-eol-conversion
4223 cs-encode 4221 cs-encode
@@ -4229,7 +4227,13 @@ process to set up. VEC specifies the connection."
4229 (when (search-forward "\r" nil t) 4227 (when (search-forward "\r" nil t)
4230 (setq cs-decode (tramp-compat-coding-system-change-eol-conversion 4228 (setq cs-decode (tramp-compat-coding-system-change-eol-conversion
4231 cs-decode 'dos))) 4229 cs-decode 'dos)))
4232 (tramp-compat-funcall 4230 ;; Special setting for Mac OS X.
4231 (when (and (string-match
4232 "^Darwin" (tramp-get-connection-property vec "uname" ""))
4233 (memq 'utf-8-hfs (coding-system-list)))
4234 (setq cs-decode 'utf-8-hfs
4235 cs-encode 'utf-8-hfs))
4236 (tramp-compat-funcall
4233 'set-buffer-process-coding-system cs-decode cs-encode) 4237 'set-buffer-process-coding-system cs-decode cs-encode)
4234 (tramp-message 4238 (tramp-message
4235 vec 5 "Setting coding system to `%s' and `%s'" cs-decode cs-encode)) 4239 vec 5 "Setting coding system to `%s' and `%s'" cs-decode cs-encode))
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el
index 73a72946db4..c956f9cd008 100644
--- a/test/automated/tramp-tests.el
+++ b/test/automated/tramp-tests.el
@@ -1658,6 +1658,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
1658 (vc-register 1658 (vc-register
1659 nil (list (car vc-handled-backends) 1659 nil (list (car vc-handled-backends)
1660 (list (file-name-nondirectory tmp-name2)))))) 1660 (list (file-name-nondirectory tmp-name2))))))
1661 ;; vc-git uses an own process sentinel, Tramp's sentinel
1662 ;; for flushing the cache isn't used.
1663 (with-parsed-tramp-file-name tmp-name1 nil
1664 (tramp-flush-directory-property v localname))
1661 (should (vc-registered (file-name-nondirectory tmp-name2))))) 1665 (should (vc-registered (file-name-nondirectory tmp-name2)))))
1662 1666
1663 ;; Cleanup. 1667 ;; Cleanup.
@@ -2044,8 +2048,7 @@ Use the `ls' command."
2044 (unless (tramp--test-hpux-p) "Γυρίστε το Γαλαξία με Ώτο Στοπ") 2048 (unless (tramp--test-hpux-p) "Γυρίστε το Γαλαξία με Ώτο Στοπ")
2045 (unless (or (tramp--test-hpux-p) (tramp--test-darwin-p)) 2049 (unless (or (tramp--test-hpux-p) (tramp--test-darwin-p))
2046 "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت") 2050 "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت")
2047 (unless (tramp--test-darwin-p) 2051 "银河系漫游指南系列"
2048 "银河系漫游指南系列")
2049 "Автостопом по гала́ктике"))) 2052 "Автостопом по гала́ктике")))
2050 2053
2051(ert-deftest tramp-test32-utf8 () 2054(ert-deftest tramp-test32-utf8 ()