diff options
| author | Michael Albinus | 2013-12-02 14:52:23 +0100 |
|---|---|---|
| committer | Michael Albinus | 2013-12-02 14:52:23 +0100 |
| commit | a8a15d9d4529d9cc2ace1cbacf0828cb14c6de94 (patch) | |
| tree | ea4824dd41f859152eee01306757d3ad14002cae | |
| parent | dacc9715a7aaf3e363cf67d6f8f3edd1c5f0e011 (diff) | |
| download | emacs-a8a15d9d4529d9cc2ace1cbacf0828cb14c6de94.tar.gz emacs-a8a15d9d4529d9cc2ace1cbacf0828cb14c6de94.zip | |
* net/tramp-sh.el (tramp-remote-process-environment): Do not set "LC_ALL".
(tramp-get-remote-locale): New defun.
(tramp-open-connection-setup-interactive-shell): Use it.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 21 |
2 files changed, 25 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index df576658697..5bb405e04c3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-12-02 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp-sh.el (tramp-remote-process-environment): Do not set | ||
| 4 | "LC_ALL". | ||
| 5 | (tramp-get-remote-locale): New defun. | ||
| 6 | (tramp-open-connection-setup-interactive-shell): Use it. | ||
| 7 | |||
| 1 | 2013-12-02 Leo Liu <sdl.web@gmail.com> | 8 | 2013-12-02 Leo Liu <sdl.web@gmail.com> |
| 2 | 9 | ||
| 3 | * subr.el (process-live-p): Return nil for non-process. (Bug#16023) | 10 | * subr.el (process-live-p): Return nil for non-process. (Bug#16023) |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 455ea1d4e9e..6beece526ff 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -419,8 +419,7 @@ as given in your `~/.profile'." | |||
| 419 | 419 | ||
| 420 | ;;;###tramp-autoload | 420 | ;;;###tramp-autoload |
| 421 | (defcustom tramp-remote-process-environment | 421 | (defcustom tramp-remote-process-environment |
| 422 | `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "TMOUT=0" | 422 | `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "TMOUT=0" "LC_CTYPE=''" |
| 423 | "LC_ALL=en_US.utf8" "LC_CTYPE=''" | ||
| 424 | ,(format "TERM=%s" tramp-terminal-type) | 423 | ,(format "TERM=%s" tramp-terminal-type) |
| 425 | "EMACS=t" ;; Deprecated. | 424 | "EMACS=t" ;; Deprecated. |
| 426 | ,(format "INSIDE_EMACS='%s,tramp:%s'" emacs-version tramp-version) | 425 | ,(format "INSIDE_EMACS='%s,tramp:%s'" emacs-version tramp-version) |
| @@ -3889,7 +3888,8 @@ process to set up. VEC specifies the connection." | |||
| 3889 | ;; Set the environment. | 3888 | ;; Set the environment. |
| 3890 | (tramp-message vec 5 "Setting default environment") | 3889 | (tramp-message vec 5 "Setting default environment") |
| 3891 | 3890 | ||
| 3892 | (let ((env (copy-sequence tramp-remote-process-environment)) | 3891 | (let ((env (append `(,(tramp-get-remote-locale vec)) |
| 3892 | (copy-sequence tramp-remote-process-environment))) | ||
| 3893 | unset item) | 3893 | unset item) |
| 3894 | (while env | 3894 | (while env |
| 3895 | (setq item (tramp-compat-split-string (car env) "=")) | 3895 | (setq item (tramp-compat-split-string (car env) "=")) |
| @@ -4827,6 +4827,21 @@ Return ATTR." | |||
| 4827 | x)) | 4827 | x)) |
| 4828 | remote-path))))) | 4828 | remote-path))))) |
| 4829 | 4829 | ||
| 4830 | (defun tramp-get-remote-locale (vec) | ||
| 4831 | (with-tramp-connection-property vec "locale" | ||
| 4832 | (tramp-send-command vec "locale -a") | ||
| 4833 | (let ((candidates '("en_US.utf8" "C.utf8" "C")) | ||
| 4834 | locale) | ||
| 4835 | (with-current-buffer (tramp-get-connection-buffer vec) | ||
| 4836 | (while candidates | ||
| 4837 | (goto-char (point-min)) | ||
| 4838 | (if (string-match (concat "^" (car candidates) "$") (buffer-string)) | ||
| 4839 | (setq locale (car candidates) | ||
| 4840 | candidates nil) | ||
| 4841 | (setq candidates (cdr candidates))))) | ||
| 4842 | ;; Return value. | ||
| 4843 | (when locale (format "LC_ALL=%s" locale))))) | ||
| 4844 | |||
| 4830 | (defun tramp-get-ls-command (vec) | 4845 | (defun tramp-get-ls-command (vec) |
| 4831 | (with-tramp-connection-property vec "ls" | 4846 | (with-tramp-connection-property vec "ls" |
| 4832 | (tramp-message vec 5 "Finding a suitable `ls' command") | 4847 | (tramp-message vec 5 "Finding a suitable `ls' command") |