Mercurial > emacs
comparison leim/quail/uni-input.el @ 89983:0796fc36c2bd
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-43
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-553
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-557
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-558
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-559
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-561
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-30
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Tue, 21 Sep 2004 09:34:12 +0000 |
parents | 68c22ea6027c 5afba9a35578 |
children | 0b158db81c28 |
comparison
equal
deleted
inserted
replaced
89982:56440e073a4d | 89983:0796fc36c2bd |
---|---|
38 | 38 |
39 ;;; Code: | 39 ;;; Code: |
40 | 40 |
41 (require 'quail) | 41 (require 'quail) |
42 | 42 |
43 (defun ucs-input-insert-char (char) | |
44 (insert char) | |
45 (move-overlay quail-overlay (overlay-start quail-overlay) (point))) | |
46 | |
43 (defun ucs-input-method (key) | 47 (defun ucs-input-method (key) |
44 (if (or buffer-read-only | 48 (if (or buffer-read-only |
45 (and (/= key ?U) (/= key ?u))) | 49 (and (/= key ?U) (/= key ?u))) |
46 (list key) | 50 (list key) |
47 (quail-setup-overlays nil) | 51 (quail-setup-overlays nil) |
48 (let ((current-prefix-arg) | 52 (ucs-input-insert-char key) |
49 (last-command-char key)) | |
50 (call-interactively 'self-insert-command)) | |
51 (let ((modified-p (buffer-modified-p)) | 53 (let ((modified-p (buffer-modified-p)) |
52 (buffer-undo-list t) | 54 (buffer-undo-list t) |
53 (input-method-function nil) | 55 (input-method-function nil) |
54 (echo-keystrokes 0) | 56 (echo-keystrokes 0) |
55 (help-char nil) | 57 (help-char nil) |
66 (setq key (aref seq 0)) | 68 (setq key (aref seq 0)) |
67 (memq key '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?a | 69 (memq key '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?a |
68 ?b ?c ?d ?e ?f ?A ?B ?C ?D ?E ?F))) | 70 ?b ?c ?d ?e ?f ?A ?B ?C ?D ?E ?F))) |
69 (progn | 71 (progn |
70 (push key events) | 72 (push key events) |
71 (let ((last-command-char key) | 73 (ucs-input-insert-char key)) |
72 (current-prefix-arg)) | |
73 (call-interactively 'self-insert-command))) | |
74 (let ((last-command-char key) | 74 (let ((last-command-char key) |
75 (current-prefix-arg)) | 75 (current-prefix-arg)) |
76 (condition-case nil | 76 (condition-case nil |
77 (call-interactively (key-binding seq)))) | 77 (call-interactively (key-binding seq)))) |
78 (quail-delete-region) | 78 (quail-delete-region) |
96 `input-method-function' is bound to the function `ucs-input-method'." | 96 `input-method-function' is bound to the function `ucs-input-method'." |
97 (if (and arg | 97 (if (and arg |
98 (< (prefix-numeric-value arg) 0)) | 98 (< (prefix-numeric-value arg) 0)) |
99 (unwind-protect | 99 (unwind-protect |
100 (progn | 100 (progn |
101 (quail-hide-guidance-buf) | 101 (quail-hide-guidance) |
102 (quail-delete-overlays) | 102 (quail-delete-overlays) |
103 (setq describe-current-input-method-function nil)) | 103 (setq describe-current-input-method-function nil)) |
104 (kill-local-variable 'input-method-function)) | 104 (kill-local-variable 'input-method-function)) |
105 (setq inactivate-current-input-method-function 'ucs-input-inactivate) | 105 (setq inactivate-current-input-method-function 'ucs-input-inactivate) |
106 (setq describe-current-input-method-function 'ucs-input-help) | 106 (setq describe-current-input-method-function 'ucs-input-help) |
122 (princ "\ | 122 (princ "\ |
123 Input method: ucs (mode line indicator:U) | 123 Input method: ucs (mode line indicator:U) |
124 | 124 |
125 Input as Unicode: U<hex> or u<hex>, where <hex> is a four-digit hex number."))) | 125 Input as Unicode: U<hex> or u<hex>, where <hex> is a four-digit hex number."))) |
126 | 126 |
127 (register-input-method "ucs" "UTF-8" 'ucs-input-activate "U+" | 127 ;; The file ../leim-ext.el contains the following call. |
128 "Unicode input as hex in the form Uxxxx.") | 128 ;; (register-input-method "ucs" "UTF-8" 'ucs-input-activate "U+" |
129 ;; "Unicode input as hex in the form Uxxxx.") | |
129 | 130 |
130 (provide 'uni-input) | 131 (provide 'uni-input) |
131 | 132 |
132 ;;; arch-tag: e0d91c7c-19a1-43d3-8f2b-28c0e031efaa | 133 ;;; arch-tag: e0d91c7c-19a1-43d3-8f2b-28c0e031efaa |
133 ;;; uni-input.el ends here | 134 ;;; uni-input.el ends here |