diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/calendar/icalendar.el | 53 |
1 files changed, 37 insertions, 16 deletions
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index e7ad7383456..2f557f547af 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el | |||
| @@ -2389,22 +2389,43 @@ END-T is the event's end time in diary format." | |||
| 2389 | ;; monthly | 2389 | ;; monthly |
| 2390 | ((string-equal frequency "MONTHLY") | 2390 | ((string-equal frequency "MONTHLY") |
| 2391 | (icalendar--dmsg "monthly") | 2391 | (icalendar--dmsg "monthly") |
| 2392 | (setq result | 2392 | (let* ((byday (cadr (assoc 'BYDAY rrule-props))) |
| 2393 | (format | 2393 | (count-weekday |
| 2394 | "%%%%(and (diary-date %s) (diary-block %s %s)) %s%s%s" | 2394 | (and byday |
| 2395 | (let ((day (nth 3 dtstart-dec))) | 2395 | (save-match-data |
| 2396 | (cond ((eq calendar-date-style 'iso) | 2396 | (when (string-match "\\(-?[0-9]+\\)\\([A-Z][A-Z]\\)" |
| 2397 | (format "t t %d" day)) | 2397 | byday) |
| 2398 | ((eq calendar-date-style 'european) | 2398 | (cons (substring byday |
| 2399 | (format "%d t t" day)) | 2399 | (match-beginning 1) |
| 2400 | ((eq calendar-date-style 'american) | 2400 | (match-end 1)) |
| 2401 | (format "t %d t" day)))) | 2401 | (substring byday |
| 2402 | dtstart-conv | 2402 | (match-beginning 2) |
| 2403 | (if until | 2403 | (match-end 2))))))) |
| 2404 | until-conv | 2404 | (rule-part |
| 2405 | (if (eq calendar-date-style 'iso) "9999 1 1" "1 1 9999")) ;; FIXME: should be unlimited | 2405 | (if count-weekday |
| 2406 | (or start-t "") | 2406 | (let ((count (car count-weekday)) |
| 2407 | (if end-t "-" "") (or end-t "")))) | 2407 | (weekdaynum (icalendar--get-weekday-number |
| 2408 | (cdr count-weekday)))) | ||
| 2409 | ;; FIXME: this is valid only for interval==1 | ||
| 2410 | (format "(diary-float t %s %s)" weekdaynum count)) | ||
| 2411 | (format "(diary-date %s)" | ||
| 2412 | (let ((day (nth 3 dtstart-dec))) | ||
| 2413 | (cond ((eq calendar-date-style 'iso) | ||
| 2414 | (format "t t %d" day)) | ||
| 2415 | ((eq calendar-date-style 'european) | ||
| 2416 | (format "%d t t" day)) | ||
| 2417 | ((eq calendar-date-style 'american) | ||
| 2418 | (format "t %d t" day)))))))) | ||
| 2419 | (setq result | ||
| 2420 | (format | ||
| 2421 | "%%%%(and %s (diary-block %s %s)) %s%s%s" | ||
| 2422 | rule-part | ||
| 2423 | dtstart-conv | ||
| 2424 | (if until | ||
| 2425 | until-conv | ||
| 2426 | (if (eq calendar-date-style 'iso) "9999 1 1" "1 1 9999")) ;; FIXME: should be unlimited | ||
| 2427 | (or start-t "") | ||
| 2428 | (if end-t "-" "") (or end-t ""))))) | ||
| 2408 | ;; daily | 2429 | ;; daily |
| 2409 | ((and (string-equal frequency "DAILY")) | 2430 | ((and (string-equal frequency "DAILY")) |
| 2410 | (if until | 2431 | (if until |