]> code.delx.au - gnu-emacs/blobdiff - leim/quail/uni-input.el
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-25
[gnu-emacs] / leim / quail / uni-input.el
index 49a6f840cfa8c17041dcb463303779a31521a36d..41c5dd785cd0a659fa2f11f41b3361c6528a8189 100644 (file)
 
 (require 'quail)
 
 
 (require 'quail)
 
+(defun ucs-input-insert-char (char)
+  (insert char)
+  (move-overlay quail-overlay (overlay-start quail-overlay) (point)))
+
 (defun ucs-input-method (key)
   (if (or buffer-read-only
          (and (/= key ?U) (/= key ?u)))
       (list key)
     (quail-setup-overlays nil)
 (defun ucs-input-method (key)
   (if (or buffer-read-only
          (and (/= key ?U) (/= key ?u)))
       (list key)
     (quail-setup-overlays nil)
-    (let ((current-prefix-arg)
-         (last-command-char key))
-      (call-interactively 'self-insert-command))
+    (ucs-input-insert-char key)
     (let ((modified-p (buffer-modified-p))
          (buffer-undo-list t)
          (input-method-function nil)
     (let ((modified-p (buffer-modified-p))
          (buffer-undo-list t)
          (input-method-function nil)
                                          ?b ?c ?d ?e ?f ?A ?B ?C ?D ?E ?F)))
                      (progn
                        (push key events)
                                          ?b ?c ?d ?e ?f ?A ?B ?C ?D ?E ?F)))
                      (progn
                        (push key events)
-                       (let ((last-command-char key)
-                             (current-prefix-arg))
-                         (call-interactively 'self-insert-command)))
+                       (ucs-input-insert-char key))
                    (let ((last-command-char key)
                          (current-prefix-arg))
                    (let ((last-command-char key)
                          (current-prefix-arg))
-                     (condition-case nil
-                         (call-interactively (key-binding seq))))
+                     (condition-case err
+                         (call-interactively (key-binding seq))
+                       (quail-error (message "%s" (cdr err)) (beep))))
                    (quail-delete-region)
                    (throw 'non-digit (append (reverse events)
                                              (listify-key-sequence seq))))))
                    (quail-delete-region)
                    (throw 'non-digit (append (reverse events)
                                              (listify-key-sequence seq))))))
@@ -98,7 +99,7 @@ While this input method is active, the variable
          (< (prefix-numeric-value arg) 0))
       (unwind-protect
          (progn
          (< (prefix-numeric-value arg) 0))
       (unwind-protect
          (progn
-           (quail-hide-guidance-buf)
+           (quail-hide-guidance)
            (quail-delete-overlays)
            (setq describe-current-input-method-function nil))
        (kill-local-variable 'input-method-function))
            (quail-delete-overlays)
            (setq describe-current-input-method-function nil))
        (kill-local-variable 'input-method-function))
@@ -124,8 +125,9 @@ Input method: ucs (mode line indicator:U)
 
 Input as Unicode: U<hex> or u<hex>, where <hex> is a four-digit hex number.")))
 
 
 Input as Unicode: U<hex> or u<hex>, where <hex> is a four-digit hex number.")))
 
-(register-input-method "ucs" "UTF-8" 'ucs-input-activate "U+"
-                      "Unicode input as hex in the form Uxxxx.")
+;; The file ../leim-ext.el contains the following call.
+;; (register-input-method "ucs" "UTF-8" 'ucs-input-activate "U+"
+;;                    "Unicode input as hex in the form Uxxxx.")
 
 (provide 'uni-input)
 
 
 (provide 'uni-input)