2 |
|
|
3 |
;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. |
;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. |
4 |
;; Licensed to the Free Software Foundation. |
;; Licensed to the Free Software Foundation. |
5 |
;; Copyright (C) 2000, 2001 Free Software Foundation, Inc. |
;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. |
6 |
;; Copyright (C) 2001, 2002 |
;; Copyright (C) 2001, 2002 |
7 |
;; National Institute of Advanced Industrial Science and Technology (AIST) |
;; National Institute of Advanced Industrial Science and Technology (AIST) |
8 |
;; Registration Number H13PRO009 |
;; Registration Number H13PRO009 |
772 |
but as non-ASCII characters in this language |
but as non-ASCII characters in this language |
773 |
environment.") |
environment.") |
774 |
|
|
775 |
|
(define-widget 'charset 'symbol |
776 |
|
:complete-function (lambda () |
777 |
|
(interactive) |
778 |
|
(lisp-complete-symbol 'charsetp)) |
779 |
|
:completion-ignore-case t |
780 |
|
:value 'ascii |
781 |
|
:validate (lambda (widget) |
782 |
|
(unless (charsetp (widget-value widget)) |
783 |
|
(widget-put widget :error (format "Invalid charset: %S" |
784 |
|
(widget-value widget))) |
785 |
|
widget)) |
786 |
|
:prompt-history 'charset-history) |
787 |
|
|
788 |
(defcustom language-info-custom-alist nil |
(defcustom language-info-custom-alist nil |
789 |
"Customizations of language environment parameters. |
"Customizations of language environment parameters. |
790 |
Value is an alist with elements like those of `language-info-alist'. |
Value is an alist with elements like those of `language-info-alist'. |
804 |
(set-language-info-alist (car elt) (cdr elt))) |
(set-language-info-alist (car elt) (cdr elt))) |
805 |
;; re-set the environment in case its parameters changed |
;; re-set the environment in case its parameters changed |
806 |
(set-language-environment current-language-environment)) |
(set-language-environment current-language-environment)) |
807 |
:type '(alist |
:type `(alist |
808 |
:key-type |
:key-type (string :tag "Language environment" |
809 |
(string :tag "Language environment" |
:completion-ignore-case t |
810 |
:complete-function |
:complete-function widget-string-complete |
811 |
(lambda () |
:completion-alist language-info-alist) |
|
(interactive) |
|
|
(let* ((prefix (buffer-substring-no-properties |
|
|
(widget-field-start widget) (point))) |
|
|
(completion-ignore-case t) |
|
|
(completion (try-completion prefix |
|
|
language-info-alist))) |
|
|
(cond ((eq completion t) |
|
|
(delete-region (widget-field-start widget) |
|
|
(widget-field-end widget)) |
|
|
(insert-and-inherit |
|
|
(car (assoc-ignore-case prefix |
|
|
language-info-alist))) |
|
|
(message "Only match")) |
|
|
((null completion) |
|
|
(error "No match")) |
|
|
((not (eq t (compare-strings prefix nil nil |
|
|
completion nil nil |
|
|
t))) |
|
|
(delete-region (widget-field-start widget) |
|
|
(widget-field-end widget)) |
|
|
(insert-and-inherit completion)) |
|
|
(t |
|
|
(message "Making completion list...") |
|
|
(with-output-to-temp-buffer "*Completions*" |
|
|
(display-completion-list |
|
|
(all-completions prefix language-info-alist |
|
|
nil))) |
|
|
(message "Making completion list...done")))))) |
|
812 |
:value-type |
:value-type |
813 |
(alist :key-type symbol |
(alist :key-type symbol |
814 |
:options ((documentation string) |
:options ((documentation string) |
815 |
(charset (repeat symbol)) |
(charset (repeat charset)) |
816 |
(sample-text string) |
(sample-text string) |
817 |
(setup-function function) |
(setup-function function) |
818 |
(exit-function function) |
(exit-function function) |
819 |
(coding-system (repeat coding-system)) |
(coding-system (repeat coding-system)) |
820 |
(coding-priority (repeat coding-system)) |
(coding-priority (repeat coding-system)) |
821 |
(nonascii-translation symbol) |
(nonascii-translation charset) |
822 |
(input-method string) |
(input-method |
823 |
|
(string |
824 |
|
:completion-ignore-case t |
825 |
|
:complete-function widget-string-complete |
826 |
|
:completion-alist input-method-alist |
827 |
|
:prompt-history input-method-history)) |
828 |
(features (repeat symbol)) |
(features (repeat symbol)) |
829 |
(unibyte-display coding-system) |
(unibyte-display coding-system))))) |
|
(unibyte-syntax string))))) |
|
830 |
|
|
831 |
(defun get-language-info (lang-env key) |
(defun get-language-info (lang-env key) |
832 |
"Return information listed under KEY for language environment LANG-ENV. |
"Return information listed under KEY for language environment LANG-ENV. |
999 |
`toggle-input-method' (\\[toggle-input-method])." |
`toggle-input-method' (\\[toggle-input-method])." |
1000 |
:link '(custom-manual "(emacs)Input Methods") |
:link '(custom-manual "(emacs)Input Methods") |
1001 |
:group 'mule |
:group 'mule |
1002 |
:type '(choice (const nil) string) |
:type '(choice (const nil) (string |
1003 |
|
:completion-ignore-case t |
1004 |
|
:complete-function widget-string-complete |
1005 |
|
:completion-alist input-method-alist |
1006 |
|
:prompt-history input-method-history)) |
1007 |
:set-after '(current-language-environment)) |
:set-after '(current-language-environment)) |
1008 |
|
|
1009 |
(put 'input-method-function 'permanent-local t) |
(put 'input-method-function 'permanent-local t) |