diff options
author | Arun Isaac | 2022-06-16 01:45:26 +0530 |
---|---|---|
committer | Arun Isaac | 2022-06-16 01:45:26 +0530 |
commit | 4f456c36a4b56dec2e7053ba1d3d0475b70ed3ac (patch) | |
tree | f120ada00d60a6bd01483ef4011fe3223d11f810 | |
parent | 3763e656e21bda0cc5f6cd60a9225cf2de2b25fb (diff) | |
download | thogai-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.el | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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) |