aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-06-13 00:39:19 +0530
committerArun Isaac2022-06-13 00:39:19 +0530
commit58ca6663a851329645f1c1ed9e15104b006485a7 (patch)
tree490833ed17c0158f261164dc120c45f7d823ebb7
parent53efbb6159560778e6ac33625c54081a0a09c4cd (diff)
downloadthogai-58ca6663a851329645f1c1ed9e15104b006485a7.tar.gz
thogai-58ca6663a851329645f1c1ed9e15104b006485a7.tar.lz
thogai-58ca6663a851329645f1c1ed9e15104b006485a7.zip
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.
-rw-r--r--thogai.el8
1 files 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 "")