diff options
| author | Jacob S. Gordon | 2026-01-08 16:20:00 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2026-01-10 15:37:55 +0200 |
| commit | 57df5d5cbaf88b21ad53152b145b5b0c8303951d (patch) | |
| tree | f7108112636ad709ce05738ecb0e42c33b8bda59 | |
| parent | e13642593276b25c5032ec9254aeb23feb2d313c (diff) | |
| download | emacs-57df5d5cbaf88b21ad53152b145b5b0c8303951d.tar.gz emacs-57df5d5cbaf88b21ad53152b145b5b0c8303951d.zip | |
; 'holiday-float': Improve documentation of edge case
When MONTH DAY falls on DAYNAME the holiday may be closer to MONTH DAY
than expected. Describe this situation in the function's doc string.
(Bug#00000)
* lisp/calendar/holidays.el (holiday-float): Improve documentation.
| -rw-r--r-- | lisp/calendar/holidays.el | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 3acaf9b91e2..696a5b50aa1 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el | |||
| @@ -654,10 +654,17 @@ STRING)). Returns nil if it is not visible in the current calendar window." | |||
| 654 | 654 | ||
| 655 | (defun holiday-float (month dayname n string &optional day) | 655 | (defun holiday-float (month dayname n string &optional day) |
| 656 | "Holiday called STRING on the Nth DAYNAME after/before MONTH DAY. | 656 | "Holiday called STRING on the Nth DAYNAME after/before MONTH DAY. |
| 657 | DAYNAME=0 means Sunday, DAYNAME=1 means Monday, and so on. | 657 | DAYNAME = 0 means Sunday, DAYNAME = 1 means Monday, and so on. DAY |
| 658 | If N>0, use the Nth DAYNAME after MONTH DAY. | 658 | defaults to 1 if N > 0, and MONTH's last day otherwise. |
| 659 | If N<0, use the Nth DAYNAME before MONTH DAY. | 659 | |
| 660 | DAY defaults to 1 if N>0, and MONTH's last day otherwise. | 660 | If N > 0, use the Nth DAYNAME after MONTH DAY. |
| 661 | If N < 0, use the Nth DAYNAME before MONTH DAY. | ||
| 662 | |||
| 663 | When MONTH DAY falls on DAYNAME, the holiday will be |N|-1 weeks before | ||
| 664 | or after MONTH DAY. For example, with N = +1 (-1) the holiday falls on | ||
| 665 | MONTH DAY, and with N = +2 (-2) the holiday falls 1 week after (before) | ||
| 666 | MONTH DAY. | ||
| 667 | |||
| 661 | If the holiday is visible in the calendar window, returns a | 668 | If the holiday is visible in the calendar window, returns a |
| 662 | list (((month day year) STRING)). Otherwise returns nil." | 669 | list (((month day year) STRING)). Otherwise returns nil." |
| 663 | ;; This is messy because the holiday may be visible, while the date | 670 | ;; This is messy because the holiday may be visible, while the date |