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

Fix #172, point to beginning for parsing headline #179

Closed
wants to merge 5 commits into from

Conversation

rhaps0dy
Copy link

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

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.
@telotortium
Copy link
Collaborator

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.

@rhaps0dy
Copy link
Author

rhaps0dy commented Jan 17, 2022

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>

@telotortium
Copy link
Collaborator

Thanks, I will look at this in a few hours

@rhaps0dy
Copy link
Author

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.

@John-Goff
Copy link

I tested this branch, can confirm it fixes #172 for my setup. Thanks!

@maikol-solis
Copy link

maikol-solis commented Feb 9, 2022

Another happy user here. All my old events are archived properly with this PR.

Thanks!

@telotortium
Copy link
Collaborator

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

@telotortium
Copy link
Collaborator

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.

@telotortium
Copy link
Collaborator

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.

@telotortium
Copy link
Collaborator

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).

@telotortium
Copy link
Collaborator

@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

telotortium added a commit to telotortium/org-gcal.el that referenced this pull request Mar 23, 2022
@telotortium
Copy link
Collaborator

I'm going to close this in favor of #192.

telotortium added a commit that referenced this pull request Mar 24, 2022
Adopt #179, merging current master into this and fixing tests.

- Move to beginning of line everywhere before running `org-element-headline-parser`.
- Prevent archiving in a cycle.

Fix #172
telotortium added a commit to telotortium/org-gcal.el that referenced this pull request Mar 24, 2022
telotortium added a commit to telotortium/org-gcal.el that referenced this pull request Jul 9, 2022
telotortium added a commit to telotortium/org-gcal.el that referenced this pull request Jul 15, 2022
telotortium added a commit to telotortium/org-gcal.el that referenced this pull request Jul 28, 2022
telotortium added a commit to telotortium/org-gcal.el that referenced this pull request Jul 31, 2022
telotortium added a commit to telotortium/org-gcal.el that referenced this pull request Nov 19, 2022
telotortium added a commit to telotortium/org-gcal.el that referenced this pull request Nov 19, 2022
telotortium added a commit to telotortium/org-gcal.el that referenced this pull request Nov 29, 2022
telotortium added a commit to telotortium/org-gcal.el that referenced this pull request May 9, 2023
telotortium added a commit to telotortium/org-gcal.el that referenced this pull request Feb 13, 2024
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.

rx--translate-bounded-repetition: rx ‘**’ range error
4 participants