]> git.eshelyaron.com Git - emacs.git/commitdiff
(quail-update-translation): Don't insert
authorKenichi Handa <handa@m17n.org>
Tue, 20 Apr 2004 07:06:58 +0000 (07:06 +0000)
committerKenichi Handa <handa@m17n.org>
Tue, 20 Apr 2004 07:06:58 +0000 (07:06 +0000)
such an unsupported multibyte char in a unibyte buffer.

lisp/international/quail.el

index 2f275a59dca2de586938e5b069930f94f40af941..cfd578fbc06bfdb99cd0265bc9244fc44bd14c26 100644 (file)
@@ -1524,6 +1524,28 @@ with more keys."
       (let (pos)
        (quail-delete-region)
        (setq pos (point))
+       (or enable-multibyte-characters
+           (let (char)
+             (if (stringp quail-current-str)
+                 (catch 'tag
+                   (mapc #'(lambda (ch)
+                             (when (/= (unibyte-char-to-multibyte
+                                        (multibyte-char-to-unibyte ch))
+                                       ch)
+                                 (setq char ch)
+                                 (throw 'tag nil)))
+                         quail-current-str))
+               (if (/= (unibyte-char-to-multibyte
+                        (multibyte-char-to-unibyte quail-current-str))
+                       quail-current-str)
+                   (setq char quail-current-str)))
+             (when char
+               (message "Can't input %c in the current unibyte buffer" char)
+               (ding)
+               (sit-for 2)
+               (message nil)
+               (setq quail-current-str nil)
+               (throw 'quail-tag nil))))
        (insert quail-current-str)
        (move-overlay quail-overlay pos (point))
        (if (overlayp quail-conv-overlay)