summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2023-04-24 19:04:50 +0100
committerYann Herklotz <git@yannherklotz.com>2023-04-24 19:06:20 +0100
commit5d4cadf99d7eb789b64d04f863e15b04ec04cf0e (patch)
tree1a9f7d573602fb2b566f29a7f309cded6f336e55
parentf6cb72eea99edd8c60d724a51fcf314bde491c41 (diff)
downloadymh-emacs-5d4cadf99d7eb789b64d04f863e15b04ec04cf0e.tar.gz
ymh-emacs-5d4cadf99d7eb789b64d04f863e15b04ec04cf0e.zip
Fix diary schedule function
-rw-r--r--ymh-emacs/ymh-diary.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/ymh-emacs/ymh-diary.el b/ymh-emacs/ymh-diary.el
index 4bbef62..817eedb 100644
--- a/ymh-emacs/ymh-diary.el
+++ b/ymh-emacs/ymh-diary.el
@@ -10,11 +10,12 @@
;;; Code:
-(defun ymh-diary-schedule (y1 m1 d1 y2 m2 d2 dayname)
+(defun ymh-diary-schedule (y1 m1 d1 y2 m2 d2 dayname &optional mark)
"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."
+ (with-no-warnings (defvar date) (defvar entry))
(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)))
@@ -24,7 +25,7 @@
(= (calendar-day-of-week date) dayname)
;;(not (calendar-check-holidays date))
)
- entry)))
+ (cons mark entry))))
(defun ymh-diary-last-day-of-month (date)
"Return `t` if DATE is the last day of the month."
@@ -35,7 +36,7 @@
(calendar-last-day-of-month month year)))
(= day last-day-of-month)))
-(defun ymh-diary-export-to-ics ()
+(defun ymh-diary-org-export-to-ics ()
"Export diary file to ICal format."
(with-temp-buffer
(insert-file-contents diary-file)
@@ -49,6 +50,13 @@ X-WR-CALNAME:Emacs
X-Built-On-Cache-Miss:true
" ics-file-body "END:VCALENDAR")))
+(defun ymh-diary-export-to-ics ()
+ "Export the current diary to ICS format."
+ (interactive)
+ (icalendar-export-file
+ diary-file
+ (expand-file-name "emacs.ics" "~/Downloads")))
+
(provide 'ymh-diary)
;;; ymh-diary.el ends here