diff options
| -rw-r--r-- | lisp/calendar/calendar.el | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 10498e5b088..3ea400a28af 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -1109,6 +1109,9 @@ with descriptive strings such as | |||
| 1109 | (defconst fancy-diary-buffer "*Fancy Diary Entries*" | 1109 | (defconst fancy-diary-buffer "*Fancy Diary Entries*" |
| 1110 | "Name of the buffer used for the optional fancy display of the diary.") | 1110 | "Name of the buffer used for the optional fancy display of the diary.") |
| 1111 | 1111 | ||
| 1112 | (defconst other-calendars-buffer "*Other Calendars*" | ||
| 1113 | "Name of the buffer used for the display of date on other calendars.") | ||
| 1114 | |||
| 1112 | (defconst lunar-phases-buffer "*Phases of Moon*" | 1115 | (defconst lunar-phases-buffer "*Phases of Moon*" |
| 1113 | "Name of the buffer used for the lunar phases.") | 1116 | "Name of the buffer used for the lunar phases.") |
| 1114 | 1117 | ||
| @@ -1943,6 +1946,7 @@ the inserted text. Value is always t." | |||
| 1943 | (define-key calendar-mode-map "pi" 'calendar-print-islamic-date) | 1946 | (define-key calendar-mode-map "pi" 'calendar-print-islamic-date) |
| 1944 | (define-key calendar-mode-map "pf" 'calendar-print-french-date) | 1947 | (define-key calendar-mode-map "pf" 'calendar-print-french-date) |
| 1945 | (define-key calendar-mode-map "pm" 'calendar-print-mayan-date) | 1948 | (define-key calendar-mode-map "pm" 'calendar-print-mayan-date) |
| 1949 | (define-key calendar-mode-map "po" 'calendar-print-other-dates) | ||
| 1946 | (define-key calendar-mode-map "id" 'insert-diary-entry) | 1950 | (define-key calendar-mode-map "id" 'insert-diary-entry) |
| 1947 | (define-key calendar-mode-map "iw" 'insert-weekly-diary-entry) | 1951 | (define-key calendar-mode-map "iw" 'insert-weekly-diary-entry) |
| 1948 | (define-key calendar-mode-map "im" 'insert-monthly-diary-entry) | 1952 | (define-key calendar-mode-map "im" 'insert-monthly-diary-entry) |
| @@ -2514,6 +2518,53 @@ Defaults to today's date if DATE is not given." | |||
| 2514 | (format "Day %d of %d; %d day%s remaining in the year" | 2518 | (format "Day %d of %d; %d day%s remaining in the year" |
| 2515 | day year days-remaining (if (= days-remaining 1) "" "s")))) | 2519 | day year days-remaining (if (= days-remaining 1) "" "s")))) |
| 2516 | 2520 | ||
| 2521 | (defun calendar-print-other-dates () | ||
| 2522 | "Show dates on other calendars for date under the cursor." | ||
| 2523 | (interactive) | ||
| 2524 | (let* ((date (calendar-cursor-to-date t))) | ||
| 2525 | (save-excursion | ||
| 2526 | (set-buffer (get-buffer-create other-calendars-buffer)) | ||
| 2527 | (setq buffer-read-only nil) | ||
| 2528 | (calendar-set-mode-line | ||
| 2529 | (concat (calendar-date-string date) " (Gregorian)")) | ||
| 2530 | (erase-buffer) | ||
| 2531 | (insert | ||
| 2532 | (mapconcat 'identity | ||
| 2533 | (list (calendar-day-of-year-string date) | ||
| 2534 | (format "ISO date: %s" (calendar-iso-date-string date)) | ||
| 2535 | (format "Julian date: %s" | ||
| 2536 | (calendar-julian-date-string date)) | ||
| 2537 | (format | ||
| 2538 | "Astronomical (Julian) day number (at noon UTC): %s.0" | ||
| 2539 | (calendar-astro-date-string date)) | ||
| 2540 | (format "Fixed (RD) date: %s" | ||
| 2541 | (calendar-absolute-from-gregorian date)) | ||
| 2542 | (format "Hebrew date (before sunset): %s" | ||
| 2543 | (calendar-hebrew-date-string date)) | ||
| 2544 | (format "Persian date: %s" | ||
| 2545 | (calendar-persian-date-string date)) | ||
| 2546 | (let ((i (calendar-islamic-date-string date))) | ||
| 2547 | (if (not (string-equal i "")) | ||
| 2548 | (format "Islamic date (before sunset): %s" i))) | ||
| 2549 | (format "Chinese date: %s" | ||
| 2550 | (calendar-chinese-date-string date)) | ||
| 2551 | (let ((c (calendar-coptic-date-string date))) | ||
| 2552 | (if (not (string-equal c "")) | ||
| 2553 | (format "Coptic date: %s" c))) | ||
| 2554 | (let ((e (calendar-ethiopic-date-string date))) | ||
| 2555 | (if (not (string-equal e "")) | ||
| 2556 | (format "Ethiopic date: %s" e))) | ||
| 2557 | (let ((f (calendar-french-date-string date))) | ||
| 2558 | (if (not (string-equal f "")) | ||
| 2559 | (format "French Revolutionary date: %s" f))) | ||
| 2560 | (format "Mayan date: %s" | ||
| 2561 | (calendar-mayan-date-string date))) | ||
| 2562 | "\n")) | ||
| 2563 | (goto-char (point-min)) | ||
| 2564 | (set-buffer-modified-p nil) | ||
| 2565 | (setq buffer-read-only t) | ||
| 2566 | (display-buffer other-calendars-buffer)))) | ||
| 2567 | |||
| 2517 | (defun calendar-print-day-of-year () | 2568 | (defun calendar-print-day-of-year () |
| 2518 | "Show day number in year/days remaining in year for date under the cursor." | 2569 | "Show day number in year/days remaining in year for date under the cursor." |
| 2519 | (interactive) | 2570 | (interactive) |