diff options
| author | Liu Hui | 2026-01-09 21:56:52 +0800 |
|---|---|---|
| committer | Sean Whitton | 2026-01-10 12:21:12 +0000 |
| commit | 53225d8a3a4d8641c8e459658d4fcbc8d03d6e65 (patch) | |
| tree | 872ae0b015ce1d4ab17f74b5fc58478b57fe0ec5 | |
| parent | 09aad81166d2d1ebc97f3f480e70869427ef07d1 (diff) | |
| download | emacs-53225d8a3a4d8641c8e459658d4fcbc8d03d6e65.tar.gz emacs-53225d8a3a4d8641c8e459658d4fcbc8d03d6e65.zip | |
Fix cursor position in calendar-generate-window (bug#80069)
* lisp/calendar/calendar.el (calendar-generate-window): Move
cursor to today before running calendar-today-visible-hook.
| -rw-r--r-- | lisp/calendar/calendar.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 0d49a6571d5..2da45c18880 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -1450,9 +1450,12 @@ Optional integers MON and YR are used instead of today's date." | |||
| 1450 | (calendar-mark-holidays)) | 1450 | (calendar-mark-holidays)) |
| 1451 | (unwind-protect | 1451 | (unwind-protect |
| 1452 | (if calendar-mark-diary-entries (diary-mark-entries)) | 1452 | (if calendar-mark-diary-entries (diary-mark-entries)) |
| 1453 | (run-hooks (if (calendar-date-is-visible-p today) | 1453 | (if (not (calendar-date-is-visible-p today)) |
| 1454 | 'calendar-today-visible-hook | 1454 | (run-hooks 'calendar-today-invisible-hook) |
| 1455 | 'calendar-today-invisible-hook))))) | 1455 | ;; Functions in calendar-today-visible-hook may rely on the cursor |
| 1456 | ;; being on today's date. | ||
| 1457 | (calendar-cursor-to-visible-date today) | ||
| 1458 | (run-hooks 'calendar-today-visible-hook))))) | ||
| 1456 | 1459 | ||
| 1457 | (defun calendar-generate (month year) | 1460 | (defun calendar-generate (month year) |
| 1458 | "Generate a three-month Gregorian calendar centered around MONTH, YEAR." | 1461 | "Generate a three-month Gregorian calendar centered around MONTH, YEAR." |