summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/gnosis.el b/gnosis.el
index 7cc04fe..2cb4d44 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -394,11 +394,13 @@ Set SPLIT to t to split all input given."
(gnosis--insert-into 'decks `([nil ,name nil nil nil nil]))
(message "Created deck '%s'" name)))
-(defun gnosis--get-deck-name ()
+(defun gnosis--get-deck-name (&optional id)
"Return name from table DECKS."
(when (equal (gnosis-select 'name 'decks) nil)
(error "No decks found"))
- (funcall gnosis-completing-read-function "Deck: " (gnosis-select 'name 'decks)))
+ (if id
+ (gnosis-get 'name 'decks `(= id ,id))
+ (funcall gnosis-completing-read-function "Deck: " (gnosis-select 'name 'decks))))
(cl-defun gnosis--get-deck-id (&optional (deck (gnosis--get-deck-name)))
"Return id for DECK name."