Mercurial > emacs
comparison lisp/calendar/cal-menu.el @ 55431:b278cb498cc8
2004-05-08 John Wiegley <johnw@newartisans.com>
* calendar/cal-bahai.el: New file, which adds support for the
Baha'i calendar to Emacs. This calendar is based on a solar year
of 19 months of 19 days, with 4 intercalary days. Each year
begins on March 21, with the calendar starting in 1844.
* calendar/cal-menu.el, calendar/calendar.el,
calendar/diary-lib.el, calendar/holidays.el: Added support for
using cal-bahai.el.
author | John Wiegley <johnw@newartisans.com> |
---|---|
date | Sat, 08 May 2004 12:42:07 +0000 |
parents | 695cf19ef79e |
children | 670acab99124 4c90ffeb71c5 |
comparison
equal
deleted
inserted
replaced
55430:8a3af63fa397 | 55431:b278cb498cc8 |
---|---|
64 | 64 |
65 (define-key calendar-mode-map [menu-bar diary heb] | 65 (define-key calendar-mode-map [menu-bar diary heb] |
66 '("Insert Hebrew" . calendar-mouse-insert-hebrew-diary-entry)) | 66 '("Insert Hebrew" . calendar-mouse-insert-hebrew-diary-entry)) |
67 (define-key calendar-mode-map [menu-bar diary isl] | 67 (define-key calendar-mode-map [menu-bar diary isl] |
68 '("Insert Islamic" . calendar-mouse-insert-islamic-diary-entry)) | 68 '("Insert Islamic" . calendar-mouse-insert-islamic-diary-entry)) |
69 (define-key calendar-mode-map [menu-bar diary baha] | |
70 '("Insert Baha'i" . calendar-mouse-insert-bahai-diary-entry)) | |
69 (define-key calendar-mode-map [menu-bar diary cyc] | 71 (define-key calendar-mode-map [menu-bar diary cyc] |
70 '("Insert Cyclic" . insert-cyclic-diary-entry)) | 72 '("Insert Cyclic" . insert-cyclic-diary-entry)) |
71 (define-key calendar-mode-map [menu-bar diary blk] | 73 (define-key calendar-mode-map [menu-bar diary blk] |
72 '("Insert Block" . insert-block-diary-entry)) | 74 '("Insert Block" . insert-block-diary-entry)) |
73 (define-key calendar-mode-map [menu-bar diary ann] | 75 (define-key calendar-mode-map [menu-bar diary ann] |
107 '("Chinese Date" . calendar-goto-chinese-date)) | 109 '("Chinese Date" . calendar-goto-chinese-date)) |
108 (define-key calendar-mode-map [menu-bar goto julian] | 110 (define-key calendar-mode-map [menu-bar goto julian] |
109 '("Julian Date" . calendar-goto-julian-date)) | 111 '("Julian Date" . calendar-goto-julian-date)) |
110 (define-key calendar-mode-map [menu-bar goto islamic] | 112 (define-key calendar-mode-map [menu-bar goto islamic] |
111 '("Islamic Date" . calendar-goto-islamic-date)) | 113 '("Islamic Date" . calendar-goto-islamic-date)) |
114 (define-key calendar-mode-map [menu-bar goto persian] | |
115 '("Baha'i Date" . calendar-goto-bahai-date)) | |
112 (define-key calendar-mode-map [menu-bar goto persian] | 116 (define-key calendar-mode-map [menu-bar goto persian] |
113 '("Persian Date" . calendar-goto-persian-date)) | 117 '("Persian Date" . calendar-goto-persian-date)) |
114 (define-key calendar-mode-map [menu-bar goto hebrew] | 118 (define-key calendar-mode-map [menu-bar goto hebrew] |
115 '("Hebrew Date" . calendar-goto-hebrew-date)) | 119 '("Hebrew Date" . calendar-goto-hebrew-date)) |
116 (define-key calendar-mode-map [menu-bar goto astro] | 120 (define-key calendar-mode-map [menu-bar goto astro] |
286 '("One time" . insert-islamic-diary-entry) | 290 '("One time" . insert-islamic-diary-entry) |
287 '("Monthly" . insert-monthly-islamic-diary-entry) | 291 '("Monthly" . insert-monthly-islamic-diary-entry) |
288 '("Yearly" . insert-yearly-islamic-diary-entry)))))) | 292 '("Yearly" . insert-yearly-islamic-diary-entry)))))) |
289 (and islamic-selection (call-interactively islamic-selection)))) | 293 (and islamic-selection (call-interactively islamic-selection)))) |
290 | 294 |
295 (defun calendar-mouse-insert-bahai-diary-entry (event) | |
296 "Pop up menu to insert an Baha'i-date diary entry." | |
297 (interactive "e") | |
298 (let ((bahai-selection | |
299 (x-popup-menu | |
300 event | |
301 (list "Baha'i insert menu" | |
302 (list (calendar-bahai-date-string (calendar-cursor-to-date)) | |
303 '("One time" . insert-bahai-diary-entry) | |
304 '("Monthly" . insert-monthly-bahai-diary-entry) | |
305 '("Yearly" . insert-yearly-bahai-diary-entry)))))) | |
306 (and bahai-selection (call-interactively bahai-selection)))) | |
307 | |
291 (defun calendar-mouse-sunrise/sunset () | 308 (defun calendar-mouse-sunrise/sunset () |
292 "Show sunrise/sunset times for mouse-selected date." | 309 "Show sunrise/sunset times for mouse-selected date." |
293 (interactive) | 310 (interactive) |
294 (save-excursion | 311 (save-excursion |
295 (calendar-mouse-goto-date (calendar-event-to-date)) | 312 (calendar-mouse-goto-date (calendar-event-to-date)) |
494 (format "Fixed (RD) date: %s" | 511 (format "Fixed (RD) date: %s" |
495 (calendar-absolute-from-gregorian date))) | 512 (calendar-absolute-from-gregorian date))) |
496 (list (format "Hebrew date (before sunset): %s" | 513 (list (format "Hebrew date (before sunset): %s" |
497 (calendar-hebrew-date-string date))) | 514 (calendar-hebrew-date-string date))) |
498 (list (format "Persian date: %s" | 515 (list (format "Persian date: %s" |
499 (calendar-persian-date-string date)))) | 516 (calendar-persian-date-string date))) |
517 (list (format "Baha'i date (before sunset): %s" | |
518 (calendar-bahai-date-string date)))) | |
500 (let ((i (calendar-islamic-date-string date))) | 519 (let ((i (calendar-islamic-date-string date))) |
501 (if (not (string-equal i "")) | 520 (if (not (string-equal i "")) |
502 (list (list (format "Islamic date (before sunset): %s" i))))) | 521 (list (list (format "Islamic date (before sunset): %s" i))))) |
503 (list | 522 (list |
504 (list (format "Chinese date: %s" | 523 (list (format "Chinese date: %s" |