diff options
| author | Dave Love | 2002-09-09 22:49:04 +0000 |
|---|---|---|
| committer | Dave Love | 2002-09-09 22:49:04 +0000 |
| commit | d398dba6b9bc0ab05278602d0331a3271922bc79 (patch) | |
| tree | 373a6a9bb931a6cf89ee794361aec45412ebdd72 | |
| parent | b0628208cbc52cc19ae9610f08b596ddc28d99a6 (diff) | |
| download | emacs-d398dba6b9bc0ab05278602d0331a3271922bc79.tar.gz emacs-d398dba6b9bc0ab05278602d0331a3271922bc79.zip | |
(charset): New widget.
(language-info-custom-alist): Use it.
(default-input-method): Modify :type.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/international/mule-cmds.el | 73 |
2 files changed, 43 insertions, 40 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fecd8419d17..8446e6466c8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2002-09-09 Dave Love <d.love@dl.ac.uk> | ||
| 2 | |||
| 3 | * wid-edit.el (widget-string-complete): New. | ||
| 4 | (widget-coding-system-prompt-value-history): Deleted. | ||
| 5 | (coding-system): Use coding-system-value-history. | ||
| 6 | |||
| 7 | * international/mule-cmds.el (charset): New widget. | ||
| 8 | (language-info-custom-alist): Use it. | ||
| 9 | (default-input-method): Modify :type. | ||
| 10 | |||
| 1 | 2002-09-08 Dave Love <fx@gnu.org> | 11 | 2002-09-08 Dave Love <fx@gnu.org> |
| 2 | 12 | ||
| 3 | * language/ind-util.el (ucs-devanagari-to-is13194-alist) | 13 | * language/ind-util.el (ucs-devanagari-to-is13194-alist) |
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index f9a1cf45748..ab07b545b53 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. | 3 | ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. |
| 4 | ;; Licensed to the Free Software Foundation. | 4 | ;; Licensed to the Free Software Foundation. |
| 5 | ;; Copyright (C) 2000, 2001 Free Software Foundation, Inc. | 5 | ;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. |
| 6 | ;; Copyright (C) 2001, 2002 | 6 | ;; Copyright (C) 2001, 2002 |
| 7 | ;; National Institute of Advanced Industrial Science and Technology (AIST) | 7 | ;; National Institute of Advanced Industrial Science and Technology (AIST) |
| 8 | ;; Registration Number H13PRO009 | 8 | ;; Registration Number H13PRO009 |
| @@ -772,6 +772,19 @@ is nil. | |||
| 772 | but as non-ASCII characters in this language | 772 | but as non-ASCII characters in this language |
| 773 | environment.") | 773 | environment.") |
| 774 | 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 | |||
| 775 | (defcustom language-info-custom-alist nil | 788 | (defcustom language-info-custom-alist nil |
| 776 | "Customizations of language environment parameters. | 789 | "Customizations of language environment parameters. |
| 777 | Value is an alist with elements like those of `language-info-alist'. | 790 | Value is an alist with elements like those of `language-info-alist'. |
| @@ -791,53 +804,29 @@ Setting this variable directly does not take effect. See | |||
| 791 | (set-language-info-alist (car elt) (cdr elt))) | 804 | (set-language-info-alist (car elt) (cdr elt))) |
| 792 | ;; re-set the environment in case its parameters changed | 805 | ;; re-set the environment in case its parameters changed |
| 793 | (set-language-environment current-language-environment)) | 806 | (set-language-environment current-language-environment)) |
| 794 | :type '(alist | 807 | :type `(alist |
| 795 | :key-type | 808 | :key-type (string :tag "Language environment" |
| 796 | (string :tag "Language environment" | 809 | :completion-ignore-case t |
| 797 | :complete-function | 810 | :complete-function widget-string-complete |
| 798 | (lambda () | 811 | :completion-alist language-info-alist) |
| 799 | (interactive) | ||
| 800 | (let* ((prefix (buffer-substring-no-properties | ||
| 801 | (widget-field-start widget) (point))) | ||
| 802 | (completion-ignore-case t) | ||
| 803 | (completion (try-completion prefix | ||
| 804 | language-info-alist))) | ||
| 805 | (cond ((eq completion t) | ||
| 806 | (delete-region (widget-field-start widget) | ||
| 807 | (widget-field-end widget)) | ||
| 808 | (insert-and-inherit | ||
| 809 | (car (assoc-ignore-case prefix | ||
| 810 | language-info-alist))) | ||
| 811 | (message "Only match")) | ||
| 812 | ((null completion) | ||
| 813 | (error "No match")) | ||
| 814 | ((not (eq t (compare-strings prefix nil nil | ||
| 815 | completion nil nil | ||
| 816 | t))) | ||
| 817 | (delete-region (widget-field-start widget) | ||
| 818 | (widget-field-end widget)) | ||
| 819 | (insert-and-inherit completion)) | ||
| 820 | (t | ||
| 821 | (message "Making completion list...") | ||
| 822 | (with-output-to-temp-buffer "*Completions*" | ||
| 823 | (display-completion-list | ||
| 824 | (all-completions prefix language-info-alist | ||
| 825 | nil))) | ||
| 826 | (message "Making completion list...done")))))) | ||
| 827 | :value-type | 812 | :value-type |
| 828 | (alist :key-type symbol | 813 | (alist :key-type symbol |
| 829 | :options ((documentation string) | 814 | :options ((documentation string) |
| 830 | (charset (repeat symbol)) | 815 | (charset (repeat charset)) |
| 831 | (sample-text string) | 816 | (sample-text string) |
| 832 | (setup-function function) | 817 | (setup-function function) |
| 833 | (exit-function function) | 818 | (exit-function function) |
| 834 | (coding-system (repeat coding-system)) | 819 | (coding-system (repeat coding-system)) |
| 835 | (coding-priority (repeat coding-system)) | 820 | (coding-priority (repeat coding-system)) |
| 836 | (nonascii-translation symbol) | 821 | (nonascii-translation charset) |
| 837 | (input-method string) | 822 | (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)) | ||
| 838 | (features (repeat symbol)) | 828 | (features (repeat symbol)) |
| 839 | (unibyte-display coding-system) | 829 | (unibyte-display coding-system))))) |
| 840 | (unibyte-syntax string))))) | ||
| 841 | 830 | ||
| 842 | (defun get-language-info (lang-env key) | 831 | (defun get-language-info (lang-env key) |
| 843 | "Return information listed under KEY for language environment LANG-ENV. | 832 | "Return information listed under KEY for language environment LANG-ENV. |
| @@ -1010,7 +999,11 @@ This is the input method activated automatically by the command | |||
| 1010 | `toggle-input-method' (\\[toggle-input-method])." | 999 | `toggle-input-method' (\\[toggle-input-method])." |
| 1011 | :link '(custom-manual "(emacs)Input Methods") | 1000 | :link '(custom-manual "(emacs)Input Methods") |
| 1012 | :group 'mule | 1001 | :group 'mule |
| 1013 | :type '(choice (const nil) string) | 1002 | :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)) | ||
| 1014 | :set-after '(current-language-environment)) | 1007 | :set-after '(current-language-environment)) |
| 1015 | 1008 | ||
| 1016 | (put 'input-method-function 'permanent-local t) | 1009 | (put 'input-method-function 'permanent-local t) |