summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/net/tramp-sh.el21
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 @@
+2013-12-02 Michael Albinus <michael.albinus@gmx.de>
+
+ * 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.
+
2013-12-02 Leo Liu <sdl.web@gmail.com>
* 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'."
;;;###tramp-autoload
(defcustom tramp-remote-process-environment
- `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "TMOUT=0"
- "LC_ALL=en_US.utf8" "LC_CTYPE=''"
+ `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "TMOUT=0" "LC_CTYPE=''"
,(format "TERM=%s" tramp-terminal-type)
"EMACS=t" ;; Deprecated.
,(format "INSIDE_EMACS='%s,tramp:%s'" emacs-version tramp-version)
@@ -3889,7 +3888,8 @@ process to set up. VEC specifies the connection."
;; Set the environment.
(tramp-message vec 5 "Setting default environment")
- (let ((env (copy-sequence tramp-remote-process-environment))
+ (let ((env (append `(,(tramp-get-remote-locale vec))
+ (copy-sequence tramp-remote-process-environment)))
unset item)
(while env
(setq item (tramp-compat-split-string (car env) "="))
@@ -4827,6 +4827,21 @@ Return ATTR."
x))
remote-path)))))
+(defun tramp-get-remote-locale (vec)
+ (with-tramp-connection-property vec "locale"
+ (tramp-send-command vec "locale -a")
+ (let ((candidates '("en_US.utf8" "C.utf8" "C"))
+ locale)
+ (with-current-buffer (tramp-get-connection-buffer vec)
+ (while candidates
+ (goto-char (point-min))
+ (if (string-match (concat "^" (car candidates) "$") (buffer-string))
+ (setq locale (car candidates)
+ candidates nil)
+ (setq candidates (cdr candidates)))))
+ ;; Return value.
+ (when locale (format "LC_ALL=%s" locale)))))
+
(defun tramp-get-ls-command (vec)
(with-tramp-connection-property vec "ls"
(tramp-message vec 5 "Finding a suitable `ls' command")