org-timed-alerts
org-timed-alerts copied to clipboard
slows down my agenda, could run hook on idle instead?
I noticed it was severely slowing down my agenda display (75% of time spent says profiler), so I turned (setq org-timed-alerts-agenda-hook-p nil)
and used this instead:
(defvar my-org-timed-alerts-set-all-timers-timer nil)
(defun my-org-timed-alerts-set-all-timers ()
"Set all timers on idle."
(when (timerp my-org-timed-alerts-set-all-timers-timer)
(cancel-timer my-org-timed-alerts-set-all-timers-timer))
(setq my-org-timed-alerts-set-all-timers-timer
(run-with-idle-timer 10 nil #'org-timed-alerts-set-all-timers)))
(add-hook 'org-agenda-mode-hook #'my-org-timed-alerts-set-all-timers)
Would you like a PR or do you prefer to keep the code simple? (Thought I'd share at least in case others find it useful.)
I agree the agenda hook isn't ideal and I've found it frustrating when scrolling through days in the agenda view. I like the idle timer idea. Let me mess with this in the next week or two and figure out the best way to handle it.