aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2002-06-24 19:26:00 +0000
committerDave Love2002-06-24 19:26:00 +0000
commitd6e5e4db6975d185cafb5ad13c6d8cafdcd99b23 (patch)
treec4565584c6f455257776cbaf775ae7047d145d22
parent4c327d315e2db518b728e2caa577764a68bf85ef (diff)
downloademacs-d6e5e4db6975d185cafb5ad13c6d8cafdcd99b23.tar.gz
emacs-d6e5e4db6975d185cafb5ad13c6d8cafdcd99b23.zip
(utf-8-ccl-encode): Deleted.
(ucs-input-method): Modified.
-rw-r--r--leim/quail/uni-input.el52
1 files changed, 9 insertions, 43 deletions
diff --git a/leim/quail/uni-input.el b/leim/quail/uni-input.el
index b89b9a613e6..4d013438ccb 100644
--- a/leim/quail/uni-input.el
+++ b/leim/quail/uni-input.el
@@ -1,6 +1,6 @@
1;;; uni-input.el --- Hex Unicode input method 1;;; uni-input.el --- Hex Unicode input method
2 2
3;; Copyright (C) 2001 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002 Free Software Foundation, Inc.
4 4
5;; Author: Dave Love <fx@gnu.org> 5;; Author: Dave Love <fx@gnu.org>
6;; Keywords: i18n 6;; Keywords: i18n
@@ -30,42 +30,13 @@
30;; This is not really a Quail method, but uses some Quail functions. 30;; This is not really a Quail method, but uses some Quail functions.
31;; There is probably A Better Way. 31;; There is probably A Better Way.
32 32
33;; Compare `ucs-insert', which explicitly inserts a unicoded character 33;; You can get a similar effect by using C-q with
34;; rather than supplying an input method. 34;; `read-quoted-char-radix' set to 16.
35 35
36;;; Code: 36;;; Code:
37 37
38(require 'quail) 38(require 'quail)
39 39
40;; Maybe stolen from Mule-UCS -- I don't remember.
41(define-ccl-program utf-8-ccl-encode
42 `(4 (if (r0 < ?\x80)
43 ((write r0))
44 (if (r0 < #x800)
45 ((write ((r0 >> 6) | ?\xC0))
46 (write ((r0 & ?\x3F) | ?\x80)))
47 (if (r0 < #x10000)
48 ((write ((r0 >> 12) | ?\xE0))
49 (write (((r0 >> 6) & ?\x3F) | ?\x80))
50 (write ((r0 & ?\x3F) | ?\x80)))
51 (if (r0 < #x200000)
52 ((write ((r0 >> 18) | ?\xF0))
53 (write (((r0 >> 12) & ?\3F) | ?\x80))
54 (write (((r0 >> 6) & ?\x3F) | ?\x80))
55 (write ((r0 & ?\x3F) | ?\x80)))
56 (if (r0 < #x4000000)
57 ((write ((r0 >> 24) | ?\xF8))
58 (write (((r0 >> 18) & ?\x3F) | ?\x80))
59 (write (((r0 >> 12) & ?\x3F) | ?\x80))
60 (write (((r0 >> 6) & ?\x3F) | ?\x80))
61 (write ((r0 & ?\x3f) | ?\x80)))
62 ((write ((r0 >> 30) | ?\xFC))
63 (write (((r0 >> 24) & ?\x3F) | ?\x80))
64 (write (((r0 >> 18) & ?\x3F) | ?\x80))
65 (write (((r0 >> 12) & ?\x3F) | ?\x80))
66 (write (((r0 >> 6) & ?\x3F) | ?\x80))
67 (write ((r0 & ?\x3f) | ?\x80))))))))))
68
69(defun ucs-input-method (key) 40(defun ucs-input-method (key)
70 (if (or buffer-read-only 41 (if (or buffer-read-only
71 (and (/= key ?U) (/= key ?u))) 42 (and (/= key ?U) (/= key ?u)))
@@ -91,7 +62,7 @@
91 (= 1 (length seq)) 62 (= 1 (length seq))
92 (setq key (aref seq 0)) 63 (setq key (aref seq 0))
93 (memq key '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?a 64 (memq key '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?a
94 ?b ?c ?d ?e ?f ?A ?B ?C ?D ?E ?F))) 65 ?b ?c ?d ?e ?f ?A ?B ?C ?D ?E ?F)))
95 (progn 66 (progn
96 (push key events) 67 (push key events)
97 (let ((last-command-char key) 68 (let ((last-command-char key)
@@ -105,16 +76,11 @@
105 (throw 'non-digit (append (reverse events) 76 (throw 'non-digit (append (reverse events)
106 (listify-key-sequence seq)))))) 77 (listify-key-sequence seq))))))
107 (quail-delete-region) 78 (quail-delete-region)
108 (let* ((n (string-to-number (apply 'string 79 (let ((n (string-to-number (apply 'string
109 (cdr (nreverse events))) 80 (cdr (nreverse events)))
110 16)) 81 16)))
111 (c (decode-char 'ucs n)) 82 (if (characterp n)
112 (status (make-vector 9 nil))) 83 (list n)))))
113 (if c
114 (list c)
115 (aset status 0 n)
116 (string-to-list (ccl-execute-on-string
117 'utf-8-ccl-encode status ""))))))
118 (quail-delete-overlays) 84 (quail-delete-overlays)
119 (set-buffer-modified-p modified-p) 85 (set-buffer-modified-p modified-p)
120 (run-hooks 'input-method-after-insert-chunk-hook))))) 86 (run-hooks 'input-method-after-insert-chunk-hook)))))