changeset 66426:54f639048139

(quail-translate-key): If the input method is deterministic and failed to handle the last key, restart the key handling loop from an appropriate key.
author Kenichi Handa <handa@m17n.org>
date Tue, 25 Oct 2005 06:10:23 +0000
parents 3dcbac116732
children 4a8e7445d807
files lisp/international/quail.el
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/quail.el	Tue Oct 25 05:52:28 2005 +0000
+++ b/lisp/international/quail.el	Tue Oct 25 06:10:23 2005 +0000
@@ -1720,6 +1720,20 @@
 	     ;; And, we can terminate the current translation.
 	     t)
 
+	    ((quail-deterministic)
+	     ;; No way to handle the last character in this context.
+	     ;; Commit the longest successfully translated characters, and
+	     ;; handle the remaining characters in a new loop.
+	     (setq def nil)
+	     (while (and (not def) (> len 1))
+	       (setq len (1- len))
+	       (setq def (quail-map-definition
+			  (quail-lookup-key quail-current-key len))))
+	     (if def (setq quail-current-str
+			   (quail-get-current-str len def))
+	       (setq quail-current-str (aref quail-current-key 0)))
+	     len)
+
 	    (t
 	     ;; No way to handle the last character in this context.
 	     (setq def (quail-map-definition