From: Don Armstrong Date: Mon, 21 Aug 2023 20:32:43 +0000 (-0700) Subject: use the built in appt package X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=75fca1d773f7f59037a4f063b7cd799e540f4424;p=lib.git use the built in appt package --- diff --git a/emacs_el/configuration/don-configuration.org b/emacs_el/configuration/don-configuration.org index 7701e6a..5cbe55e 100644 --- a/emacs_el/configuration/don-configuration.org +++ b/emacs_el/configuration/don-configuration.org @@ -2491,45 +2491,45 @@ same directory as the org-buffer and insert a link to this file." #+END_SRC ** appt integration #+BEGIN_SRC emacs-lisp - (use-package appt - :ensure f - :config - ;; Show notification 10 minutes before event - (setq appt-message-warning-time 10) - ;; Disable multiple reminders - (setq appt-display-interval appt-message-warning-time) - (setq appt-display-mode-line nil) - - ;; add automatic reminders for appointments - (defun my/org-agenda-to-appt () - (interactive) - (setq appt-time-msg-list nil) - (org-agenda-to-appt)) - ;; add reminders when starting emacs +(use-package appt + :straight nil + :config + ;; Show notification 10 minutes before event + (setq appt-message-warning-time 10) + ;; Disable multiple reminders + (setq appt-display-interval appt-message-warning-time) + (setq appt-display-mode-line nil) + + ;; add automatic reminders for appointments + (defun my/org-agenda-to-appt () + (interactive) + (setq appt-time-msg-list nil) + (org-agenda-to-appt)) + ;; add reminders when starting emacs + (my/org-agenda-to-appt) + ;; when rebuilding the agenda + (defadvice org-agenda-redo (after org-agenda-redo-add-appts) + "Pressing `r' on the agenda will also add appointments." (my/org-agenda-to-appt) - ;; when rebuilding the agenda - (defadvice org-agenda-redo (after org-agenda-redo-add-appts) - "Pressing `r' on the agenda will also add appointments." - (my/org-agenda-to-appt) - ) - ;; when saving all org buffers - (defadvice org-save-all-org-buffers (after org-save-all-org-buffers-add-appts) - "Re-add appts after saving all org buffers" - (my/org-agenda-to-appt)) - ;; Display appointments as a window manager notification - (setq appt-disp-window-function 'my/appt-display) - (setq appt-delete-window-function (lambda () t)) - - (setq my/appt-notification-app (concat (getenv "HOME") "/bin/appt_notification")) - - (defun my/appt-display (min-to-app new-time msg) - (if (atom min-to-app) - (start-process "my/appt-notification-app" nil my/appt-notification-app min-to-app msg) - (dolist (i (number-sequence 0 (1- (length min-to-app)))) - (start-process "my/appt-notification-app" nil my/appt-notification-app - (nth i min-to-app) (nth i msg)))) - ) ) + ;; when saving all org buffers + (defadvice org-save-all-org-buffers (after org-save-all-org-buffers-add-appts) + "Re-add appts after saving all org buffers" + (my/org-agenda-to-appt)) + ;; Display appointments as a window manager notification + (setq appt-disp-window-function 'my/appt-display) + (setq appt-delete-window-function (lambda () t)) + + (setq my/appt-notification-app (concat (getenv "HOME") "/bin/appt_notification")) + + (defun my/appt-display (min-to-app new-time msg) + (if (atom min-to-app) + (start-process "my/appt-notification-app" nil my/appt-notification-app min-to-app msg) + (dolist (i (number-sequence 0 (1- (length min-to-app)))) + (start-process "my/appt-notification-app" nil my/appt-notification-app + (nth i min-to-app) (nth i msg)))) + ) + ) #+END_SRC