comparison lisp/international/mule-cmds.el @ 90729:6588c6259dfb

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 545-562) - Update from CVS - Update from erc--emacs--22 - Merge from gnus--rel--5.10 - erc-iswitchb: Temporarily enable iswitchb mode * gnus--rel--5.10 (patch 172-176) - Merge from emacs--devo--0 - Update from CVS - Update from CVS: lisp/legacy-gnus-agent.el: Add Copyright notice. Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-156
author Miles Bader <miles@gnu.org>
date Sat, 16 Dec 2006 01:29:26 +0000
parents 4bcfe4827e45 2408d46ef69e
children bc10a33dd40b
comparison
equal deleted inserted replaced
90728:a65a92d83186 90729:6588c6259dfb
1 ;;; mule-cmds.el --- commands for mulitilingual environment -*-coding: iso-2022-7bit -*- 1 ;;; mule-cmds.el --- commands for mulitilingual environment -*-coding: iso-2022-7bit -*-
2 2
3 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 3 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 ;; Free Software Foundation, Inc. 4 ;; 2006 Free Software Foundation, Inc.
5 ;; Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 5 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
6 ;; 2005, 2006
6 ;; National Institute of Advanced Industrial Science and Technology (AIST) 7 ;; National Institute of Advanced Industrial Science and Technology (AIST)
7 ;; Registration Number H14PRO021 8 ;; Registration Number H14PRO021
8 ;; Copyright (C) 2003 9 ;; Copyright (C) 2003
9 ;; National Institute of Advanced Industrial Science and Technology (AIST) 10 ;; National Institute of Advanced Industrial Science and Technology (AIST)
10 ;; Registration Number H13PRO009 11 ;; Registration Number H13PRO009
839 (not (listp default-coding-system))) 840 (not (listp default-coding-system)))
840 (setq default-coding-system (list default-coding-system))) 841 (setq default-coding-system (list default-coding-system)))
841 842
842 (let ((no-other-defaults nil) 843 (let ((no-other-defaults nil)
843 auto-cs) 844 auto-cs)
844 (unless (or (stringp from) find-file-literally) 845 (unless (or (stringp from) find-file-literally)
845 ;; Find an auto-coding that is specified for the the current 846 ;; Find an auto-coding that is specified for the the current
846 ;; buffer and file from the region FROM and TO. 847 ;; buffer and file from the region FROM and TO.
847 (save-excursion 848 (save-excursion
848 (save-restriction 849 (save-restriction
849 (widen) 850 (widen)
901 (let ((base (coding-system-base default-buffer-file-coding-system))) 902 (let ((base (coding-system-base default-buffer-file-coding-system)))
902 (or (eq base 'undecided) 903 (or (eq base 'undecided)
903 (rassq base default-coding-system) 904 (rassq base default-coding-system)
904 (setq default-coding-system 905 (setq default-coding-system
905 (append default-coding-system 906 (append default-coding-system
906 (list (cons default-buffer-file-coding-system 907 (list (cons default-buffer-file-coding-system
907 base))))))) 908 base)))))))
908 909
909 ;; If the most preferred coding system has the property mime-charset, 910 ;; If the most preferred coding system has the property mime-charset,
910 ;; append it to the defaults. 911 ;; append it to the defaults.
911 (let ((preferred (coding-system-priority-list t)) 912 (let ((preferred (coding-system-priority-list t))
926 ;; default-buffer-file-coding-system. 927 ;; default-buffer-file-coding-system.
927 (if default-coding-system 928 (if default-coding-system
928 (let ((default-eol-type (coding-system-eol-type 929 (let ((default-eol-type (coding-system-eol-type
929 (caar default-coding-system)))) 930 (caar default-coding-system))))
930 (if (and (vectorp default-eol-type) buffer-file-coding-system) 931 (if (and (vectorp default-eol-type) buffer-file-coding-system)
931 (setq default-eol-type (coding-system-eol-type 932 (setq default-eol-type (coding-system-eol-type
932 buffer-file-coding-system))) 933 buffer-file-coding-system)))
933 (if (and (vectorp default-eol-type) default-buffer-file-coding-system) 934 (if (and (vectorp default-eol-type) default-buffer-file-coding-system)
934 (setq default-eol-type (coding-system-eol-type 935 (setq default-eol-type (coding-system-eol-type
935 default-buffer-file-coding-system))) 936 default-buffer-file-coding-system)))
936 (if (and default-eol-type (not (vectorp default-eol-type))) 937 (if (and default-eol-type (not (vectorp default-eol-type)))
937 (dolist (elt default-coding-system) 938 (dolist (elt default-coding-system)
938 (setcar elt (coding-system-change-eol-conversion 939 (setcar elt (coding-system-change-eol-conversion
939 (car elt) default-eol-type)))))) 940 (car elt) default-eol-type))))))
1199 (define-key-after setup-map (vector (intern lang-env)) 1200 (define-key-after setup-map (vector (intern lang-env))
1200 (cons lang-env 'setup-specified-language-environment) t) 1201 (cons lang-env 'setup-specified-language-environment) t)
1201 1202
1202 (dolist (elt alist) 1203 (dolist (elt alist)
1203 (set-language-info-internal lang-env (car elt) (cdr elt))) 1204 (set-language-info-internal lang-env (car elt) (cdr elt)))
1204 1205
1205 (if (equal lang-env current-language-environment) 1206 (if (equal lang-env current-language-environment)
1206 (set-language-environment lang-env)))) 1207 (set-language-environment lang-env))))
1207 1208
1208 (defun read-language-name (key prompt &optional default) 1209 (defun read-language-name (key prompt &optional default)
1209 "Read a language environment name which has information for KEY. 1210 "Read a language environment name which has information for KEY.
1322 (INPUT-METHOD LANGUAGE-ENV ACTIVATE-FUNC TITLE DESCRIPTION ARGS...) 1323 (INPUT-METHOD LANGUAGE-ENV ACTIVATE-FUNC TITLE DESCRIPTION ARGS...)
1323 See the function `register-input-method' for the meanings of the elements.") 1324 See the function `register-input-method' for the meanings of the elements.")
1324 1325
1325 (defun register-input-method (input-method lang-env &rest args) 1326 (defun register-input-method (input-method lang-env &rest args)
1326 "Register INPUT-METHOD as an input method for language environment LANG-ENV. 1327 "Register INPUT-METHOD as an input method for language environment LANG-ENV.
1328
1327 INPUT-METHOD and LANG-ENV are symbols or strings. 1329 INPUT-METHOD and LANG-ENV are symbols or strings.
1328
1329 The remaining arguments are:
1330 ACTIVATE-FUNC, TITLE, DESCRIPTION, and ARGS...
1331 ACTIVATE-FUNC is a function to call to activate this method. 1330 ACTIVATE-FUNC is a function to call to activate this method.
1332 TITLE is a string to show in the mode line when this method is active. 1331 TITLE is a string to show in the mode line when this method is active.
1333 DESCRIPTION is a string describing this method and what it is good for. 1332 DESCRIPTION is a string describing this method and what it is good for.
1334 The ARGS, if any, are passed as arguments to ACTIVATE-FUNC. 1333 The ARGS, if any, are passed as arguments to ACTIVATE-FUNC.
1335 All told, the arguments to ACTIVATE-FUNC are INPUT-METHOD and the ARGS. 1334 All told, the arguments to ACTIVATE-FUNC are INPUT-METHOD and the ARGS.
1343 parameter of `quail-define-package'. (If the values are different, the 1342 parameter of `quail-define-package'. (If the values are different, the
1344 string specified in this function takes precedence.) 1343 string specified in this function takes precedence.)
1345 1344
1346 The commands `describe-input-method' and `list-input-methods' need 1345 The commands `describe-input-method' and `list-input-methods' need
1347 these duplicated values to show some information about input methods 1346 these duplicated values to show some information about input methods
1348 without loading the relevant Quail packages." 1347 without loading the relevant Quail packages.
1348 \n(fn INPUT-METHOD LANG-ENV ACTIVATE-FUNC TITLE DESCRIPTION &rest ARGS)"
1349 (if (symbolp lang-env) 1349 (if (symbolp lang-env)
1350 (setq lang-env (symbol-name lang-env))) 1350 (setq lang-env (symbol-name lang-env)))
1351 (if (symbolp input-method) 1351 (if (symbolp input-method)
1352 (setq input-method (symbol-name input-method))) 1352 (setq input-method (symbol-name input-method)))
1353 (let ((info (cons lang-env args)) 1353 (let ((info (cons lang-env args))
2550 2550
2551 (when (and coding-system 2551 (when (and coding-system
2552 (not (coding-system-equal coding-system 2552 (not (coding-system-equal coding-system
2553 locale-coding-system))) 2553 locale-coding-system)))
2554 (prefer-coding-system coding-system) 2554 (prefer-coding-system coding-system)
2555 ;; Fixme: perhaps prefer-coding-system should set this too.
2556 ;; But it's not the time to do such a fundamental change.
2557 (setq default-sendmail-coding-system coding-system)
2555 (setq locale-coding-system coding-system)) 2558 (setq locale-coding-system coding-system))
2559
2556 (when (get-language-info current-language-environment 'coding-priority) 2560 (when (get-language-info current-language-environment 'coding-priority)
2557 (let ((codeset (locale-info 'codeset)) 2561 (let ((codeset (locale-info 'codeset))
2558 (coding-system (car (coding-system-priority-list)))) 2562 (coding-system (car (coding-system-priority-list))))
2559 (when codeset 2563 (when codeset
2560 (let ((cs (coding-system-aliases coding-system)) 2564 (let ((cs (coding-system-aliases coding-system))