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

Add a customization for saving a log file. #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

taeric
Copy link

@taeric taeric commented Jul 5, 2023

I find I'm wanting to know how I've been doing over time, but don't have this recorded anywhere. So, quick stab to get that into this.

I'm tempted to add a few extra outputs here. In particular, I suspect that I have a few keys I often miss, so would like to add any common letters that I'm missing to the output. If there is no objection, I think I can get that in here.

@mrkkrp
Copy link
Owner

mrkkrp commented Jul 6, 2023

A great idea! Tell me when this is ready for review. Could you also fix the CI failure?

@taeric
Copy link
Author

taeric commented Jul 6, 2023

Certainly, I'm embarrassed that I missed the CI tests.

Any concerns with where I'm putting it? I am guessing things can get added/changed later with no real difficulty.

I find I'm wanting to know how I've been doing over time, but don't
have this recorded anywhere.  So, quick stab to get that into this.

I'm tempted to add a few extra outputs here.  In particular, I suspect
that I have a few keys I often miss, so would like to add any common
letters that I'm missing to the output.  If there is no objection, I
think I can get that in here.
@taeric taeric force-pushed the history-log-file branch from 5763e89 to d067c40 Compare July 6, 2023 13:56
@mrkkrp
Copy link
Owner

mrkkrp commented Jul 6, 2023

I'm embarrassed that I missed the CI tests

No reason to be embarrassed, I think I have to approve every run for "outside" contributors.

@taeric
Copy link
Author

taeric commented Jul 6, 2023

I fixed the CI by adding a period. I can also reword the parameter, if we want to avoid the "if non-nil" opening of the sentence.

@taeric
Copy link
Author

taeric commented Jul 6, 2023

Also, I'm going to work on adding the "missed characters" later. Trying to decide how I'd want that reported. Largely tempted to put it as a single "column" that is an alist of char to times missed. Could do json, though that would get odd for all of the commas that would make it need escaping for this to remain a CSV file?

If you have thoughts on how that would be best done, I'm happy for directions. Similarly, if you want the log file done in a different way, happy to make any changes.

@taeric
Copy link
Author

taeric commented Jul 13, 2023

Getting some time to polish this code up a bit. A couple of questions for you.

  • Are you ok with the parameter being typit-history-log? Any other suggested name?
  • What all should I record in the default write of the file?

To the second question, I could introduce another parameter that lets us offer multiple format options. I'm hesitant to get too fancy there. My thinking is to record what is printed to the user, but in a flattened CSV style. So, each line would be:

wpm, good-strokes, bad-strokes, good-words, bad-words, accuracy

I could add total-strokes and total words?

For the code organization, I'm not looking to refactor too much here. I can move out the writing of the file, otherwise, I'm planning on making it so that it saves the file, but don't have any other plans here. If there is another set of methods I should use instead of find-file-noselect, let me know.

Thanks!

@mrkkrp
Copy link
Owner

mrkkrp commented Aug 6, 2023

Are you ok with the parameter being typit-history-log? Any other suggested name?

The name sounds good to me!

What all should I record in the default write of the file?

I think since this is Emacs, the most natural solution would be to write an s-expression like in e.g. .emacs-custom.el and tramp. The log file would then be a list of "records" (could be lists where position determines meaning, or could be alists with explicit labels). I imagine such a file would be updated if it exists (= append an entry), or created with the first entry upon completion of a typing session. It also seems to be a good idea to have a limit on the number of entries retained. When the limit is exceeded oldest entries should be evicted.

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.

2 participants