Open abvbv opened 3 years ago
Hi, here's my quick fix for this. You just need to call my-anki-cloze-dwim
like anki-editor-cloze-dwim
(defun my-anki-cloze-arg ()
"Return appropriate cloze arg of current anki entry"
(interactive)
(let ((index 1))
(save-excursion
(goto-char (org-entry-beginning-position))
(while
(search-forward (format "{{c%d::" index) (org-entry-end-position) t)
(cl-incf index)
(goto-char (org-entry-beginning-position)))
index)))
(defun my-anki-cloze-dwim ()
(interactive)
(let ((current-prefix-arg (my-anki-cloze-arg)))
(call-interactively 'anki-editor-cloze-dwim)
)
)
If we have the next note:
I'd like to have two Cloze deletions:
Currently
anki-editor-cloze-region
andanki-editor-cloze-dwim
commands insertc1
deletions by default. So we can:1) Create two deletions with either command and then manually change the ID of the second deletion from
c1
toc2
. 2) Use optional argument before invoking a command to set a particular ID.The problem with both approaches is that they're error prone and quite laborious, if we have more deletions.
It would be nice to have a way to insert consecutively numbered deletions automatically.
I think (but don't have any proofs) it's more common to have deletions with different, not identical, IDs. So maybe it'd be nice to change the default behavior to automatic numbering.
P.S. Thank you for anki-editor! It's an amazing tool. It makes Anki note management a much more pleasant experience.