Mercurial > emacs
changeset 48808:3928ea1dee22
(current-language-environment-custom-type): New fun.
(set-language-info): Use it.
(current-language-environment): Fix custom type.
author | Markus Rost <rost@math.uni-bielefeld.de> |
---|---|
date | Wed, 11 Dec 2002 21:29:14 +0000 |
parents | 54fb272217f5 |
children | 31f6d22dc374 |
files | lisp/international/mule-cmds.el |
diffstat | 1 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/international/mule-cmds.el Wed Dec 11 21:21:17 2002 +0000 +++ b/lisp/international/mule-cmds.el Wed Dec 11 21:29:14 2002 +0000 @@ -985,7 +985,9 @@ (progn (setq key-slot (list key)) (setcdr lang-slot (cons key-slot (cdr lang-slot))))) - (setcdr key-slot (purecopy info)))) + (setcdr key-slot (purecopy info)) + (put 'current-language-environment 'custom-type + (current-language-environment-custom-type)))) (defun set-language-info-alist (lang-env alist &optional parents) "Store ALIST as the definition of language environment LANG-ENV. @@ -1485,6 +1487,13 @@ (customize-mark-as-set 'current-language-environment)) (error "Bogus calling sequence")))) +(defun current-language-environment-custom-type () + "Return a custom type for `current-language-environment'. +This is based on `language-info-alist'." + (cons 'choice (mapcar (lambda (lang) + (list 'const (car lang))) + language-info-alist))) + (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 @@ -1498,9 +1507,8 @@ current-language-environment) language-info-alist)) "English")) - :type (cons 'choice (mapcar (lambda (lang) - (list 'const (car lang))) - language-info-alist)) + ;; a better custom type will be set with `set-language-info'. + :type 'string :initialize 'custom-initialize-default :group 'mule)