Deck insertion command accepts a prefix to only insert deck name
This commit is contained in:
parent
b57bd89291
commit
e489e729e2
1 changed files with 4 additions and 4 deletions
|
@ -52,16 +52,16 @@
|
|||
(let ((failed (seq-count #'null result)))
|
||||
(message (format "Submitted %d notes, %d successful, %d failed." total (- total failed) failed))))))))
|
||||
|
||||
(defun anki-editor-insert-deck ()
|
||||
(interactive)
|
||||
(defun anki-editor-insert-deck (&optional prefix)
|
||||
(interactive "P")
|
||||
(message "Fetching decks...")
|
||||
(anki-editor--anki-connect-invoke
|
||||
"deckNames" 5 nil
|
||||
(lambda (result)
|
||||
(setq result (append (sort result #'string-lessp) nil))
|
||||
(org-insert-heading-respect-content)
|
||||
(unless prefix (org-insert-heading-respect-content))
|
||||
(insert (completing-read "Choose a deck: " result))
|
||||
(anki-editor--set-tags-fix anki-editor-deck-tag))))
|
||||
(unless prefix (anki-editor--set-tags-fix anki-editor-deck-tag)))))
|
||||
|
||||
(defun anki-editor-insert-note ()
|
||||
(interactive)
|
||||
|
|
Loading…
Reference in a new issue