-
Notifications
You must be signed in to change notification settings - Fork 108
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
Extra Priority Values (A-Z and 0-64) #313
base: master
Are you sure you want to change the base?
Conversation
Hello, Yes, this is probably something that needs to be addressed. But if we're going to do it, we should probably try to adhere as closely as possible to how Org does it, i.e. to be sure to accept all of the kinds of values that it accepts. Would you do a little research about what Org officially allows now? IIRC it's changed slightly in the past few major releases, or something like that. As well, if we change what priority values are accepted, we should ensure that the priority sorter works with the new values. And it might be a good idea to revisit the priority-related tests to be sure that at least one value of each type is tested for. Would you be interested in working on those issues too? Thanks. |
Thanks for the quick reply! I need to fix some silly mistakes in my code anyway - I don't use git much but it looks like I can keep tweaking my branch and the PR will be updated automatically. I'm busy for a few days but will try to fix my mistakes & get the priority sorter working next week (I thought it worked; didn't test a wide-enough range of values). Sorting in the order 0-64, then ?A-?Z will match what org does (in Emacs 28.1 at least), both in Org Elements API doesn't seem to agree (for now?), and for [#0] to [#9] returns ?0 to ?9 (which is 48-57), but for [#%] it returns ?%, so it's clearly just converting a string to a char. I'm unfamiliar with testing / buttercup, so might not be able to add tests confidently. |
No problem. As you can see, there's a backlog of issues and PRs; I haven't had as much time lately to work on this package as I would like. When you update your branch, you should generally rebase it on top of current master and then force-push. And unless your commit history matters, or unless you're separating commits for readability, feel free to squash the commits, which makes it easier to review.
Sounds good.
Hm, we might want to look at that more closely. Also, Org 9.6 just came out--is that what you looked at?
No problem. Buttercup is pretty simple, and it's well-documented, but I can help you with it. Probably we'll need to tweak a few priorities in the test data file to give us something to test against. Thanks. |
059b10c
to
77b4c2b
Compare
94a7a44
to
e6bde30
Compare
Looking back at this... Prios 0-9 and A-Z work fine, but comparison and sorting are broken for 10-64. It's still an improvement on current behavior, but maybe worth someone more knowledgeable doing a thorough job! |
Thanks for coming back to this. This is a good first step, but I wouldn't be able to merge this until the problems you mentioned are fixed. But neither of those should be difficult, so if you're interested, I encourage you to work on that, too. My time is limited, but I'll be glad to advise you as I can. |
Expand recognised priority values from A-C to current org-mode standard of A-Z and 0-64.
OK! I've updated the regex builder in Sorting and comparison are now working, unless there are edge cases that I've not checked (very possible!). Can't figure out buttercup, eval-buffer in test-org-ql.el just messages "Buttercup test failed". I'm probably using it wrong. |
e6bde30
to
f97a13a
Compare
The tests are run using the |
Added tests, feel confident that this is the final force-push! All your help and encouragement is much appreciated :) |
Thanks, I think we're close to being done here. A few more items to consider:
Thanks for your work on this. |
Started the copyright assignment process. From the docs, it seems that sort-order of mixed numbers and letters is intentionally undefined, and users are expected to stick to either alphabetic or numerical priorities. So technically all that matters is that prios 0-64 sort correctly, and that A-Z sort correctly. Since the numerical values of A-Z continue from 65 upwards, I think sorting 0-64 then A-Z makes sense, because it's the easiest behaviour and gets all defined cases right. We can't really base this on existing behavior because |
Sort order is letters first, then numbers. I'm not particularly attached to that, just made a choice. Org docs don't seem to define how they interrelate when mixed.
Also renamed priority "letters" to "values" in variable names & docs. Since this added a lot of noise, here's the important change: