> Thank you so much for doing this! This is amazing! I have been meaning to do > something similar for a while. I wrote the current org-habit tests and I've > attempted what you've done a few times so I'm probably a pretty good person to > review this patch. > > I will do my best to review it tomorrow but today I think I have just enough > time to dwell on your approach. > > The idea of setting the habit type manually for each headline in a property > seems like a rational one. > > 1. A person will likely only use one method of marking a particular habit (ex: > log-done, a clock entry, a table entry). > > 2. It means we can add an arbitrary number of habit types and it won't slow > down parsing. > > 3. It would allow sharing habit files between different emacs configs. I > doubt > anyone would do this but I suppose it's still a point in favor of this > approach. > > > However, it was not the approach I was going to do once I got around to it. I > was simply going to make `org-habit-parse-todo' a defcustom so people could > bring their own functions as I doubt upstream org-mode will ever be capable of > containing the amount of ways people want to mark stuff done (although I do > belive it should contain a few more ways). > > I was also planning on doing this so I could simply add my habit > customizations > in my config file and not have to adjust my habit files whatsoever (I wouldn't > need to add a "HABIT_STYLE" property). > > I do believe that we can combine the benefits of my approach and your approach > together with a minimal addition of complexity. > > 1. Perhaps the default habit-type should be a defcustom instead of > hard-coding it to `log-done'.
This is a good idea. Once I implement numeric habits, I will add this defcustom. > > 2. We need a way to allow users to bring their own org-habit parsing > functions. Maybe a defcustom that is an alist of > (HABIT_STYLE . parse-func). > This was my eventual goal. But it's too soon to implement this for the moment. For me, the next steps in this process will be refactoring org-habit-build-graph and org-habit-insert-consistency-graphs. So, the habit data structure may still change. The next issue is that I plan on implementing more than just numeric habits. You'll see that log-done is actually a "repeater style" habit. Numeric habits will also be a "repeater style" habit. I am also planning on implementing "clock style" habits and "table style" habits. Obviously, there is still a chance that I will end up changing the habit data structure again in the process of doing that. Once those are implemented and everything is set in stone, I will definitely open things up so that users can bring their own parsers. > 3. It would be nice to be able to run multiple habit parsing functions > on a single headline and combine the results. > What exactly do you mean by combine the results? > Again thank you so much for putting in the effort! I'll start reviewing > the patch tomorrow. My suggestions can easily be added on at a later > date (well the third one might be tricky). I just wanted to get your > opinion on it. > > Also just a quick question about copyright: Do you have your FSF copyright > assignment done? I don't see your name on this list: > https://orgmode.org/worg/contributors.html > Yes, I do. I guess I need to be added to that list.
