;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:37:14 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/calendar/cal-persia.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`cal-persia.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\302\303!\210\301B\304\301!\204 \305\302\207" [current-load-list persian-calendar-month-name-array require cal-julian boundp ["Farvardin" "Ordibehest" "Xordad" "Tir" "Mordad" "Sahrivar" "Mehr" "Aban" "Azar" "Dey" "Bahman" "Esfand"]] 2)
#@75 Absolute date of start of Persian calendar = March 19, 622 A.D. (Julian).
(defvar persian-calendar-epoch (calendar-absolute-from-julian '(3 19 622)) (#$ . 883))
#@54 True if YEAR is a leap year on the Persian calendar.
(defalias 'persian-calendar-leap-year-p #[(year) "\301\211\211\302X\203 \303\\\202 \304\\\305\"\306\"\307_\305\"\307W\207" [year mod 0 2346 2347 2820 768 683] 5 (#$ . 1050)])
#@57 Return last day of MONTH, YEAR on the Persian calendar.
(defalias 'persian-calendar-last-day-of-month #[(month year) "\302W\203 \303\207\304W\204 \305	!\203 \306\207\307\207" [month year 7 31 12 persian-calendar-leap-year-p 30 29] 2 (#$ . 1289)])
#@159 Compute absolute date from Persian date DATE.
The absolute date is the number of days elapsed since the (imaginary)
Gregorian date Sunday, December 31, 1 BC.
(defalias 'calendar-absolute-from-persian #[(date) "\211@)\211A@)\211AA@)	\306W\203/ \307\n\310	\311\"TE!\312	\311\"\313_\\\202} \fS	S\314_\\\312	\315\\\311\"\316_\\\312\310	\315\\\311\"\317\"\320_\\\312\310\211	\315\\\311\"\317\"\316_\311\"\\\321\306\211W\203v \322	\"\\T\211\202` *\\\n\\\323\\+\207" [date year day month persian-calendar-epoch sum 0 calendar-absolute-from-persian mod 2820 floor 1029983 365 2345 683 768 186 1 persian-calendar-last-day-of-month -568 m] 7 (#$ . 1548)])
#@50 Persian year corresponding to the absolute DATE.
(defalias 'calendar-persian-year-from-absolute #[(date) "\306\307\211\310E!Z\311	\312\"\313	\312\"\311\314\"\313\314\"\311\315\"\313\315\"\211\311\316_\317_\\\316\\\312\"\\\307\\*\n\317_\f\320_\\\321U\203Q S\202S \\\310\\\211\307W\203d S\202f .\207" [date d0 n2820 d1 n768 d2 calendar-absolute-from-persian 1 -2345 floor 1029983 mod 280506 366 2137 2820 768 1029617 b a n1 year] 6 (#$ . 2223)])
#@217 Compute the Persian equivalent for absolute date DATE.
The result is a list of the form (MONTH DAY YEAR).
The absolute date is the number of days elapsed since the imaginary
Gregorian date Sunday, December 31, 1 BC.
(defalias 'calendar-persian-from-absolute #[(date) "\306!\307\310\311\312	\"	E!V\203 \nTT\202 \n*T\311\f\307	E!SZ\f	E+\207" [date year sum m month day calendar-persian-year-from-absolute 1 0 calendar-absolute-from-persian persian-calendar-last-day-of-month] 6 (#$ . 2706)])
#@90 String of Persian date of Gregorian DATE.
Defaults to today's date if DATE is not given.
(defalias 'calendar-persian-date-string #[(&optional date) "\306\206 \307 \310!S\311!\312	_\\	\313\245\\	\314\245[\\	\315\245\\*!\211\211AA@)\n\211@)\fSH\316\n\211A@)!\317\316\f!\316!\320\321\322#.\207" [date prior-years persian-date y m persian-calendar-month-name-array calendar-persian-from-absolute calendar-current-date extract-calendar-year calendar-day-number 365 4 100 400 int-to-string nil mapconcat eval "" year month dayname day monthname calendar-date-display-form] 7 (#$ . 3218)])
#@60 Show the Persian calendar equivalent of the selected date.
(defalias 'calendar-print-persian-date #[nil "\300\301\302\303\304!!\"\207" [message "Persian date: %s" calendar-persian-date-string calendar-cursor-to-date t] 5 (#$ . 3834) nil])
#@73 Move cursor to Persian date DATE.
Echo Persian date unless NOECHO is t.
(defalias 'calendar-goto-persian-date #[(date &optional noecho) "\302\303\304!!!\210	\206 \305 \207" [date noecho calendar-goto-date calendar-gregorian-from-absolute calendar-absolute-from-persian calendar-print-persian-date] 4 (#$ . 4079) (persian-prompt-for-date)])
#@25 Ask for a Persian date.
(defalias 'persian-prompt-for-date #[nil "\306 \307\310\311\312\313\314	!S\315	!\316\n_\\\n\317\245\\\n\320\245[\\\n\321\245\\*!\211AA@)!#\322\323\324\325\326\327\330\331\"\"\331\322$\332\333\"\"A \334 \"!\307\335\336!\"\337\"\" \"E.C\207" [today date prior-years year completion-ignore-case persian-calendar-month-name-array calendar-current-date calendar-read "Persian calendar year (not 0): " (lambda (x) (/= x 0)) int-to-string calendar-persian-from-absolute extract-calendar-year calendar-day-number 365 4 100 400 t assoc completing-read "Persian calendar month name: " mapcar list append nil calendar-make-alist 1 persian-calendar-last-day-of-month format "Persian calendar day (1-%d): " (lambda (x) (and (< 0 x) (<= x last))) month last day] 9 (#$ . 4427)])
#@50 Persian calendar equivalent of date diary entry.
(defalias 'diary-persian-date #[nil "\301\302\303!\"\207" [date format "Persian date: %s" calendar-persian-date-string] 4 (#$ . 5241)])
(provide 'cal-persia)
