From 176f2077aa8ad043382b333a9d1eaf2c164e9e30 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 22 Nov 2014 10:30:36 +0100 Subject: [PATCH] * net/tramp-sh.el (tramp-get-remote-locale): Return "LC_ALL=C" as fallback. (tramp-open-connection-setup-interactive-shell): No need to check for nil as `tramp-get-remote-locale' return value. --- lisp/ChangeLog | 7 +++++++ lisp/net/tramp-sh.el | 10 ++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1ce22d0fdb..148d77ffa9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2014-11-22 Michael Albinus + + * net/tramp-sh.el (tramp-get-remote-locale): Return "LC_ALL=C" as + fallback. + (tramp-open-connection-setup-interactive-shell): No need to check + for nil as `tramp-get-remote-locale' return value. + 2014-11-21 Eli Zaretskii * vc/vc-git.el (vc-git-command, vc-git--call): Bind diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 21ec741d39..ff00b55756 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3972,8 +3972,7 @@ process to set up. VEC specifies the connection." ;; Use MULE to select the right EOL convention for communicating ;; with the process. (let ((cs (or (and (memq 'utf-8 (coding-system-list)) - (string-match - "utf8" (or (tramp-get-remote-locale vec) "")) + (string-match "utf8" (tramp-get-remote-locale vec)) (cons 'utf-8 'utf-8)) (tramp-compat-funcall 'process-coding-system proc) (cons 'undecided 'undecided))) @@ -4080,8 +4079,7 @@ process to set up. VEC specifies the connection." ;; Set the environment. (tramp-message vec 5 "Setting default environment") - (let ((env (append (when (tramp-get-remote-locale vec) ; Discard `(nil)'. - `(,(tramp-get-remote-locale vec))) + (let ((env (append `(,(tramp-get-remote-locale vec)) (copy-sequence tramp-remote-process-environment))) unset vars item) (while env @@ -5077,7 +5075,7 @@ Return ATTR." (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")) + (let ((candidates '("en_US.utf8" "C.utf8")) locale) (with-current-buffer (tramp-get-connection-buffer vec) (while candidates @@ -5087,7 +5085,7 @@ Return ATTR." candidates nil) (setq candidates (cdr candidates))))) ;; Return value. - (when locale (format "LC_ALL=%s" locale))))) + (format "LC_ALL=%s" (or locale "C"))))) (defun tramp-get-ls-command (vec) (with-tramp-connection-property vec "ls" -- 2.39.2