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

simplify code #17

Merged
merged 3 commits into from
Aug 28, 2021
Merged

simplify code #17

merged 3 commits into from
Aug 28, 2021

Conversation

jakecoble
Copy link
Contributor

This commit accomplishes what the original did with fewer lines of code using org-map-entries.

@spegoraro
Copy link
Owner

Thanks for the PR! I'll review it once I get a chance in the next couple of days.

Create a new variable `org-alert-match-string` which contains the string
passed to `org-map-entries`.
Remove `dash` and `s` dependencies.
Bump version.
@spegoraro
Copy link
Owner

Hi again, I have reviewed the PR and it all works great! Fantastic job!

Just a few changes to make before merging:

  1. Extract the match string into a variable.
  2. Remove the dash and s dependencies from the commentary.

I have already done these locally but need to push them to your fork so can you please tick the box to allow me access to it?

@spegoraro
Copy link
Owner

Please review the changes before I merge to verify that I haven't stuffed anything up. I tested using a blank instance but just in case...

@jakecoble
Copy link
Contributor Author

Thanks! I'll give it a test run in the morning.

@jakecoble
Copy link
Contributor Author

Encountering errors when running with emacs -Q, so I’m hunting for the problem.

@jakecoble
Copy link
Contributor Author

Looks like the problem was that my solution requires org version 9 and my fresh emacs instance was running 8. I’ve added org 9 to the requirements list.

@spegoraro
Copy link
Owner

That makes sense.

Many users will be using an emacs provided by their package manager which means that many won't have Org 9. Rather than break it for them it might be an idea to bring this in as a separate branch. Once the majority of users are on version 9 then we can merge it to master.

What are your thoughts on this?

@jakecoble
Copy link
Contributor Author

Agreed that it’s probably best if people can use the version that ships with Emacs. Fortunately, since it’s only (org-heading) that’s the problem, I can make some modifications so this works with org 8. It won’t be as brief, but it’ll still be less code overall.

@spegoraro
Copy link
Owner

That sounds good, we can just check for Org < 9 and provide the necessary function.

@herbertjones
Copy link
Contributor

I wasn't able to get any entries to be matched. I had to limit the matcher to only "today" to get any matches, as the "+" on "tomorrow" would return none.

herbertjones@06f7ed8
https://github.com/herbertjones/org-alert/tree/simplify_with_adjusted_matcher

@leungbk
Copy link

leungbk commented Jun 5, 2019

What's the status on this? I'd like to package org-alert for the Guix package manager, but would prefer to wait for this PR to be merged first (since it appears to fix #14).

@spegoraro
Copy link
Owner

I haven't used the package in some time but I'll have another look this afternoon. From what I recall, all that needs to be done is to provide the org-map-entries function for users when their version of Org is < 9.

@ntBre ntBre merged commit 5758aa5 into spegoraro:master Aug 28, 2021
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.

5 participants