changeset 54997:21d4358a7507

(quail-update-translation): Don't insert such an unsupported multibyte char in a unibyte buffer.
author Kenichi Handa <handa@m17n.org>
date Tue, 20 Apr 2004 07:06:58 +0000
parents 38ad006eedb2
children a9da0517d087
files lisp/international/quail.el
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/quail.el	Tue Apr 20 00:26:36 2004 +0000
+++ b/lisp/international/quail.el	Tue Apr 20 07:06:58 2004 +0000
@@ -1524,6 +1524,28 @@
       (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)