diff options
| author | Michael Albinus | 2016-03-31 11:45:45 +0200 |
|---|---|---|
| committer | Michael Albinus | 2016-03-31 11:45:45 +0200 |
| commit | df441b362c25c4ad59ea3d83137328d0d4098eaf (patch) | |
| tree | 431b2dd5a66cf2e71d73a6d3549342b21228cbcc /lisp | |
| parent | 22443312188ff097b69d9ff4b87c2b4f7bbbc263 (diff) | |
| download | emacs-df441b362c25c4ad59ea3d83137328d0d4098eaf.tar.gz emacs-df441b362c25c4ad59ea3d83137328d0d4098eaf.zip | |
Fix OS X specific settings in tramp-tests
* lisp/net/tramp-sh.el (tramp-maybe-open-connection): Use it.
* lisp/net/tramp.el (tramp-get-local-locale): New defun.
* test/automated/tramp-tests.el (tramp--test-darwin-p): Remove.
(tramp--test-utf8): Improve settings of coding systems.
Do not use `tramp--test-darwin-p' anymore. (Bug#22145)
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/net/tramp-sh.el | 4 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 20 |
2 files changed, 22 insertions, 2 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 9fa46109a5a..5b9083203b5 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -2865,7 +2865,7 @@ This is like `dired-recursive-delete-directory' for Tramp files." | |||
| 2865 | (narrow-to-region (point) (point)) | 2865 | (narrow-to-region (point) (point)) |
| 2866 | ;; We cannot use `insert-buffer-substring' because the Tramp | 2866 | ;; We cannot use `insert-buffer-substring' because the Tramp |
| 2867 | ;; buffer changes its contents before insertion due to calling | 2867 | ;; buffer changes its contents before insertion due to calling |
| 2868 | ;; `expand-file' and alike. | 2868 | ;; `expand-file-name' and alike. |
| 2869 | (insert | 2869 | (insert |
| 2870 | (with-current-buffer (tramp-get-buffer v) | 2870 | (with-current-buffer (tramp-get-buffer v) |
| 2871 | (buffer-string))) | 2871 | (buffer-string))) |
| @@ -4865,7 +4865,7 @@ connection if a previous connection has died for some reason." | |||
| 4865 | (when (and p (processp p)) | 4865 | (when (and p (processp p)) |
| 4866 | (delete-process p)) | 4866 | (delete-process p)) |
| 4867 | (setenv "TERM" tramp-terminal-type) | 4867 | (setenv "TERM" tramp-terminal-type) |
| 4868 | (setenv "LC_ALL" "en_US.utf8") | 4868 | (setenv "LC_ALL" (tramp-get-local-locale vec)) |
| 4869 | (if (stringp tramp-histfile-override) | 4869 | (if (stringp tramp-histfile-override) |
| 4870 | (setenv "HISTFILE" tramp-histfile-override) | 4870 | (setenv "HISTFILE" tramp-histfile-override) |
| 4871 | (if tramp-histfile-override | 4871 | (if tramp-histfile-override |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 43962169d5a..19dced6c2f3 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -3939,6 +3939,26 @@ This is used internally by `tramp-file-mode-from-int'." | |||
| 3939 | (tramp-compat-funcall 'group-gid) | 3939 | (tramp-compat-funcall 'group-gid) |
| 3940 | (nth 3 (tramp-compat-file-attributes "~/" id-format)))) | 3940 | (nth 3 (tramp-compat-file-attributes "~/" id-format)))) |
| 3941 | 3941 | ||
| 3942 | (defun tramp-get-local-locale (&optional vec) | ||
| 3943 | ;; We use key nil for local connection properties. | ||
| 3944 | (with-tramp-connection-property nil "locale" | ||
| 3945 | (let ((candidates '("en_US.utf8" "C.utf8" "en_US.UTF-8")) | ||
| 3946 | locale) | ||
| 3947 | (with-temp-buffer | ||
| 3948 | (unless (or (memq system-type '(windows-nt)) | ||
| 3949 | (not (zerop (tramp-call-process | ||
| 3950 | nil "locale" nil t nil "-a")))) | ||
| 3951 | (while candidates | ||
| 3952 | (goto-char (point-min)) | ||
| 3953 | (if (string-match (format "^%s\r?$" (regexp-quote (car candidates))) | ||
| 3954 | (buffer-string)) | ||
| 3955 | (setq locale (car candidates) | ||
| 3956 | candidates nil) | ||
| 3957 | (setq candidates (cdr candidates)))))) | ||
| 3958 | ;; Return value. | ||
| 3959 | (when vec (tramp-message vec 7 "locale %s" (or locale "C"))) | ||
| 3960 | (or locale "C")))) | ||
| 3961 | |||
| 3942 | ;;;###tramp-autoload | 3962 | ;;;###tramp-autoload |
| 3943 | (defun tramp-check-cached-permissions (vec access) | 3963 | (defun tramp-check-cached-permissions (vec access) |
| 3944 | "Check `file-attributes' caches for VEC. | 3964 | "Check `file-attributes' caches for VEC. |