diff options
author | Thanos Apollo <[email protected]> | 2023-12-27 06:42:06 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-12-27 06:42:06 +0200 |
commit | 6b8d8f418b229bc2bd030dbda14ac08c9903f585 (patch) | |
tree | c3772e9f2db0af9be06501387c7fd9695937700a | |
parent | 3a6cd769d7c24287bd33f7439c5e1d6de0d4a1dc (diff) |
Add gnosis-cloze-replace-words
-rw-r--r-- | gnosis.el | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -262,6 +262,14 @@ choice in the `CHOICES' list. Each note must correspond to one `DECK'. ;; As our push/assoc approach prepends elements, not appends them ;; (mapcar (lambda (x) (cons (car x) (cdr x))) (nreverse res)) ;; check for cl-rest (mapcar (lambda (x) (cdr x)) (nreverse res)))) +(defun gnosis-cloze-replace-words (string words new) + "In STRING replace WORDS with NEW." + (cl-assert (listp words)) + (cl-loop for word + in words + do (setf string (replace-regexp-in-string (concat "\\<" word "\\>") ;; use word boundary indentifiers + new string))) + string) ;; Review (defun gnosis-review--algorithm (id success) "Get next review date & ef for note with value of id ID. |