about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2022-06-19 00:26:36 +0530
committerArun Isaac2022-06-19 00:26:36 +0530
commit779594b51d25c7940ac99a59a6f1319e2ce749b7 (patch)
treea1325d59394904561bd3b208faa4c63de2202f6c
parent99e44f9de05ec8785eee4128de2c27ea91ecf133 (diff)
downloadthogai-779594b51d25c7940ac99a59a6f1319e2ce749b7.tar.gz
thogai-779594b51d25c7940ac99a59a6f1319e2ce749b7.tar.lz
thogai-779594b51d25c7940ac99a59a6f1319e2ce749b7.zip
Implement formatting cancellation operator.
* thogai.el (thogai-insert-translation): Implement formatting
cancellation operator.
-rw-r--r--thogai.el8
1 files changed, 7 insertions, 1 deletions
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)))