annotate lisp/mule/mule-init.el @ 392:1f50e6fe4f3f r21-2-11

Import from CVS: tag r21-2-11
author cvs
date Mon, 13 Aug 2007 11:10:50 +0200
parents 4f79e16b1112
children a4f53d9b3154 74fd4e045ea6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
333
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
1 ;; Mule default configuration file
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
2
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
3 ;; This file is part of XEmacs.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
4
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
5 ;; XEmacs is free software; you can redistribute it and/or modify it
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
6 ;; under the terms of the GNU General Public License as published by
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
7 ;; the Free Software Foundation; either version 2, or (at your option)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
8 ;; any later version.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
9
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
10 ;; XEmacs is distributed in the hope that it will be useful, but
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
11 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
12 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
13 ;; General Public License for more details.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
14
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
15 ;; You should have received a copy of the GNU General Public License
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
16 ;; along with XEmacs; see the file COPYING. If not, write to the
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
17 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
18 ;; Boston, MA 02111-1307, USA.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
19
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
20 ;;; 87.6.9 created by K.handa
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
21 ;;; (Note: following comment obsolete -- mrb)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
22
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
23 ;;; IMPORTANT NOTICE -- DON'T EDIT THIS FILE!!!
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
24 ;;; Keep this file unmodified for further patches being applied successfully.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
25 ;;; All language specific basic environments are defined here.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
26 ;;; By default, Japanese is set as the primary environment.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
27 ;;; You can change primary environment in `./lisp/site-init.el by
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
28 ;;; `set-primary-environment'. For instance,
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
29 ;;; (set-primary-environment 'chinese)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
30 ;;; makes Chinese the primary environment.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
31 ;;; If you are still not satisfied with the settings, you can
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
32 ;;; override them after the above line. For instance,
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
33 ;;; (set-default-buffer-file-coding-system 'big5)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
34 ;;; makes big5 be used for file I/O by default.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
35 ;;; If you are not satisfied with other default settings in this file,
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
36 ;;; override any of them also in `./lisp/site-init.el'. For instance,
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
37 ;;; (define-program-coding-system nil ".*mail.*" 'iso-8859-1)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
38 ;;; makes the coding-system 'iso-8859-1 be used in mail.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
39
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
40
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
41 ;;;; GLOBAL ENVIRONMENT SETUP
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
42 (require 'cl)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
43
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
44
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
45 ;; (setq language-environment-list
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
46 ;; (sort (language-environment-list) 'string-lessp))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
47
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
48 ;; MULE keymap codes were moved to mule-cmds.el.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
49
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
50 ;; Alternative key definitions
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
51 ;; Original mapping will be altered by set-keyboard-coding-system.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
52 (define-key global-map [(meta \#)] 'ispell-word) ;originally "$"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
53 ;; (define-key global-map [(meta {)] 'insert-parentheses) ;originally "("
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
54
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
55 ;; Following line isn't mule-specific --mrb
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
56 ;;(setq-default modeline-buffer-identification '("XEmacs: %17b"))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
57
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
58 ;; MULE keymap codes were moved to mule-cmds.el.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
59
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
60 ;; (define-key help-map "T" 'help-with-tutorial-for-mule)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
61
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
62 ;; (defvar help-with-tutorial-language-alist
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
63 ;; '(("Japanese" . ".jp")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
64 ;; ("Korean" . ".kr")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
65 ;; ("Thai" . ".th")))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
66
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
67 ;(defun help-with-tutorial-for-mule (language)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
68 ; "Select the Mule learn-by-doing tutorial."
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
69 ; (interactive (list (let ((completion-ignore-case t)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
70 ; lang)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
71 ; (completing-read
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
72 ; "Language: "
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
73 ; help-with-tutorial-language-alist))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
74 ; (setq language (cdr (assoc language help-with-tutorial-language-alist)))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
75 ; (help-with-tutorial (concat "mule/TUTORIAL" (or language ""))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
76
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
77 (defvar auto-language-alist
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
78 '(("^ja" . "Japanese")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
79 ("^zh" . "Chinese")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
80 ("^ko" . "Korean"))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
81 "Alist of LANG patterns vs. corresponding language environment.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
82 Each element looks like (REGEXP . LANGUAGE-ENVIRONMENT).
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
83 It the value of the environment variable LANG matches the regexp REGEXP,
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
84 then `set-language-environment' is called with LANGUAGE-ENVIRONMENT.")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
85
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
86 (defun init-mule ()
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
87 "Initialize MULE environment at startup. Don't call this."
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
88 (let ((lang (or (getenv "LC_ALL") (getenv "LC_MESSAGES") (getenv "LANG"))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
89 (unless (or (null lang) (string-equal "C" lang))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
90 (let ((case-fold-search t))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
91 (loop for elt in auto-language-alist
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
92 if (string-match (car elt) lang)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
93 return (progn
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
94 (setq lang (substring lang 0 (match-end 0)))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
95 (set-language-environment (cdr elt))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
96 )))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
97 ;; Load a (localizable) locale-specific init file, if it exists.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
98 (load (format "%s%s/locale-start"
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
99 (locate-data-directory "start-files")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
100 lang) t t)))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
101
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
102 (when current-language-environment
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
103 ;; Translate remaining args on command line using file-name-coding-system
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
104 (loop for arg in-ref command-line-args-left do
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
105 (setf arg (decode-coding-string arg file-name-coding-system)))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
106
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
107 ;; rman seems to be incompatible with encoded text
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
108 (setq Manual-use-rosetta-man nil)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
109
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
110 ;; Make sure ls -l output is readable by dired and encoded using
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
111 ;; file-name-coding-system
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
112 (add-hook
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
113 'dired-mode-hook
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
114 (lambda ()
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
115 (make-local-variable 'process-environment)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
116 (setenv "LC_MESSAGES" "C")
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
117 (setenv "LC_TIME" "C"))))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
118
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
119 ;; Register avairable input methods by loading LEIM list file.
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
120 (load "leim-list.el" 'noerror 'nomessage 'nosuffix)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
121 )
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
122
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
123 (add-hook 'before-init-hook 'init-mule)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
124
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
125 ;;;;; Enable the tm package by default
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
126 ;;(defun init-mule-tm ()
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
127 ;; "Load MIME (TM) support for GNUS, VM, MH-E, and RMAIL."
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
128 ;; (load "mime-setup"))
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
129
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
130 ;;(add-hook 'after-init-hook 'init-mule-tm)
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
131
4f79e16b1112 Import from CVS: tag r21-0-64
cvs
parents:
diff changeset
132 ;;; mule-init.el ends here