changeset 89344:1c9758957aae

(find-coding-systems-for-charsets): Use coding-system-type, coding-system-charset-list. (standard-keyboard-coding-systems): Deleted. (set-locale-environment): Maybe set keyboard coding system. Avoid typical warning about codeset in C locale.
author Dave Love <fx@gnu.org>
date Tue, 07 Jan 2003 18:06:43 +0000
parents 80a582c1d40d
children a0e0e8743ad5
files lisp/international/mule-cmds.el
diffstat 1 files changed, 14 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/mule-cmds.el	Tue Jan 07 18:06:29 2003 +0000
+++ b/lisp/international/mule-cmds.el	Tue Jan 07 18:06:43 2003 +0000
@@ -459,9 +459,8 @@
 	(t
 	 (let (codings)
 	   (dolist (cs (coding-system-list t))
-	     (let ((cs-charsets (and (eq 'charset
-					 (coding-system-get cs :coding-type))
-				     (coding-system-get cs :charset-list)))
+	     (let ((cs-charsets (and (eq (coding-system-type cs) 'charset)
+				     (coding-system-charset-list cs)))
 		   (charsets charsets))
 	       (if (coding-system-get cs :ascii-compatible-p)
 		   (add-to-list 'cs-charsets 'ascii))
@@ -1911,14 +1910,6 @@
 The first element whose locale regexp matches the start of a downcased locale
 specifies the coding system to prefer when using that locale.")
 
-(defconst standard-keyboard-coding-systems
-  (purecopy
-   '(iso-latin-1 iso-latin-2 iso-latin-3 iso-latin-4 iso-latin-5
-     iso-latin-6 iso-latin-7 iso-latin-8 iso-latin-9))
-  "Coding systems that are commonly used for keyboards.
-`set-locale-environment' will set the `keyboard-coding-system' if the
-coding-system specified by the locale setting is a member of this list.")
-
 (defun locale-name-match (key alist)
   "Search for KEY in ALIST, which should be a list of regexp-value pairs.
 Return the value corresponding to the first regexp that matches the
@@ -2035,14 +2026,14 @@
 	  (when default-enable-multibyte-characters
 	    (set-display-table-and-terminal-coding-system language-name))
 
-;;; encoded-kbd-mode doesn't work properly at present, and i don't
-;;; think this is the right thing to do anyhow.  -- fx
-;;; 	  ;; Set the `keyboard-coding-system' if appropriate.
-;;; 	  (let ((kcs (or coding-system
-;;; 			 (car (get-language-info language-name
-;;; 						 'coding-system)))))
-;;; 	    (if (memq kcs standard-keyboard-coding-systems)
-;;; 		(set-keyboard-coding-system kcs)))
+	  ;; Set the `keyboard-coding-system' if appropriate (tty
+	  ;; only).  At least X and MS Windows can generate
+	  ;; multilingual input.
+	  (unless window-system
+	    (let ((kcs (or coding-system
+			   (car (get-language-info language-name
+						   'coding-system)))))
+	      (if kcs (set-keyboard-coding-system kcs))))
 
 	  (setq locale-coding-system
 		(car (get-language-info language-name 'coding-priority))))
@@ -2050,7 +2041,8 @@
 	(when coding-system
 	  (prefer-coding-system coding-system)
 	  (setq locale-coding-system coding-system))
-	(let ((codeset (langinfo 'codeset))
+	(when (get-language-info current-language-environment 'coding-priority)
+	  	(let ((codeset (langinfo 'codeset))
 	      (coding-system (car (coding-system-priority-list))))
 	  (when codeset
 	    (let ((cs (coding-system-aliases coding-system))
@@ -2060,8 +2052,8 @@
 		      (locale-charset-match-p (symbol-name (pop cs))
 					      (langinfo 'codeset))))
 	      (unless result
-		(message "Warning: Default coding system `%s' doesn't agree with
-the system code set `%s' for this locale." coding-system codeset)))))))))
+		  (message "Warning: Default coding system `%s' disagrees with
+system codeset `%s' for this locale." coding-system codeset))))))))))
 
 ;;; Character code property
 (put 'char-code-property-table 'char-table-extra-slots 0)