+(defcustom current-language-environment "English"
+ "The last language environment specified with `set-language-environment'.
+This variable should be set only with \\[customize], which is equivalent
+to using the function `set-language-environment'."
+ :link '(custom-manual "(emacs)Language Environments")
+ :set (lambda (symbol value) (set-language-environment value))
+ :get (lambda (x)
+ (or (car-safe (assoc-ignore-case
+ (if (symbolp current-language-environment)
+ (symbol-name current-language-environment)
+ current-language-environment)
+ language-info-alist))
+ "English"))
+ :type (cons 'choice (mapcar (lambda (lang)
+ (list 'const (car lang)))
+ language-info-alist))
+ :initialize 'custom-initialize-default
+ :group 'mule
+ :type 'string)
+
+(defun reset-language-environment ()
+ "Reset multilingual environment of Emacs to the default status.
+
+The default status is as follows:
+
+ The default value of `buffer-file-coding-system' is nil.
+ The default coding system for process I/O is nil.
+ The default value for the command `set-terminal-coding-system' is nil.
+ The default value for the command `set-keyboard-coding-system' is nil.
+
+ The order of priorities of coding categories and the coding system
+ bound to each category are as follows
+ coding category coding system
+ --------------------------------------------------
+ iso-7 iso-2022-7bit
+ no-conversion raw-text
+ utf-8 utf-8
+ iso-8-1 iso-8859-1
+ iso-8-2 ctext (iso-8859-1 alias)
+ iso-8-designate ctext (iso-8859-1 alias)
+ iso-lock-shift iso-2022-lock
+ shift-jis shift_jis
+ big5 big5
+ ucs-4 iso-10646-ucs-4
+"
+;; The old table (from FSF synch?) was not what we use (cf mule-coding.el),
+;; and as documented iso-8-designate is inconsistent with iso-2022-8bit-ss2.
+;; The order of priorities of coding categories and the coding system
+;; bound to each category are as follows
+;; coding category coding system
+;; --------------------------------------------------
+;; iso-8-2 iso-8859-1
+;; iso-8-1 iso-8859-1
+;; iso-7 iso-2022-7bit
+;; iso-lock-shift iso-2022-lock
+;; iso-8-designate iso-2022-8bit-ss2
+;; no-conversion raw-text
+;; shift-jis shift_jis
+;; big5 big5
+;; ucs-4 ----
+;; utf-8 ----
+ (interactive)
+
+ (set-coding-category-system 'iso-7 'iso-2022-7)
+ (set-coding-category-system 'iso-8-1 'iso-8859-1)
+ (set-coding-category-system 'iso-8-2 'ctext)
+ (set-coding-category-system 'iso-lock-shift 'iso-2022-lock)
+ (set-coding-category-system 'iso-8-designate 'ctext)
+ (set-coding-category-system 'no-conversion 'raw-text)
+ (set-coding-category-system 'shift-jis 'shift_jis)
+ (set-coding-category-system 'big5 'big5)
+ ;; #### Can we now assume the existence of the 10646 coding systems?
+ ;; #### These lists need to be synched with the ones in mule-coding.el.
+ (cond ((eq (coding-system-type (coding-category-system 'utf-8)) 'utf-8)
+ (set-coding-category-system 'utf-8 'utf-8)
+ (cond ((eq (coding-system-type (coding-category-system 'ucs-4))
+ 'iso-10646-ucs-4)
+ (set-coding-category-system 'ucs-4 'iso-10646-ucs-4)
+ (set-coding-priority-list
+ '(iso-7
+ no-conversion
+ utf-8
+ iso-8-1
+ iso-8-2
+ iso-8-designate
+ iso-lock-shift
+ shift-jis
+ big5
+ ucs-4))
+ )
+ (t
+ (set-coding-priority-list
+ '(iso-7
+ no-conversion
+ utf-8
+ iso-8-1
+ iso-8-2
+ iso-8-designate
+ iso-lock-shift
+ shift-jis
+ big5))
+ ))
+ )
+ (t
+ (set-coding-priority-list
+ '(iso-7
+ no-conversion
+ iso-8-1
+ iso-8-2
+ iso-8-designate
+ iso-lock-shift
+ shift-jis
+ big5))
+ ))
+
+ ;; (update-coding-systems-internal)
+
+ (set-default-coding-systems nil)
+ ;; Don't alter the terminal and keyboard coding systems here.
+ ;; The terminal still supports the same coding system
+ ;; that it supported a minute ago.
+;;; (set-terminal-coding-system-internal nil)
+;;; (set-keyboard-coding-system-internal nil)
+
+ ;; (setq nonascii-translation-table nil
+ ;; nonascii-insert-offset 0)
+ )