changeset 23887:3a4d3e2418dc

(quail-point-in-conversion-region): New function. (quail-conversion-backward-delete-char): When a key sequence is being translated, call quail-delete-last-char.
author Kenichi Handa <handa@m17n.org>
date Tue, 15 Dec 1998 04:35:38 +0000
parents 6402c89c30c3
children 86cf240ba90e
files lisp/international/quail.el
diffstat 1 files changed, 17 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/quail.el	Tue Dec 15 04:35:38 1998 +0000
+++ b/lisp/international/quail.el	Tue Dec 15 04:35:38 1998 +0000
@@ -1345,6 +1345,13 @@
 
 ;; For conversion mode.
 
+(defsubst quail-point-in-conversion-region ()
+  "Return non-nil value if the point is in conversion region of Quail mode."
+  (let (start pos)
+    (and (setq start (overlay-start quail-conv-overlay))
+	 (>= (setq pos (point)) start)
+	 (<= pos (overlay-end quail-conv-overlay)))))
+
 (defun quail-conversion-backward-char ()
   (interactive)
   (if (<= (point) (overlay-start quail-conv-overlay))
@@ -1394,14 +1401,16 @@
 
 (defun quail-conversion-backward-delete-char ()
   (interactive)
-  (if (<= (point) (overlay-start quail-conv-overlay))
-      (quail-error "Beginning of conversion region"))
-  (delete-char -1)
-  (let ((start (overlay-start quail-conv-overlay))
-	(end (overlay-end quail-conv-overlay)))
-    (setq quail-conversion-str (buffer-substring start end))
-    (if (= start end)
-	(setq quail-converting nil))))
+  (if (> (length quail-current-key) 0)
+      (quail-delete-last-char)
+    (if (<= (point) (overlay-start quail-conv-overlay))
+	(quail-error "Beginning of conversion region"))
+    (delete-char -1)
+    (let ((start (overlay-start quail-conv-overlay))
+	  (end (overlay-end quail-conv-overlay)))
+      (setq quail-conversion-str (buffer-substring start end))
+      (if (= start end)
+	  (setq quail-converting nil)))))
 
 (defun quail-do-conversion (func &rest args)
   "Call FUNC to convert text in the current conversion region of Quail.