-
Notifications
You must be signed in to change notification settings - Fork 123
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
Account for org-extend-today-until in org-journal-open-current-file #428
Conversation
I can't figure out how this works. From what I can gleam from the source code, the other parts of the code that use Could you comment on why this works? |
An integer is a possible time value, see (elisp) Time of Day. So, E.g. (format-time-string "%FT%T%z" (time-subtract nil 0)) Or, to make it a year ago: (format-time-string "%FT%T%z" (time-subtract nil (* 60 60 24 365))) Thus As I said, this is how
As for your link, I've changed the code as follows and it seems to work the same: (let* ((time (time-since (* 3600 org-extend-today-until)))
(org-extend-today-until-active-p
(> (time-to-days nil)
(time-to-days time)))
...)
...) I can commit that as well. |
I see! Thank you very much for the clarification, this is clever! I think I would prefer |
Maybe you're right, changed that. As for me, I often look at the source when I see a function I don't understand, and the nature of |
I tend to look at the documentation only, which is probably where my confusion comes from. But I'll also freely admit that my elisp is quite rusty these days. The Pull request looks good to me. Is it ready to merge from your end? |
It is. The errors in CI look like they weren't introduced by me. |
Thank you @SqrtMinusOne
I see a couple of other things we could improve as well.
Anyway, it would be perfectly fine to merge it, and create a new issue to resolve one or the other point a little :-) later. |
Ah, regarding the CI, I know about it, I know how to fix it quickly, but I don't like my "dirty hotfix"🙈 |
I can do 1 and 3 in this PR a bit later, no big deal. As for 2 - I can write it as Org Mode devs do not seem to have a problem with hardcoding it, although I admit that core Emacs and ELPA often have lower code quality than what's required by MELPA. Hyperbole is still not admitted to MELPA... But anyway, I really don't like something such as this: (defconst org-journal--seconds-in-hour (* 60 60)
"The number of seconds in an hour.") |
Perhaps a |
Never mind. But we should ensure that I'll create a new task for the other two points (1 and 3). |
This makes
org-journal-open-current-file
respectorg-extend-today-until
. The variable is used the same way as inorg-today
.Yes, I had to invoke that function at 3 AM on Monday to discover that bug.