1 ;; Mule default configuration file
3 ;; This file is part of SXEmacs.
5 ;; SXEmacs is free software: you can redistribute it and/or modify
6 ;; it under the terms of the GNU General Public License as published by
7 ;; the Free Software Foundation, either version 3 of the License, or
8 ;; (at your option) any later version.
10 ;; SXEmacs is distributed in the hope that it will be useful,
11 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ;; GNU General Public License for more details.
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
18 ;;; 87.6.9 created by K.handa
19 ;;; (Note: following comment obsolete -- mrb)
21 ;;; IMPORTANT NOTICE -- DON'T EDIT THIS FILE!!!
22 ;;; Keep this file unmodified for further patches being applied successfully.
23 ;;; All language specific basic environments are defined here.
24 ;;; By default, Japanese is set as the primary environment.
25 ;;; You can change primary environment in `./lisp/site-init.el by
26 ;;; `set-primary-environment'. For instance,
27 ;;; (set-primary-environment 'chinese)
28 ;;; makes Chinese the primary environment.
29 ;;; If you are still not satisfied with the settings, you can
30 ;;; override them after the above line. For instance,
31 ;;; (set-default-buffer-file-coding-system 'big5)
32 ;;; makes big5 be used for file I/O by default.
33 ;;; If you are not satisfied with other default settings in this file,
34 ;;; override any of them also in `./lisp/site-init.el'. For instance,
35 ;;; (define-program-coding-system nil ".*mail.*" 'iso-8859-1)
36 ;;; makes the coding-system 'iso-8859-1 be used in mail.
39 ;;;; GLOBAL ENVIRONMENT SETUP
43 ;; (setq language-environment-list
44 ;; (sort (language-environment-list) 'string-lessp))
46 ;; MULE keymap codes were moved to mule-cmds.el.
48 ;; Alternative key definitions
49 ;; Original mapping will be altered by set-keyboard-coding-system.
50 (define-key global-map [(meta \#)] 'ispell-word) ;originally "$"
51 ;; (define-key global-map [(meta {)] 'insert-parentheses) ;originally "("
53 ;; Following line isn't mule-specific --mrb
54 ;;(setq-default modeline-buffer-identification '("XEmacs: %17b"))
56 ;; MULE keymap codes were moved to mule-cmds.el.
58 ;; (define-key help-map "T" 'help-with-tutorial-for-mule)
60 ;; (defvar help-with-tutorial-language-alist
61 ;; '(("Japanese" . ".jp")
65 ;(defun help-with-tutorial-for-mule (language)
66 ; "Select the Mule learn-by-doing tutorial."
67 ; (interactive (list (let ((completion-ignore-case t)
71 ; help-with-tutorial-language-alist))))
72 ; (setq language (cdr (assoc language help-with-tutorial-language-alist)))
73 ; (help-with-tutorial (concat "mule/TUTORIAL" (or language ""))))
75 (defvar auto-language-alist
76 '(("^ja" . "Japanese")
77 ("^zh_.*.GB.*" . "Chinese-GB")
78 ("^zh_.*.BIG5.*" . "Chinese-BIG5")
80 "Alist of LANG patterns vs. corresponding language environment.
81 Each element looks like (REGEXP . LANGUAGE-ENVIRONMENT).
82 It the value of the environment variable LANG matches the regexp REGEXP,
83 then `set-language-environment' is called with LANGUAGE-ENVIRONMENT.")
86 "Initialize MULE environment at startup. Don't call this."
87 (let ((lang (or (getenv "LC_ALL") (getenv "LC_MESSAGES") (getenv "LANG"))))
88 (unless (or (null lang) (string-equal "C" lang))
89 (let ((case-fold-search t))
90 (loop for elt in auto-language-alist
91 do (if (string-match (car elt) lang)
93 (setq lang (substring lang 0 (match-end 0)))
94 (set-language-environment (cdr elt))
96 ;; Load a (localizable) locale-specific init file, if it exists.
97 (load (format "%s%s/locale-start"
98 (locate-data-directory "start-files")
101 (when current-language-environment
102 ;; Translate remaining args on command line using file-name-coding-system
103 (loop for arg in-ref command-line-args-left do
104 (setf arg (decode-coding-string arg file-name-coding-system)))
106 ;; rman seems to be incompatible with encoded text
107 (and-boundp 'Manual-use-rosetta-man
108 (setq Manual-use-rosetta-man nil))
110 ;; Make sure ls -l output is readable by dired and encoded using
111 ;; file-name-coding-system
115 (make-local-variable 'process-environment)
116 (with-fboundp 'setenv
117 (setenv "LC_MESSAGES" "C")
118 (setenv "LC_TIME" "C")))))
120 ;; Register available input methods by loading LEIM list file.
121 (load "leim-list.el" 'noerror 'nomessage 'nosuffix)
124 (add-hook 'before-init-hook 'init-mule)
126 ;;;;; Enable the tm package by default
127 ;;(defun init-mule-tm ()
128 ;; "Load MIME (TM) support for GNUS, VM, MH-E, and RMAIL."
129 ;; (load "mime-setup"))
131 ;;(add-hook 'after-init-hook 'init-mule-tm)
133 ;;; mule-init.el ends here