Created
March 31, 2020 20:15
-
-
Save thomp/a1790d76fa5b3937c46b73a94ba09ba7 to your computer and use it in GitHub Desktop.
run emacs diary if idle and we're on a new day
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar dat-diary-idle-timer | |
;; day of week | |
(let ((dat-ran-diary-on-day -1) | |
(idle-sec 600)) | |
(run-with-idle-timer | |
idle-sec | |
t | |
#'(lambda () | |
;; check if we've run diary yet today | |
(let ((day-number (calendar-day-of-week (calendar-current-date))))) | |
(when (not (= (dat-ran-diary-on-day) | |
day-number)) | |
(setf dat-ran-diary-on-day day-number) | |
(diary)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment