Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow custom, per-card, cloze context value #97

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

cashpw
Copy link
Contributor

@cashpw cashpw commented Sep 19, 2022

Reference: #96

@l3kn
Copy link
Owner

l3kn commented Sep 19, 2022

Wow, you're fast.

This is pretty much exactly what I had in mind.

As I understand it, the new property is set each time a cloze card is initialized / updated
so I assume the workflow you're thinking of is to manually edit the property for cards you want to change.
One downside to this is that if there's a deck of many cards all using the default context
and the default context changes, the property of the cards stays the same.

For this reason, I'd prefer a function that optionally adds the property, prompting for a numeric value.

@cashpw
Copy link
Contributor Author

cashpw commented Sep 19, 2022

Wow, you're fast.

The trick is to forget to create the issue until you're more than half-way through implementing the feature.

For this reason, I'd prefer a function that optionally adds the property, prompting for a numeric value.

Done: org-fc-cloze-set-context. Do you think it's worthwhile to validate the user's input here as a non-negative integer?

@cashpw cashpw changed the base branch from main to develop October 11, 2022 16:44
@cashpw
Copy link
Contributor Author

cashpw commented Oct 18, 2022

Checking in -- is there anything you'd like to see changed in this pull request?

@l3kn
Copy link
Owner

l3kn commented May 24, 2023

It just occurred to me that there is already a mechanism for this in the form of the org-fc-property macro
and I've added an implementation based on that to the develop branch.

Two missing parts are a setter function (probably to hard to generate using the macro, due to the interactive-read)
and a way to customize the property (not implemented yet, but should be possible in the macro).

Despite this, I think the macro-based approach will avoid some code duplication once more variables of this kind are added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants