From a6b171c122388e07aa3b70b71a1a761221b6713a Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 16 Jun 2022 01:44:01 +0530 Subject: Implement capitalization carry. * thogai.el (thogai-insert-translation): Implement capitalization carry. --- thogai.el | 9 +++++++++ 1 file changed, 9 insertions(+) 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))) -- cgit v1.2.3