changeset 21916:ef39b27c5e20

(command-line): When choosing a language from LANG, call set-language-environment in unibyte and multibyte mode. Don't call standard-display-european; instead, call standard-display-european-internal and set-terminal-coding-system. But do them only for latin-1 ... latin-5.
author Richard M. Stallman <rms@gnu.org>
date Sun, 03 May 1998 03:48:05 +0000
parents 8f1159b417c2
children ff6a09ae9530
files lisp/startup.el
diffstat 1 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/startup.el	Sun May 03 02:32:58 1998 +0000
+++ b/lisp/startup.el	Sun May 03 03:48:05 1998 +0000
@@ -483,14 +483,19 @@
 	(if (equal "5" which)
 	    (setq which "9"))
 	(setq charset (concat "latin-" which))
-	(if (string-match "latin-[12345]" charset)
-	    (if default-enable-multibyte-characters
-		;; Set up for this character set in multibyte mode.
-		(set-language-environment charset)
-	      ;; Set up for this character set in unibyte mode.
-	      (load charset)))
-	(standard-display-european t (and default-enable-multibyte-characters
-					  charset)))))
+	(when (string-match "latin-[12345]" charset)
+	  ;; Set up for this character set.
+	  ;; This is now the right way to do it
+	  ;; for both unibyte and multibyte modes.
+	  (set-language-environment charset)
+	  (unless (or noninteractive (eq window-system 'x))
+	    ;; Send those codes literally to a non-X terminal.
+	    (when default-enable-multibyte-characters
+	      ;; If this is nil, we are using single-byte characters,
+	      ;; so the terminal coding system is irrelevant.
+	      (set-terminal-coding-system
+	       (intern (downcase charset)))))
+	  (standard-display-european-internal)))))
 
   ;;! This has been commented out; I currently find the behavior when
   ;;! split-window-keep-point is nil disturbing, but if I can get used