l3kn / org-fc

Spaced Repetition System for Emacs org-mode
https://www.leonrische.me/fc/index.html
GNU General Public License v3.0
258 stars 31 forks source link

feat: Add org-fc-init #85

Closed cashpw closed 1 year ago

cashpw commented 1 year ago

org-fc-init (1) prompts the user to select one of the available (org-fc-init--card-types) init functions and (2) invokes the selected function.

l3kn commented 1 year ago

I never thought about this feature because I'm using the hydra bindings but it seems like a good idea.

Your code uses an undefined cashweaver/org-fc-init--card-types, as I understand it completing-read should already return the correct function.

cashpw commented 1 year ago

I've mucked up the commit chain -- let me get that fixed.

EDIT: Fixed!

cashpw commented 1 year ago

Your code uses an undefined cashweaver/org-fc-init--card-types,

Remnant of an earlier version -- fixed.

as I understand it completing-read should already return the correct function.

Looks like completing-read only returns the selected string.

l3kn commented 1 year ago

Cloze cards prompt for their subtype on initialization, if you're fine with a multi-step process (prompt for type, prompt for subtype if necessary) we could avoid duplicating the list of card types so this init function automatically works with new user-defined card types.

Give me some time to make a few small changes, then this should be easy to implement in a way that also works for user-defined card types.

cashpw commented 1 year ago

Give me some time to make a few small changes, then this should be easy to implement in a way that also works for user-defined card types.

Sounds good! I had thought it may be best to org-fc-register-type include the *-init function