Commit 811a8484 authored by John Wiegley's avatar John Wiegley

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.
parent 4403b1e1
This diff is collapsed.
......@@ -66,6 +66,8 @@
'("Insert Hebrew" . calendar-mouse-insert-hebrew-diary-entry))
(define-key calendar-mode-map [menu-bar diary isl]
'("Insert Islamic" . calendar-mouse-insert-islamic-diary-entry))
(define-key calendar-mode-map [menu-bar diary baha]
'("Insert Baha'i" . calendar-mouse-insert-bahai-diary-entry))
(define-key calendar-mode-map [menu-bar diary cyc]
'("Insert Cyclic" . insert-cyclic-diary-entry))
(define-key calendar-mode-map [menu-bar diary blk]
......@@ -109,6 +111,8 @@
'("Julian Date" . calendar-goto-julian-date))
(define-key calendar-mode-map [menu-bar goto islamic]
'("Islamic Date" . calendar-goto-islamic-date))
(define-key calendar-mode-map [menu-bar goto persian]
'("Baha'i Date" . calendar-goto-bahai-date))
(define-key calendar-mode-map [menu-bar goto persian]
'("Persian Date" . calendar-goto-persian-date))
(define-key calendar-mode-map [menu-bar goto hebrew]
......@@ -288,6 +292,19 @@ ERROR is t, otherwise just returns nil."
'("Yearly" . insert-yearly-islamic-diary-entry))))))
(and islamic-selection (call-interactively islamic-selection))))
(defun calendar-mouse-insert-bahai-diary-entry (event)
"Pop up menu to insert an Baha'i-date diary entry."
(interactive "e")
(let ((bahai-selection
(x-popup-menu
event
(list "Baha'i insert menu"
(list (calendar-bahai-date-string (calendar-cursor-to-date))
'("One time" . insert-bahai-diary-entry)
'("Monthly" . insert-monthly-bahai-diary-entry)
'("Yearly" . insert-yearly-bahai-diary-entry))))))
(and bahai-selection (call-interactively bahai-selection))))
(defun calendar-mouse-sunrise/sunset ()
"Show sunrise/sunset times for mouse-selected date."
(interactive)
......@@ -496,7 +513,9 @@ The output is in landscape format, one month to a page."
(list (format "Hebrew date (before sunset): %s"
(calendar-hebrew-date-string date)))
(list (format "Persian date: %s"
(calendar-persian-date-string date))))
(calendar-persian-date-string date)))
(list (format "Baha'i date (before sunset): %s"
(calendar-bahai-date-string date))))
(let ((i (calendar-islamic-date-string date)))
(if (not (string-equal i ""))
(list (list (format "Islamic date (before sunset): %s" i)))))
......
This diff is collapsed.
......@@ -123,6 +123,22 @@ The holidays are those in the list `calendar-holidays'.")
(autoload 'mark-islamic-calendar-date-pattern "cal-islam"
"Mark dates in calendar window that conform to Islamic date MONTH/DAY/YEAR.")
(autoload 'diary-bahai-date "cal-bahai"
"Baha'i calendar equivalent of date diary entry."
t)
(autoload 'list-bahai-diary-entries "cal-bahai"
"Add any Baha'i date entries from the diary file to `diary-entries-list'."
t)
(autoload 'mark-bahai-diary-entries "cal-bahai"
"Mark days in the calendar window that have Baha'i date diary entries."
t)
(autoload 'mark-bahai-calendar-date-pattern "cal-bahai"
"Mark dates in calendar window that conform to Baha'i date MONTH/DAY/YEAR."
t)
(autoload 'diary-hebrew-date "cal-hebrew"
"Hebrew calendar equivalent of date diary entry.")
......@@ -1129,6 +1145,8 @@ be used instead of a colon (:) to separate the hour and minute parts."
0 1200)))
(t diary-unknown-time)))) ; Unrecognizable
;; Unrecognizable
(defun list-sexp-diary-entries (date)
"Add sexp entries for DATE from the diary file to `diary-entries-list'.
Also, Make them visible in the diary file. Returns t if any entries were
......
......@@ -84,6 +84,10 @@
"Holiday on MONTH, DAY (Islamic) called STRING."
t)
(autoload 'holiday-bahai "cal-bahai"
"Holiday on MONTH, DAY (Baha'i) called STRING."
t)
(autoload 'holiday-chinese-new-year "cal-china"
"Date of Chinese New Year."
t)
......@@ -141,6 +145,7 @@ The optional LABEL is used to label the buffer created."
(if christian-holidays (cons "Christian" christian-holidays))
(if hebrew-holidays (cons "Hebrew" hebrew-holidays))
(if islamic-holidays (cons "Islamic" islamic-holidays))
(if bahai-holidays (cons "Baha'i" bahai-holidays))
(if oriental-holidays (cons "Oriental" oriental-holidays))
(if solar-holidays (cons "Solar" solar-holidays))
(cons "Ask" nil)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment