From 514bf47c3c3ae79f7a72dd058f70dc01cc7b0e9c Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Mon, 4 Nov 2024 08:39:17 +0200 Subject: . --- home/dots/.emacs | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'home') diff --git a/home/dots/.emacs b/home/dots/.emacs index e7f6cc6..2316f72 100644 --- a/home/dots/.emacs +++ b/home/dots/.emacs @@ -798,22 +798,29 @@ :diminish auto-revert-mode) (use-package appt + :after org-agenda :demand t ;; Taken from https://igormelo.org/you_dont_need_org_alert.html ;; Enables notifications for org - :init + :config (setq appt-message-warning-time 15 appt-display-interval 5 - appt-disp-window-function (lambda (remaining new-time msg) - (notifications-notify - :title (message "In %s minutes" remaining) - :body msg - :urgency 'critical))) - (advice-add 'appt-check - :before - (lambda (&rest args) - (let ((inhibit-message t)) - (org-agenda-to-appt t)))) + appt-disp-window-function (lambda (minutes-to now text) + (org-show-notification + (format "Appointment in %s minutes:\n%s" + minutes-to text)))) + + (define-advice appt-activate (:after (&optional _arg) hold-your-horses) + "`appt-activate' is too eager, rein it in." + (remove-hook 'write-file-functions #'appt-update-list) + (when (timerp appt-timer) + (timer-set-time appt-timer (current-time) 600))) + (define-advice appt-check (:before (&optional _force) from-org-agenda) + "Read events from Org agenda if possible." + (and (featurep 'org-agenda) + (ignore-errors + (let ((inhibit-message t)) + (org-agenda-to-appt t))))) (appt-activate t)) (use-package rec-mode -- cgit v1.2.3