remove temporary its-barf-on-invalid-keyseq binding.
[elisp/egg.git] / its.el
diff --git a/its.el b/its.el
index 0978ba7..9abea6d 100644 (file)
--- a/its.el
+++ b/its.el
 (defun its-state-machine-keyseq (keyseq emit &optional eol)
   (let ((i 0)
        (len (length keyseq))
-       (its-barf-on-invalid-keyseq nil) ; temporally disable DING
        (syl (its-initial-ISYL))
        cursor)
     (while (< i len)
@@ -716,21 +715,20 @@ Return last state."
   (let ((prop (get-text-property (point) 'intangible)))
     (or (eq prop 'its-part-1) (eq prop 'its-part-2))))
 \f
-(defvar its-translation-result nil "")
+(defvar its-translation-result "" "")
 
 (defun its-ins/del-SYL-batch (newsyl oldsyl)
-  (let (output)
   (its-update-latest-SYL newsyl)
   (if (and newsyl
           (consp (cdr newsyl))
           (not (its-kst-p (its-get-kst/t newsyl))))
-      (progn
-       ;; DSYL
-       (setq output (its-get-output newsyl))
-       (put-text-property 0 (length output)
-                          'its-lang its-current-language output)
-       (setq its-translation-result
-           (cons output its-translation-result))))))
+      ;; DSYL
+      (let ((output (its-get-output newsyl))
+           (oldlen (length its-translation-result)))
+       (setq its-translation-result (concat its-translation-result output))
+       (put-text-property oldlen (length its-translation-result)
+                          'its-lang its-current-language
+                          its-translation-result))))
 
 (defun its-translate-region (start end)
   (interactive "r")
@@ -738,7 +736,7 @@ Return last state."
   (remove-text-properties start (point) '(its-lang nil)))
 
 (defun its-translate-region-internal (start end)
-  (setq its-translation-result nil)
+  (setq its-translation-result "")
   (goto-char start)
   (let ((i 0)
        (syl (its-initial-ISYL))
@@ -755,7 +753,7 @@ Return last state."
     (if (eq syl its-latest-SYL)
        (its-state-machine syl -1 'its-ins/del-SYL-batch))
     (delete-region start end)
-    (apply 'insert (reverse its-translation-result))))
+    (insert its-translation-result)))
 \f
 (require 'its-keydef)