diff options
author | Thanos Apollo <[email protected]> | 2025-01-03 19:57:10 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2025-01-03 19:57:10 +0200 |
commit | 8cf9c7e0c86ca616de860d0f68816e965ecba161 (patch) | |
tree | f25c04668f00c2e3523dfe8c601ddf87e035220c | |
parent | 869ec19eaf23fe4503fcfe85638c754058ae8137 (diff) |
[fix] get-deck-name: If no deck exists, create it.
-rw-r--r-- | gnosis.el | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -701,8 +701,9 @@ Set SPLIT to t to split all input given." (defun gnosis--get-deck-name (&optional id) "Get deck name for ID, or prompt for deck name when ID is nil." - (when (equal (gnosis-select 'name 'decks) nil) - (error "No decks found. Please create a deck first with `gnosis-add-deck'")) + (when (and (equal (gnosis-select 'name 'decks) nil) + (y-or-n-p "No decks found, create deck?")) + (gnosis-add-deck (read-string "Deck name: "))) (if id (gnosis-get 'name 'decks `(= id ,id)) (funcall gnosis-completing-read-function "Deck: " (gnosis-select 'name 'decks)))) |