Mercurial > emacs
annotate lisp/calendar/cal-islam.el @ 110045:2758282288b9
Use gnus-create-image to be XEmacs-compatible; Don't do images on non-graphic displays; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Tue, 31 Aug 2010 00:07:40 +0000 |
parents | 280c8ae2476d |
children | 417b1e4d63cd |
rev | line source |
---|---|
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38402
diff
changeset
|
1 ;;; cal-islam.el --- calendar functions for the Islamic calendar |
13053 | 2 |
92610
6f4bd17c2adc
(mark-islamic-calendar-date-pattern): Use zerop.
Glenn Morris <rgm@gnu.org>
parents:
92585
diff
changeset
|
3 ;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
106815 | 4 ;; 2008, 2009, 2010 Free Software Foundation, Inc. |
13053 | 5 |
6 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> | |
67465
a55ee709ec8d
Update copyright pending Emacs 22.
Glenn Morris <rgm@gnu.org>
parents:
65144
diff
changeset
|
7 ;; Maintainer: Glenn Morris <rgm@gnu.org> |
13053 | 8 ;; Keywords: calendar |
9 ;; Human-Keywords: Islamic calendar, calendar, diary | |
110015
280c8ae2476d
Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents:
106815
diff
changeset
|
10 ;; Package: calendar |
13053 | 11 |
12 ;; This file is part of GNU Emacs. | |
13 | |
94653
e49abd957e81
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94279
diff
changeset
|
14 ;; GNU Emacs is free software: you can redistribute it and/or modify |
13053 | 15 ;; it under the terms of the GNU General Public License as published by |
94653
e49abd957e81
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94279
diff
changeset
|
16 ;; the Free Software Foundation, either version 3 of the License, or |
e49abd957e81
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94279
diff
changeset
|
17 ;; (at your option) any later version. |
13053 | 18 |
19 ;; GNU Emacs is distributed in the hope that it will be useful, | |
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 ;; GNU General Public License for more details. | |
23 | |
24 ;; You should have received a copy of the GNU General Public License | |
94653
e49abd957e81
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94279
diff
changeset
|
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
13053 | 26 |
27 ;;; Commentary: | |
28 | |
93462
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
29 ;; See calendar.el. |
20462
d179de7ad92e
Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents:
20268
diff
changeset
|
30 |
13053 | 31 ;;; Code: |
32 | |
93223
9aca848375df
Require calendar rather than cal-julian.
Glenn Morris <rgm@gnu.org>
parents:
93184
diff
changeset
|
33 (require 'calendar) |
13053 | 34 |
92971
56c7e60586c9
(number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents:
92926
diff
changeset
|
35 (defconst calendar-islamic-month-name-array |
13053 | 36 ["Muharram" "Safar" "Rabi I" "Rabi II" "Jumada I" "Jumada II" |
52119
226327fe046f
(displayed-month, displayed-year): Define for compiler.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
37 "Rajab" "Sha'ban" "Ramadan" "Shawwal" "Dhu al-Qada" "Dhu al-Hijjah"] |
226327fe046f
(displayed-month, displayed-year): Define for compiler.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
38 "Array of strings giving the names of the Islamic months.") |
13053 | 39 |
93223
9aca848375df
Require calendar rather than cal-julian.
Glenn Morris <rgm@gnu.org>
parents:
93184
diff
changeset
|
40 (eval-and-compile |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
41 (autoload 'calendar-julian-to-absolute "cal-julian")) |
93223
9aca848375df
Require calendar rather than cal-julian.
Glenn Morris <rgm@gnu.org>
parents:
93184
diff
changeset
|
42 |
9aca848375df
Require calendar rather than cal-julian.
Glenn Morris <rgm@gnu.org>
parents:
93184
diff
changeset
|
43 (defconst calendar-islamic-epoch |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
44 (eval-when-compile (calendar-julian-to-absolute '(7 16 622))) |
93223
9aca848375df
Require calendar rather than cal-julian.
Glenn Morris <rgm@gnu.org>
parents:
93184
diff
changeset
|
45 "Absolute date of start of Islamic calendar = July 16, 622 AD (Julian).") |
13053 | 46 |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
47 (defun calendar-islamic-leap-year-p (year) |
92645
611e312d3f05
(islamic-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents:
92644
diff
changeset
|
48 "Return t if YEAR is a leap year on the Islamic calendar." |
13053 | 49 (memq (% year 30) |
50 (list 2 5 7 10 13 16 18 21 24 26 29))) | |
51 | |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
52 (defun calendar-islamic-last-day-of-month (month year) |
13053 | 53 "The last day in MONTH during YEAR on the Islamic calendar." |
54 (cond | |
55 ((memq month (list 1 3 5 7 9 11)) 30) | |
56 ((memq month (list 2 4 6 8 10)) 29) | |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
57 (t (if (calendar-islamic-leap-year-p year) 30 29)))) |
13053 | 58 |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
59 (defun calendar-islamic-day-number (date) |
13053 | 60 "Return the day number within the year of the Islamic date DATE." |
93809
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93794
diff
changeset
|
61 (let ((month (calendar-extract-month date))) |
92926
b87a8e95883b
(displayed-month, displayed-year)
Glenn Morris <rgm@gnu.org>
parents:
92832
diff
changeset
|
62 (+ (* 30 (/ month 2)) |
b87a8e95883b
(displayed-month, displayed-year)
Glenn Morris <rgm@gnu.org>
parents:
92832
diff
changeset
|
63 (* 29 (/ (1- month) 2)) |
93809
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93794
diff
changeset
|
64 (calendar-extract-day date)))) |
13053 | 65 |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
66 (defun calendar-islamic-to-absolute (date) |
13053 | 67 "Absolute date of Islamic DATE. |
68 The absolute date is the number of days elapsed since the (imaginary) | |
69 Gregorian date Sunday, December 31, 1 BC." | |
93809
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93794
diff
changeset
|
70 (let* ((month (calendar-extract-month date)) |
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93794
diff
changeset
|
71 (day (calendar-extract-day date)) |
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93794
diff
changeset
|
72 (year (calendar-extract-year date)) |
13053 | 73 (y (% year 30)) |
92991
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
74 (leap-years-in-cycle (cond ((< y 3) 0) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
75 ((< y 6) 1) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
76 ((< y 8) 2) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
77 ((< y 11) 3) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
78 ((< y 14) 4) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
79 ((< y 17) 5) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
80 ((< y 19) 6) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
81 ((< y 22) 7) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
82 ((< y 25) 8) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
83 ((< y 27) 9) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
84 (t 10)))) |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
85 (+ (calendar-islamic-day-number date) ; days so far this year |
92644 | 86 (* (1- year) 354) ; days in all non-leap years |
87 (* 11 (/ year 30)) ; leap days in complete cycles | |
88 leap-years-in-cycle ; leap days this cycle | |
89 (1- calendar-islamic-epoch)))) ; days before start of calendar | |
13053 | 90 |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
91 (define-obsolete-function-alias 'calendar-absolute-from-islamic |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
92 'calendar-islamic-to-absolute "23.1") |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
93 |
13053 | 94 (defun calendar-islamic-from-absolute (date) |
95 "Compute the Islamic date (month day year) corresponding to absolute DATE. | |
96 The absolute date is the number of days elapsed since the (imaginary) | |
97 Gregorian date Sunday, December 31, 1 BC." | |
98 (if (< date calendar-islamic-epoch) | |
92644 | 99 (list 0 0 0) ; pre-Islamic date |
13053 | 100 (let* ((approx (/ (- date calendar-islamic-epoch) |
92644 | 101 355)) ; approximation from below |
102 (year ; search forward from the approximation | |
13053 | 103 (+ approx |
104 (calendar-sum y approx | |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
105 (>= date (calendar-islamic-to-absolute |
13053 | 106 (list 1 1 (1+ y)))) |
107 1))) | |
92644 | 108 (month ; search forward from Muharram |
13053 | 109 (1+ (calendar-sum m 1 |
110 (> date | |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
111 (calendar-islamic-to-absolute |
13053 | 112 (list m |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
113 (calendar-islamic-last-day-of-month |
13053 | 114 m year) |
115 year))) | |
116 1))) | |
92644 | 117 (day ; calculate the day by subtraction |
13053 | 118 (- date |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
119 (1- (calendar-islamic-to-absolute (list month 1 year)))))) |
13053 | 120 (list month day year)))) |
121 | |
92832
0f2bf92fe13d
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92677
diff
changeset
|
122 ;;;###cal-autoload |
13053 | 123 (defun calendar-islamic-date-string (&optional date) |
124 "String of Islamic date before sunset of Gregorian DATE. | |
125 Returns the empty string if DATE is pre-Islamic. | |
126 Defaults to today's date if DATE is not given. | |
127 Driven by the variable `calendar-date-display-form'." | |
128 (let ((calendar-month-name-array calendar-islamic-month-name-array) | |
129 (islamic-date (calendar-islamic-from-absolute | |
130 (calendar-absolute-from-gregorian | |
131 (or date (calendar-current-date)))))) | |
93809
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93794
diff
changeset
|
132 (if (< (calendar-extract-year islamic-date) 1) |
13053 | 133 "" |
134 (calendar-date-string islamic-date nil t)))) | |
135 | |
92832
0f2bf92fe13d
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92677
diff
changeset
|
136 ;;;###cal-autoload |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
137 (defun calendar-islamic-print-date () |
13053 | 138 "Show the Islamic calendar equivalent of the date under the cursor." |
139 (interactive) | |
140 (let ((i (calendar-islamic-date-string (calendar-cursor-to-date t)))) | |
141 (if (string-equal i "") | |
142 (message "Date is pre-Islamic") | |
143 (message "Islamic date (until sunset): %s" i)))) | |
144 | |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
145 (define-obsolete-function-alias 'calendar-print-islamic-date |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
146 'calendar-islamic-print-date "23.1") |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
147 |
93184
63a7509590a7
(calendar-islamic-read-date): New name for
Glenn Morris <rgm@gnu.org>
parents:
92991
diff
changeset
|
148 (defun calendar-islamic-read-date () |
63a7509590a7
(calendar-islamic-read-date): New name for
Glenn Morris <rgm@gnu.org>
parents:
92991
diff
changeset
|
149 "Interactively read the arguments for an Islamic date command. |
63a7509590a7
(calendar-islamic-read-date): New name for
Glenn Morris <rgm@gnu.org>
parents:
92991
diff
changeset
|
150 Reads a year, month, and day." |
92991
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
151 (let* ((today (calendar-current-date)) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
152 (year (calendar-read |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
153 "Islamic calendar year (>0): " |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
154 (lambda (x) (> x 0)) |
93844
bf9ef749c23e
Replace int-to-string with number-to-string.
Glenn Morris <rgm@gnu.org>
parents:
93809
diff
changeset
|
155 (number-to-string |
93809
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93794
diff
changeset
|
156 (calendar-extract-year |
92991
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
157 (calendar-islamic-from-absolute |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
158 (calendar-absolute-from-gregorian today)))))) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
159 (month-array calendar-islamic-month-name-array) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
160 (completion-ignore-case t) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
161 (month (cdr (assoc-string |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
162 (completing-read |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
163 "Islamic calendar month name: " |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
164 (mapcar 'list (append month-array nil)) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
165 nil t) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
166 (calendar-make-alist month-array 1) t))) |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
167 (last (calendar-islamic-last-day-of-month month year)) |
92991
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
168 (day (calendar-read |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
169 (format "Islamic calendar day (1-%d): " last) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
170 (lambda (x) (and (< 0 x) (<= x last)))))) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
171 (list (list month day year)))) |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
172 |
92832
0f2bf92fe13d
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92677
diff
changeset
|
173 ;;;###cal-autoload |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
174 (defun calendar-islamic-goto-date (date &optional noecho) |
92926
b87a8e95883b
(displayed-month, displayed-year)
Glenn Morris <rgm@gnu.org>
parents:
92832
diff
changeset
|
175 "Move cursor to Islamic DATE; echo Islamic date unless NOECHO is non-nil." |
93184
63a7509590a7
(calendar-islamic-read-date): New name for
Glenn Morris <rgm@gnu.org>
parents:
92991
diff
changeset
|
176 (interactive (calendar-islamic-read-date)) |
13053 | 177 (calendar-goto-date (calendar-gregorian-from-absolute |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
178 (calendar-islamic-to-absolute date))) |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
179 (or noecho (calendar-islamic-print-date))) |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
180 |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
181 (define-obsolete-function-alias 'calendar-goto-islamic-date |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
182 'calendar-islamic-goto-date "23.1") |
13053 | 183 |
93809
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93794
diff
changeset
|
184 (defvar displayed-month) ; from calendar-generate |
92926
b87a8e95883b
(displayed-month, displayed-year)
Glenn Morris <rgm@gnu.org>
parents:
92832
diff
changeset
|
185 (defvar displayed-year) |
b87a8e95883b
(displayed-month, displayed-year)
Glenn Morris <rgm@gnu.org>
parents:
92832
diff
changeset
|
186 |
92832
0f2bf92fe13d
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92677
diff
changeset
|
187 ;;;###holiday-autoload |
13053 | 188 (defun holiday-islamic (month day string) |
189 "Holiday on MONTH, DAY (Islamic) called STRING. | |
94279 | 190 If MONTH, DAY (Islamic) is visible, returns the corresponding |
191 Gregorian date as the list (((month day year) STRING)). | |
192 Returns nil if it is not visible in the current calendar window." | |
93462
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
193 ;; Islamic date corresponding to the center of the calendar window. |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
194 ;; Since the calendar displays 3 months at a time, there are approx |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
195 ;; 45 visible days either side of this date. Given the length of |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
196 ;; the Islamic months, this means up to two different months are |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
197 ;; visible either side of the central date. |
13053 | 198 (let* ((islamic-date (calendar-islamic-from-absolute |
199 (calendar-absolute-from-gregorian | |
200 (list displayed-month 15 displayed-year)))) | |
93809
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93794
diff
changeset
|
201 (m (calendar-extract-month islamic-date)) |
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93794
diff
changeset
|
202 (y (calendar-extract-year islamic-date)) |
93373
6facf919dde4
Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents:
93268
diff
changeset
|
203 date) |
92926
b87a8e95883b
(displayed-month, displayed-year)
Glenn Morris <rgm@gnu.org>
parents:
92832
diff
changeset
|
204 (unless (< m 1) ; Islamic calendar doesn't apply |
93462
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
205 ;; Since converting to absolute dates can be a complex |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
206 ;; operation, we try to speed things up by excluding those date |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
207 ;; ranges that can't possibly be visible. |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
208 ;; We can view the situation (see above) as if we had a calendar |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
209 ;; window displaying 5 months at a time. When month m is |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
210 ;; central, months m-2:m+2 (modulo 12) might be visible. |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
211 ;; Recall from holiday-fixed that with a 3 month calendar |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
212 ;; window, November is special, because we can do a one-sided |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
213 ;; inclusion test. When November is central is when the end of |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
214 ;; year first appears on the calendar. Similarly, with a 5 |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
215 ;; month window, October is special. When October is central is |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
216 ;; when the end of year first appears, and when January is |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
217 ;; central, October is no longer visible. October is visible |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
218 ;; when the central month is >= 8. |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
219 ;; Hence to test if any given month might be visible, we can |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
220 ;; shift things and ask about October. |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
221 ;; At the same time, we work out the appropriate year y to use. |
93809
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93794
diff
changeset
|
222 (calendar-increment-month m y (- 10 month)) |
93462
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
223 (and (> m 7) ; Islamic date might be visible |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
224 (calendar-date-is-visible-p |
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
225 (setq date (calendar-gregorian-from-absolute |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
226 (calendar-islamic-to-absolute (list month day y))))) |
93462
263786b8fe73
(Commentary): Replace with reference to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
93373
diff
changeset
|
227 (list (list date string)))))) |
13053 | 228 |
93577
bac2b63b476f
(holiday-islamic-new-year): New function.
Glenn Morris <rgm@gnu.org>
parents:
93471
diff
changeset
|
229 ;;;###holiday-autoload |
bac2b63b476f
(holiday-islamic-new-year): New function.
Glenn Morris <rgm@gnu.org>
parents:
93471
diff
changeset
|
230 (defun holiday-islamic-new-year () |
bac2b63b476f
(holiday-islamic-new-year): New function.
Glenn Morris <rgm@gnu.org>
parents:
93471
diff
changeset
|
231 "Holiday entry for the Islamic New Year, if visible in the calendar window." |
bac2b63b476f
(holiday-islamic-new-year): New function.
Glenn Morris <rgm@gnu.org>
parents:
93471
diff
changeset
|
232 (let ((date (caar (holiday-islamic 1 1 ""))) |
bac2b63b476f
(holiday-islamic-new-year): New function.
Glenn Morris <rgm@gnu.org>
parents:
93471
diff
changeset
|
233 (m displayed-month) |
bac2b63b476f
(holiday-islamic-new-year): New function.
Glenn Morris <rgm@gnu.org>
parents:
93471
diff
changeset
|
234 (y displayed-year)) |
bac2b63b476f
(holiday-islamic-new-year): New function.
Glenn Morris <rgm@gnu.org>
parents:
93471
diff
changeset
|
235 (and date |
bac2b63b476f
(holiday-islamic-new-year): New function.
Glenn Morris <rgm@gnu.org>
parents:
93471
diff
changeset
|
236 (list (list date |
bac2b63b476f
(holiday-islamic-new-year): New function.
Glenn Morris <rgm@gnu.org>
parents:
93471
diff
changeset
|
237 (format "Islamic New Year %d" |
bac2b63b476f
(holiday-islamic-new-year): New function.
Glenn Morris <rgm@gnu.org>
parents:
93471
diff
changeset
|
238 (progn |
93809
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93794
diff
changeset
|
239 (calendar-increment-month m y 1) |
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93794
diff
changeset
|
240 (calendar-extract-year |
93577
bac2b63b476f
(holiday-islamic-new-year): New function.
Glenn Morris <rgm@gnu.org>
parents:
93471
diff
changeset
|
241 (calendar-islamic-from-absolute |
bac2b63b476f
(holiday-islamic-new-year): New function.
Glenn Morris <rgm@gnu.org>
parents:
93471
diff
changeset
|
242 (calendar-absolute-from-gregorian |
bac2b63b476f
(holiday-islamic-new-year): New function.
Glenn Morris <rgm@gnu.org>
parents:
93471
diff
changeset
|
243 (list m (calendar-last-day-of-month m y) y) |
bac2b63b476f
(holiday-islamic-new-year): New function.
Glenn Morris <rgm@gnu.org>
parents:
93471
diff
changeset
|
244 )))))))))) |
bac2b63b476f
(holiday-islamic-new-year): New function.
Glenn Morris <rgm@gnu.org>
parents:
93471
diff
changeset
|
245 |
92971
56c7e60586c9
(number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents:
92926
diff
changeset
|
246 (autoload 'diary-list-entries-1 "diary-lib") |
92677
3f32c597cb6b
(diary-islamic-date): Move to end.
Glenn Morris <rgm@gnu.org>
parents:
92645
diff
changeset
|
247 |
92832
0f2bf92fe13d
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92677
diff
changeset
|
248 ;;;###diary-autoload |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
249 (defun diary-islamic-list-entries () |
13053 | 250 "Add any Islamic date entries from the diary file to `diary-entries-list'. |
93733
e1a9003feedf
Update for rename islamic-diary-entry-symbol to diary-islamic-entry-symbol.
Glenn Morris <rgm@gnu.org>
parents:
93642
diff
changeset
|
251 Islamic date diary entries must be prefaced by `diary-islamic-entry-symbol' |
92971
56c7e60586c9
(number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents:
92926
diff
changeset
|
252 \(normally an `I'). The same `diary-date-forms' govern the style |
92645
611e312d3f05
(islamic-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents:
92644
diff
changeset
|
253 of the Islamic calendar entries, except that the Islamic month |
93268
691804e8889b
(list-islamic-diary-entries): Doc fix.
Glenn Morris <rgm@gnu.org>
parents:
93223
diff
changeset
|
254 names cannot be abbreviated. The Islamic months are numbered |
92645
611e312d3f05
(islamic-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents:
92644
diff
changeset
|
255 from 1 to 12 with Muharram being 1 and 12 being Dhu al-Hijjah. |
611e312d3f05
(islamic-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents:
92644
diff
changeset
|
256 If an Islamic date diary entry begins with `diary-nonmarking-symbol', |
611e312d3f05
(islamic-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents:
92644
diff
changeset
|
257 the entry will appear in the diary listing, but will not be |
611e312d3f05
(islamic-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents:
92644
diff
changeset
|
258 marked in the calendar. This function is provided for use with |
93794
509de9778a6d
Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents:
93733
diff
changeset
|
259 `diary-nongregorian-listing-hook'." |
92971
56c7e60586c9
(number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents:
92926
diff
changeset
|
260 (diary-list-entries-1 calendar-islamic-month-name-array |
93733
e1a9003feedf
Update for rename islamic-diary-entry-symbol to diary-islamic-entry-symbol.
Glenn Morris <rgm@gnu.org>
parents:
93642
diff
changeset
|
261 diary-islamic-entry-symbol |
92971
56c7e60586c9
(number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents:
92926
diff
changeset
|
262 'calendar-islamic-from-absolute)) |
13053 | 263 |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
264 (define-obsolete-function-alias 'list-islamic-diary-entries |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
265 'diary-islamic-list-entries "23.1") |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
266 |
92991
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
267 (autoload 'calendar-mark-1 "diary-lib") |
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
268 |
92832
0f2bf92fe13d
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92677
diff
changeset
|
269 ;;;###diary-autoload |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
270 (defun calendar-islamic-mark-date-pattern (month day year &optional color) |
13053 | 271 "Mark dates in calendar window that conform to Islamic date MONTH/DAY/YEAR. |
92991
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
272 A value of 0 in any position is a wildcard. Optional argument COLOR is |
93809
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93794
diff
changeset
|
273 passed to `calendar-mark-visible-date' as MARK." |
92991
24a6717aed7f
(calendar-mark-1): Autoload it.
Glenn Morris <rgm@gnu.org>
parents:
92971
diff
changeset
|
274 (calendar-mark-1 month day year 'calendar-islamic-from-absolute |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
275 'calendar-islamic-to-absolute color)) |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
276 |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
277 (define-obsolete-function-alias 'mark-islamic-calendar-date-pattern |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
278 'calendar-islamic-mark-date-pattern "23.1") |
13053 | 279 |
92971
56c7e60586c9
(number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents:
92926
diff
changeset
|
280 (autoload 'diary-mark-entries-1 "diary-lib") |
92926
b87a8e95883b
(displayed-month, displayed-year)
Glenn Morris <rgm@gnu.org>
parents:
92832
diff
changeset
|
281 |
b87a8e95883b
(displayed-month, displayed-year)
Glenn Morris <rgm@gnu.org>
parents:
92832
diff
changeset
|
282 ;;;###diary-autoload |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
283 (defun diary-islamic-mark-entries () |
92926
b87a8e95883b
(displayed-month, displayed-year)
Glenn Morris <rgm@gnu.org>
parents:
92832
diff
changeset
|
284 "Mark days in the calendar window that have Islamic date diary entries. |
92971
56c7e60586c9
(number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents:
92926
diff
changeset
|
285 Marks each entry in `diary-file' (or included files) visible in the calendar |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
286 window. See `diary-islamic-list-entries' for more information." |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
287 (diary-mark-entries-1 'calendar-islamic-mark-date-pattern |
93471
31158dd82f24
(mark-islamic-diary-entries): Fix argument order in call to
Glenn Morris <rgm@gnu.org>
parents:
93462
diff
changeset
|
288 calendar-islamic-month-name-array |
93733
e1a9003feedf
Update for rename islamic-diary-entry-symbol to diary-islamic-entry-symbol.
Glenn Morris <rgm@gnu.org>
parents:
93642
diff
changeset
|
289 diary-islamic-entry-symbol |
93471
31158dd82f24
(mark-islamic-diary-entries): Fix argument order in call to
Glenn Morris <rgm@gnu.org>
parents:
93462
diff
changeset
|
290 'calendar-islamic-from-absolute)) |
92926
b87a8e95883b
(displayed-month, displayed-year)
Glenn Morris <rgm@gnu.org>
parents:
92832
diff
changeset
|
291 |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
292 (define-obsolete-function-alias |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
293 'mark-islamic-diary-entries 'diary-islamic-mark-entries "23.1") |
93373
6facf919dde4
Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents:
93268
diff
changeset
|
294 |
6facf919dde4
Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents:
93268
diff
changeset
|
295 (autoload 'diary-insert-entry-1 "diary-lib") |
6facf919dde4
Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents:
93268
diff
changeset
|
296 |
92832
0f2bf92fe13d
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92677
diff
changeset
|
297 ;;;###cal-autoload |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
298 (defun diary-islamic-insert-entry (arg) |
13053 | 299 "Insert a diary entry. |
300 For the Islamic date corresponding to the date indicated by point. | |
92645
611e312d3f05
(islamic-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents:
92644
diff
changeset
|
301 Prefix argument ARG makes the entry nonmarking." |
13053 | 302 (interactive "P") |
93373
6facf919dde4
Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents:
93268
diff
changeset
|
303 (diary-insert-entry-1 nil arg calendar-islamic-month-name-array |
93733
e1a9003feedf
Update for rename islamic-diary-entry-symbol to diary-islamic-entry-symbol.
Glenn Morris <rgm@gnu.org>
parents:
93642
diff
changeset
|
304 diary-islamic-entry-symbol |
93373
6facf919dde4
Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents:
93268
diff
changeset
|
305 'calendar-islamic-from-absolute)) |
13053 | 306 |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
307 (define-obsolete-function-alias 'insert-islamic-diary-entry |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
308 'diary-islamic-insert-entry "23.1") |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
309 |
92832
0f2bf92fe13d
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92677
diff
changeset
|
310 ;;;###cal-autoload |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
311 (defun diary-islamic-insert-monthly-entry (arg) |
13053 | 312 "Insert a monthly diary entry. |
313 For the day of the Islamic month corresponding to the date indicated by point. | |
92645
611e312d3f05
(islamic-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents:
92644
diff
changeset
|
314 Prefix argument ARG makes the entry nonmarking." |
13053 | 315 (interactive "P") |
93373
6facf919dde4
Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents:
93268
diff
changeset
|
316 (diary-insert-entry-1 'monthly arg calendar-islamic-month-name-array |
93733
e1a9003feedf
Update for rename islamic-diary-entry-symbol to diary-islamic-entry-symbol.
Glenn Morris <rgm@gnu.org>
parents:
93642
diff
changeset
|
317 diary-islamic-entry-symbol |
93373
6facf919dde4
Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents:
93268
diff
changeset
|
318 'calendar-islamic-from-absolute)) |
13053 | 319 |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
320 (define-obsolete-function-alias 'insert-monthly-islamic-diary-entry |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
321 'diary-islamic-insert-monthly-entry "23.1") |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
322 |
92832
0f2bf92fe13d
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92677
diff
changeset
|
323 ;;;###cal-autoload |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
324 (defun diary-islamic-insert-yearly-entry (arg) |
13053 | 325 "Insert an annual diary entry. |
326 For the day of the Islamic year corresponding to the date indicated by point. | |
92645
611e312d3f05
(islamic-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents:
92644
diff
changeset
|
327 Prefix argument ARG makes the entry nonmarking." |
13053 | 328 (interactive "P") |
93373
6facf919dde4
Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents:
93268
diff
changeset
|
329 (diary-insert-entry-1 'yearly arg calendar-islamic-month-name-array |
93733
e1a9003feedf
Update for rename islamic-diary-entry-symbol to diary-islamic-entry-symbol.
Glenn Morris <rgm@gnu.org>
parents:
93642
diff
changeset
|
330 diary-islamic-entry-symbol |
93373
6facf919dde4
Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents:
93268
diff
changeset
|
331 'calendar-islamic-from-absolute)) |
93642
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
332 (define-obsolete-function-alias |
d01118f40990
Update for cal-julian name changes.
Glenn Morris <rgm@gnu.org>
parents:
93577
diff
changeset
|
333 'insert-yearly-islamic-diary-entry 'diary-islamic-insert-yearly-entry "23.1") |
13053 | 334 |
92677
3f32c597cb6b
(diary-islamic-date): Move to end.
Glenn Morris <rgm@gnu.org>
parents:
92645
diff
changeset
|
335 (defvar date) |
3f32c597cb6b
(diary-islamic-date): Move to end.
Glenn Morris <rgm@gnu.org>
parents:
92645
diff
changeset
|
336 |
3f32c597cb6b
(diary-islamic-date): Move to end.
Glenn Morris <rgm@gnu.org>
parents:
92645
diff
changeset
|
337 ;; To be called from diary-sexp-entry, where DATE, ENTRY are bound. |
92832
0f2bf92fe13d
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92677
diff
changeset
|
338 ;;;###diary-autoload |
92677
3f32c597cb6b
(diary-islamic-date): Move to end.
Glenn Morris <rgm@gnu.org>
parents:
92645
diff
changeset
|
339 (defun diary-islamic-date () |
3f32c597cb6b
(diary-islamic-date): Move to end.
Glenn Morris <rgm@gnu.org>
parents:
92645
diff
changeset
|
340 "Islamic calendar equivalent of date diary entry." |
3f32c597cb6b
(diary-islamic-date): Move to end.
Glenn Morris <rgm@gnu.org>
parents:
92645
diff
changeset
|
341 (let ((i (calendar-islamic-date-string date))) |
3f32c597cb6b
(diary-islamic-date): Move to end.
Glenn Morris <rgm@gnu.org>
parents:
92645
diff
changeset
|
342 (if (string-equal i "") |
3f32c597cb6b
(diary-islamic-date): Move to end.
Glenn Morris <rgm@gnu.org>
parents:
92645
diff
changeset
|
343 "Date is pre-Islamic" |
3f32c597cb6b
(diary-islamic-date): Move to end.
Glenn Morris <rgm@gnu.org>
parents:
92645
diff
changeset
|
344 (format "Islamic date (until sunset): %s" i)))) |
3f32c597cb6b
(diary-islamic-date): Move to end.
Glenn Morris <rgm@gnu.org>
parents:
92645
diff
changeset
|
345 |
14684
66450c507ee4
Renamed from cal-islamic.el to avoid 14-character limitation.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
346 (provide 'cal-islam) |
13053 | 347 |
92585
c9eb56890fe0
Unquote lambda functions. Add autoload cookies to functions formerly
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
348 ;; arch-tag: a951b6c1-6f47-48d5-bac3-1b505cd719f7 |
14684
66450c507ee4
Renamed from cal-islamic.el to avoid 14-character limitation.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
349 ;;; cal-islam.el ends here |