aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-06-16 01:45:26 +0530
committerArun Isaac2022-06-16 01:45:26 +0530
commit4f456c36a4b56dec2e7053ba1d3d0475b70ed3ac (patch)
treef120ada00d60a6bd01483ef4011fe3223d11f810
parent3763e656e21bda0cc5f6cd60a9225cf2de2b25fb (diff)
downloadthogai-4f456c36a4b56dec2e7053ba1d3d0475b70ed3ac.tar.gz
thogai-4f456c36a4b56dec2e7053ba1d3d0475b70ed3ac.tar.lz
thogai-4f456c36a4b56dec2e7053ba1d3d0475b70ed3ac.zip
Implement capitalization carry prefix.
* thogai.el (thogai-insert-translation): Implement capitalization carry prefix.
-rw-r--r--thogai.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/thogai.el b/thogai.el
index 06db17c..1803405 100644
--- a/thogai.el
+++ b/thogai.el
@@ -255,8 +255,14 @@ External callers should always pass nil as the value."
((pred (lambda (str)
(string-suffix-p "^}" str)))
(thogai-insert-translation
- (concat (string-remove-prefix "{" (string-remove-suffix "^}" translation))
- "{^}")
+ (concat
+ (let ((unwrapped (string-remove-prefix "{" (string-remove-suffix "^}" translation))))
+ ;; If `translation' is a capitalization carry prefix, wrap
+ ;; it up again.
+ (if (string-prefix-p "~|" unwrapped)
+ (concat "{" unwrapped "}")
+ unwrapped))
+ "{^}")
non-first-part-p))
;; Carry capitalization.
((pred (lambda (str)