diff options
Diffstat (limited to 'doom')
-rw-r--r-- | doom/config.el | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/doom/config.el b/doom/config.el index 591e496..0eaca7b 100644 --- a/doom/config.el +++ b/doom/config.el @@ -400,13 +400,27 @@ (define-key map (kbd "i a") #'diary-insert-anniversary-entry) (define-key map (kbd "i c") #'diary-insert-cyclic-entry) (define-key map (kbd "i d") #'diary-insert-entry) ; for current "day" - (define-key map (kbd "i i") #'diary-insert-entry) ; most common action, easier to type (define-key map (kbd "i m") #'diary-insert-monthly-entry) (define-key map (kbd "i w") #'diary-insert-weekly-entry) (define-key map (kbd "i y") #'diary-insert-yearly-entry) (define-key map (kbd "M-n") #'calendar-forward-month) (define-key map (kbd "M-p") #'calendar-backward-month)) + (defun diary-schedule (y1 m1 d1 y2 m2 d2 dayname) + "Entry applies if date is between dates on DAYNAME. + Order of the parameters is M1, D1, Y1, M2, D2, Y2 if + `european-calendar-style' is nil, and D1, M1, Y1, D2, M2, Y2 if + `european-calendar-style' is t. Entry does not apply on a history." + (let ((date1 (calendar-absolute-from-gregorian (list m1 d1 y1))) + (date2 (calendar-absolute-from-gregorian (list m2 d2 y2))) + (d (calendar-absolute-from-gregorian date))) + (if (and + (<= date1 d) + (<= d date2) + (= (calendar-day-of-week date) dayname) + (not (calendar-check-holidays date))) + entry))) + (require 'ox-extra) (ox-extras-activate '(ignore-headlines)) |