diff options
Diffstat (limited to 'thogai.el')
-rw-r--r-- | thogai.el | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -388,11 +388,16 @@ current state, and should typically be `thogai-stroke-ring'." ;; this translation. If no strokes were matched, skip this step. (unless (null matched-strokes) (thogai-reverse-strokes (butlast matched-strokes))) - ;; Insert literal stroke if it is not in the dictionary. Else, - ;; insert the actual translation. + ;; Insert literal stroke if it is not in the dictionary. (if (null matched-strokes) (thogai-insert-translation (ring-ref stroke-ring 0)) - (thogai-insert-translation (thogai-lookup (string-join matched-strokes "/"))))))) + ;; Else, insert or run the translation. + (let ((translation (thogai-lookup (string-join matched-strokes "/")))) + (cond + ((stringp translation) + (thogai-insert-translation translation)) + ((commandp translation) + (call-interactively translation)))))))) (defun thogai-byte-to-bits (byte) "Convert BYTE to a list of 8 bits. |