Closed rhaps0dy closed 2 years ago
Thanks for the fix! Do you have an example of a headline that this fixes? I'd like to add a regression test if possible.
In my setup, all headlines are broken without this fix. I'll come up with a test for org-gcal--archive-old-event
, for which there is none at the moment.
An example is
* Headline that is broken
:PROPERTIES:
things...
:END:
<2022-01-17 12:34-13:45>
Thanks, I will look at this in a few hours
Finally added the test! I've used some macros from org-test
, which is used to test Org mode code. The code to find it is on the (require)
form at the top of the test file. I've tried to make finding org-test.el
work for other people, but I can't be fully sure.
I've also fixed another "bug", which only came up if your org-archive-location
is in the same file: the same entries would be "archived" over and over because they would be found by the loop many times. Also entries that are not calendar items were archived as well. That is now fixed and the test tests for it.
I tested this branch, can confirm it fixes #172 for my setup. Thanks!
Another happy user here. All my old events are archived properly with this PR.
Thanks!
Thanks - I'd love to merge this, but the code to find org-test
doesn't seem to work on the Github Actions CI for some reason:
Cannot open load file: No such file or directory, /nix/store/114zrlnbkbqfvlsm0sialj7fyva305sv-emacs-27.1/share/emacs/27.1/lisp/testing/org-test.el
It's because we're trying to load the built-in Emacs org
rather than downloading it from Melpa. Need to figure out how to download it.
I've debugged following the instructions in https://github.com/marketplace/actions/debugging-with-ssh, and it seems like we're using the built-in Org. We need to download Org from the Org package repository.
I'm still having trouble figuring out how to retrieve the testing files from upstream. It may be best just to manually add org-test.el
to the repo, since the testing
directory isn't included by default in Org as installed via ELPA (or builtin to Emacs).
@rhaps0dy I've been adding some additional fixes to the tests in #192. I've finally gotten it to the point where everything works except for org-gcal-test--headline-archive-old-event: https://github.com/kidd/org-gcal.el/runs/5656094259?check_suite_focus=true
I'm going to close this in favor of #192.
To parse an org headline, the point needs to be at the beginning of it. After that, we move to the timestamp to parse it too.
Fixes #172