Following on from yesterday's release, I've bumped blogmore.el to v2.5. The main change to the package is the thing I mentioned yesterday about the toggle of the draft status. The draft toggle yesterday was pretty simple, with it working like:
- If there is no
draftfrontmatter,draft: trueis added - If there is any
draftfrontmatter, it is removed
This meant that if you had draft: false set and you went to toggle, it would be removed, which is the same as setting it to draft: false.
Unlikely to generally be an issue, but I also couldn't let that stay like that. It bothered me.
So now it works as you'd expect:
- If there is no
draftfrontmatter,draft: trueis added - If
draft: trueis there, it is removed - If
draft: falseis there, it is set todraft: true
Much better.
Another change is that I fixed a problem with older supported versions of Emacs. I didn't know this was a problem because I'm running 30.2 everywhere. Meanwhile, thanks to package-lint-current-buffer from package-lint.el, I have:
Package-Requires: ((emacs "29.1"))
in the metadata for the package. Turns out though that sort used to require two parameters (the sequence and the predicate), whereas now it's fine with just one (it will accept just the sequence and will default the predicate). So of course blogmore.el was working fine for me, but would have crashed for someone with an earlier Emacs.
As for how I found this out... well I finally, for the first time ever, dived into using ERT to write some tests. While I've used testing frameworks in other languages, I'd never looked at this with Emacs Lisp. It works a treat and is great to work with; I think I'll be using this a lot more from now on.
Having got tests going I realised I should run them with GitHub actions, which then meant I managed to discover setup-emacs. Having found this the next logical step was to set up a matrix test for all the versions of Emacs I expect blogmore.el to work on. This worked fine, except... it didn't. While the tests worked locally, they were failing for some Emacsen over on GitHub.
And that's how I discovered the issue with sort on versions earlier than the one I'm using locally.
All in all, that was a good little period of hacking. New things discovered, the package improved, and a wider range of support for different versions of Emacs.