From 779594b51d25c7940ac99a59a6f1319e2ce749b7 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sun, 19 Jun 2022 00:26:36 +0530 Subject: Implement formatting cancellation operator. * thogai.el (thogai-insert-translation): Implement formatting cancellation operator. --- thogai.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/thogai.el b/thogai.el index b30fdde..1fc350f 100644 --- a/thogai.el +++ b/thogai.el @@ -298,7 +298,7 @@ have been processed yet. This is an internal recursion variable. External callers should always pass nil as the value." (pcase (save-match-data (string-match (rx string-start (or (one-or-more (not ?{)) - (sequence ?{ (one-or-more (not ?{)) ?}))) + (sequence ?{ (zero-or-more (not ?{)) ?}))) translation) (list (match-string 0 translation) (substring translation (match-end 0)))) @@ -349,6 +349,12 @@ External callers should always pass nil as the value." (string-remove-prefix "{&" (string-remove-suffix "}" translation))) non-first-part-p) (setq thogai-glue t)) + ;; Cancel formatting. + ("{}" + (setq thogai-attach-next nil + thogai-capitalize-next-word nil + thogai-glue nil + thogai-uncapitalize-next-word nil)) ;; Period, question mark or exclamation mark ((or "{.}" "{?}" "{!}") (insert (string-remove-prefix "{" (string-remove-suffix "}" translation))) -- cgit v1.2.3