From 58ca6663a851329645f1c1ed9e15104b006485a7 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 13 Jun 2022 00:39:19 +0530 Subject: Reset attach and glue state when inserting literals. * thogai.el (thogai-insert-literal): Reset thogai-attach-next and thogai-glue. (thogai-insert-translation): Depend on thogai-insert-literal to reset thogai-attach-next and thogai-glue. --- thogai.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/thogai.el b/thogai.el index cb16132..bc69eb7 100644 --- a/thogai.el +++ b/thogai.el @@ -211,7 +211,10 @@ Insert LITERAL-TRANSLATION at point, respecting (concat (downcase (substring str 0 1)) (substring str 1))) 'identity)) - literal-translation))) + literal-translation)) + ;; Reset `thogai-attach-next' and `thogai-glue'. + (setq thogai-attach-next nil + thogai-glue nil)) (defun thogai-insert-translation (translation &optional subtranslation) "Insert TRANSLATION at point. @@ -270,9 +273,6 @@ callers should never pass non-nil SUBTRANSLATION." (_ (unless subtranslation (thogai-insert-space)) - ;; Reset `thogai-attach-next' and `thogai-glue'. - (setq thogai-attach-next nil - thogai-glue nil) (thogai-insert-literal translation))) ;; Recurse for rest of translation. (unless (string= rest-of-translation "") -- cgit v1.2.3