aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-06-16 01:44:01 +0530
committerArun Isaac2022-06-16 01:44:01 +0530
commita6b171c122388e07aa3b70b71a1a761221b6713a (patch)
tree3053227f2388b274899561787748634f7ec6159f
parent0378b39603440f945f1b2f12d83e04dca82d177d (diff)
downloadthogai-a6b171c122388e07aa3b70b71a1a761221b6713a.tar.gz
thogai-a6b171c122388e07aa3b70b71a1a761221b6713a.tar.lz
thogai-a6b171c122388e07aa3b70b71a1a761221b6713a.zip
Implement capitalization carry.
* thogai.el (thogai-insert-translation): Implement capitalization carry.
-rw-r--r--thogai.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/thogai.el b/thogai.el
index 3936bc7..7637ab4 100644
--- a/thogai.el
+++ b/thogai.el
@@ -258,6 +258,15 @@ External callers should always pass nil as the value."
(concat (string-remove-prefix "{" (string-remove-suffix "^}" translation))
"{^}")
non-first-part-p))
+ ;; Carry capitalization.
+ ((pred (lambda (str)
+ (string-prefix-p "{~|" str)))
+ (let ((capitalization-state thogai-capitalize-next-word))
+ (let ((thogai-capitalize-next-word nil))
+ (thogai-insert-translation
+ (string-remove-prefix "{~|" (string-remove-suffix "}" translation))
+ non-first-part-p))
+ (setq thogai-capitalize-next-word capitalization-state)))
;; Glue operator
((pred (lambda (str)
(string-prefix-p "{&" str)))