about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-11-29T07·25+0300
committertazjin <mail@tazj.in>2021-11-29T14·24+0000
commit7843363225800f69610cdafd245aa6595e748962 (patch)
tree1dcc35db80452f09976cb838c30b8274ce228e4a
parent78f51edf8c695486471c439fce3fa9f1210e0517 (diff)
feat(tazjin/russian): Remember the last displayed word r/3107
This will make it possible to do operations on that word (i.e. marking
it as known, or opening the full definition page).

Change-Id: Ib77f7d2e4e96d6ab754b311a69f72e2b080657ac
-rw-r--r--users/tazjin/russian/russian.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/users/tazjin/russian/russian.el b/users/tazjin/russian/russian.el
index 448b240a7063..94245f07c123 100644
--- a/users/tazjin/russian/russian.el
+++ b/users/tazjin/russian/russian.el
@@ -82,7 +82,9 @@
 
 (defun display-random-russian-word ()
   (interactive)
-  (message (russian--format-word (seq-random-elt (ht-values russian-words)))))
+  (let ((word (seq-random-elt (ht-values russian-words))))
+    (setq russian--last-word word)
+    (message (russian--format-word word))))
 
 (defvar russian--display-timer
   (run-with-idle-timer 5 t #'display-random-russian-word))