diff options
| -rw-r--r-- | lisp/calendar/cal-menu.el | 76 |
1 files changed, 50 insertions, 26 deletions
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el index a7dd1077b60..ddf00675cda 100644 --- a/lisp/calendar/cal-menu.el +++ b/lisp/calendar/cal-menu.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; cal-menu.el --- calendar functions for menu bar and popup menu support | 1 | ;;; cal-menu.el --- calendar functions for menu bar and popup menu support |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1994 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> | 5 | ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> |
| 6 | ;; Lara Rios <lrios@coewl.cen.uiuc.edu> | 6 | ;; Lara Rios <lrios@coewl.cen.uiuc.edu> |
| @@ -100,6 +100,12 @@ | |||
| 100 | '("French Date" . calendar-goto-french-date)) | 100 | '("French Date" . calendar-goto-french-date)) |
| 101 | (define-key calendar-mode-map [menu-bar goto mayan] | 101 | (define-key calendar-mode-map [menu-bar goto mayan] |
| 102 | (cons "Mayan Date" (make-sparse-keymap "Mayan"))) | 102 | (cons "Mayan Date" (make-sparse-keymap "Mayan"))) |
| 103 | (define-key calendar-mode-map [menu-bar goto ethiopic] | ||
| 104 | '("Ethiopic Date" . calendar-goto-ethiopic-date)) | ||
| 105 | (define-key calendar-mode-map [menu-bar goto coptic] | ||
| 106 | '("Coptic Date" . calendar-goto-coptic-date)) | ||
| 107 | (define-key calendar-mode-map [menu-bar goto chinese] | ||
| 108 | '("Chinese Date" . calendar-goto-chinese-date)) | ||
| 103 | (define-key calendar-mode-map [menu-bar goto julian] | 109 | (define-key calendar-mode-map [menu-bar goto julian] |
| 104 | '("Julian Date" . calendar-goto-julian-date)) | 110 | '("Julian Date" . calendar-goto-julian-date)) |
| 105 | (define-key calendar-mode-map [menu-bar goto islamic] | 111 | (define-key calendar-mode-map [menu-bar goto islamic] |
| @@ -268,30 +274,48 @@ ERROR is t, otherwise just returns nil." | |||
| 268 | (defun calendar-mouse-print-dates () | 274 | (defun calendar-mouse-print-dates () |
| 269 | "Pop up menu of equivalent dates to mouse selected date." | 275 | "Pop up menu of equivalent dates to mouse selected date." |
| 270 | (interactive) | 276 | (interactive) |
| 271 | (let ((date (calendar-event-to-date))) | 277 | (let ((date (calendar-event-to-date)) |
| 272 | (x-popup-menu | 278 | (selection |
| 273 | event | 279 | (x-popup-menu |
| 274 | (list | 280 | event |
| 275 | "Date Menu" | 281 | (list |
| 276 | (append | 282 | "Date Menu" |
| 277 | (list | 283 | (append |
| 278 | (concat (calendar-date-string date) " (Gregorian)") | 284 | (list |
| 279 | (list (calendar-day-of-year-string date)) | 285 | (concat (calendar-date-string date) " (Gregorian)") |
| 280 | (list (format "ISO date: %s" (calendar-iso-date-string date))) | 286 | (list (calendar-day-of-year-string date)) |
| 281 | (list (format "Julian date: %s" (calendar-julian-date-string date))) | 287 | (list (format "ISO date: %s" (calendar-iso-date-string date))) |
| 282 | (list (format "Astronomical (Julian) date (before noon): %s" | 288 | (list (format "Julian date: %s" |
| 283 | (calendar-astro-date-string date))) | 289 | (calendar-julian-date-string date))) |
| 284 | (list (format "Hebrew date (before sunset): %s" | 290 | (list |
| 285 | (calendar-hebrew-date-string date)))) | 291 | (format "Astronomical (Julian) day number (after noon UTC): %s" |
| 286 | (let ((i (calendar-islamic-date-string date))) | 292 | (calendar-astro-date-string date))) |
| 287 | (if (not (string-equal i "")) | 293 | (list (format "Hebrew date (before sunset): %s" |
| 288 | (list (list (format "Islamic date (before sunset): %s" i))))) | 294 | (calendar-hebrew-date-string date)))) |
| 289 | (let ((f (calendar-french-date-string date))) | 295 | (let ((i (calendar-islamic-date-string date))) |
| 290 | (if (not (string-equal f "")) | 296 | (if (not (string-equal i "")) |
| 291 | (list (list (format "French Revolutionary date: %s" f))))) | 297 | (list (list (format "Islamic date (before sunset): %s" i))))) |
| 292 | (list | 298 | ; too slow to leave this in all the time! |
| 293 | (list | 299 | ; (list |
| 294 | (format "Mayan date: %s" (calendar-mayan-date-string date))))))))) | 300 | ; (list (format "Chinese date: %s" (calendar-chinese-date-string date)))) |
| 301 | ; so instead, | ||
| 302 | (list '("Chinese date (select to echo Chinese date)" | ||
| 303 | . calendar-print-chinese-date)) | ||
| 304 | (let ((c (calendar-coptic-date-string date))) | ||
| 305 | (if (not (string-equal c "")) | ||
| 306 | (list (list (format "Coptic date: %s" c))))) | ||
| 307 | (let ((e (calendar-ethiopic-date-string date))) | ||
| 308 | (if (not (string-equal e "")) | ||
| 309 | (list (list (format "Ethiopic date: %s" e))))) | ||
| 310 | (let ((f (calendar-french-date-string date))) | ||
| 311 | (if (not (string-equal f "")) | ||
| 312 | (list (list (format "French Revolutionary date: %s" f))))) | ||
| 313 | (list | ||
| 314 | (list | ||
| 315 | (format "Mayan date: %s" | ||
| 316 | (calendar-mayan-date-string date))))))))) | ||
| 317 | (and selection (call-interactively selection)))) | ||
| 318 | |||
| 295 | 319 | ||
| 296 | (defun calendar-mouse-2-date-menu (event) | 320 | (defun calendar-mouse-2-date-menu (event) |
| 297 | "Pop up menu for Mouse-2 for selected date in the calendar window." | 321 | "Pop up menu for Mouse-2 for selected date in the calendar window." |
| @@ -302,7 +326,7 @@ ERROR is t, otherwise just returns nil." | |||
| 302 | event | 326 | event |
| 303 | (list "Menu" | 327 | (list "Menu" |
| 304 | (list | 328 | (list |
| 305 | (calendar-date-string date t t) | 329 | (calendar-date-string date t nil) |
| 306 | '("Holidays" . calendar-mouse-holidays) | 330 | '("Holidays" . calendar-mouse-holidays) |
| 307 | '("Mark date" . calendar-mouse-set-mark) | 331 | '("Mark date" . calendar-mouse-set-mark) |
| 308 | '("Sunrise/sunset" . calendar-mouse-sunrise/sunset) | 332 | '("Sunrise/sunset" . calendar-mouse-sunrise/sunset) |