Mercurial > emacs
comparison lisp/calendar/cal-islam.el @ 92832:0f2bf92fe13d
(generated-autoload-file): Don't set, instead use different values of
generate-autoload-cookie plus Makefile rules to allow for a mixture of
internal calendar autoloads and normal autoloads.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Thu, 13 Mar 2008 05:43:27 +0000 |
parents | 3f32c597cb6b |
children | b87a8e95883b |
comparison
equal
deleted
inserted
replaced
92831:65bc0cdc7f5f | 92832:0f2bf92fe13d |
---|---|
115 (day ; calculate the day by subtraction | 115 (day ; calculate the day by subtraction |
116 (- date | 116 (- date |
117 (1- (calendar-absolute-from-islamic (list month 1 year)))))) | 117 (1- (calendar-absolute-from-islamic (list month 1 year)))))) |
118 (list month day year)))) | 118 (list month day year)))) |
119 | 119 |
120 ;;;###autoload | 120 ;;;###cal-autoload |
121 (defun calendar-islamic-date-string (&optional date) | 121 (defun calendar-islamic-date-string (&optional date) |
122 "String of Islamic date before sunset of Gregorian DATE. | 122 "String of Islamic date before sunset of Gregorian DATE. |
123 Returns the empty string if DATE is pre-Islamic. | 123 Returns the empty string if DATE is pre-Islamic. |
124 Defaults to today's date if DATE is not given. | 124 Defaults to today's date if DATE is not given. |
125 Driven by the variable `calendar-date-display-form'." | 125 Driven by the variable `calendar-date-display-form'." |
129 (or date (calendar-current-date)))))) | 129 (or date (calendar-current-date)))))) |
130 (if (< (extract-calendar-year islamic-date) 1) | 130 (if (< (extract-calendar-year islamic-date) 1) |
131 "" | 131 "" |
132 (calendar-date-string islamic-date nil t)))) | 132 (calendar-date-string islamic-date nil t)))) |
133 | 133 |
134 ;;;###autoload | 134 ;;;###cal-autoload |
135 (defun calendar-print-islamic-date () | 135 (defun calendar-print-islamic-date () |
136 "Show the Islamic calendar equivalent of the date under the cursor." | 136 "Show the Islamic calendar equivalent of the date under the cursor." |
137 (interactive) | 137 (interactive) |
138 (let ((i (calendar-islamic-date-string (calendar-cursor-to-date t)))) | 138 (let ((i (calendar-islamic-date-string (calendar-cursor-to-date t)))) |
139 (if (string-equal i "") | 139 (if (string-equal i "") |
140 (message "Date is pre-Islamic") | 140 (message "Date is pre-Islamic") |
141 (message "Islamic date (until sunset): %s" i)))) | 141 (message "Islamic date (until sunset): %s" i)))) |
142 | 142 |
143 ;;;###autoload | 143 ;;;###cal-autoload |
144 (defun calendar-goto-islamic-date (date &optional noecho) | 144 (defun calendar-goto-islamic-date (date &optional noecho) |
145 "Move cursor to Islamic DATE; echo Islamic date unless NOECHO is t." | 145 "Move cursor to Islamic DATE; echo Islamic date unless NOECHO is t." |
146 (interactive | 146 (interactive |
147 (let* ((today (calendar-current-date)) | 147 (let* ((today (calendar-current-date)) |
148 (year (calendar-read | 148 (year (calendar-read |
167 (list (list month day year)))) | 167 (list (list month day year)))) |
168 (calendar-goto-date (calendar-gregorian-from-absolute | 168 (calendar-goto-date (calendar-gregorian-from-absolute |
169 (calendar-absolute-from-islamic date))) | 169 (calendar-absolute-from-islamic date))) |
170 (or noecho (calendar-print-islamic-date))) | 170 (or noecho (calendar-print-islamic-date))) |
171 | 171 |
172 ;;;###holiday-autoload | |
172 (defun holiday-islamic (month day string) | 173 (defun holiday-islamic (month day string) |
173 "Holiday on MONTH, DAY (Islamic) called STRING. | 174 "Holiday on MONTH, DAY (Islamic) called STRING. |
174 If MONTH, DAY (Islamic) is visible, the value returned is corresponding | 175 If MONTH, DAY (Islamic) is visible, the value returned is corresponding |
175 Gregorian date in the form of the list (((month day year) STRING)). Returns | 176 Gregorian date in the form of the list (((month day year) STRING)). Returns |
176 nil if it is not visible in the current calendar window." | 177 nil if it is not visible in the current calendar window." |
193 (declare-function add-to-diary-list "diary-lib" | 194 (declare-function add-to-diary-list "diary-lib" |
194 (date string specifier &optional marker globcolor literal)) | 195 (date string specifier &optional marker globcolor literal)) |
195 | 196 |
196 (defvar number) ; from diary-list-entries | 197 (defvar number) ; from diary-list-entries |
197 | 198 |
199 ;;;###diary-autoload | |
198 (defun list-islamic-diary-entries () | 200 (defun list-islamic-diary-entries () |
199 "Add any Islamic date entries from the diary file to `diary-entries-list'. | 201 "Add any Islamic date entries from the diary file to `diary-entries-list'. |
200 Islamic date diary entries must be prefaced by `islamic-diary-entry-symbol' | 202 Islamic date diary entries must be prefaced by `islamic-diary-entry-symbol' |
201 \(normally an `I'). The same diary date forms govern the style | 203 \(normally an `I'). The same diary date forms govern the style |
202 of the Islamic calendar entries, except that the Islamic month | 204 of the Islamic calendar entries, except that the Islamic month |
286 (string-array &optional abbrev-array paren)) | 288 (string-array &optional abbrev-array paren)) |
287 | 289 |
288 (declare-function mark-calendar-days-named "diary-lib" | 290 (declare-function mark-calendar-days-named "diary-lib" |
289 (dayname &optional color)) | 291 (dayname &optional color)) |
290 | 292 |
293 ;;;###diary-autoload | |
291 (defun mark-islamic-diary-entries () | 294 (defun mark-islamic-diary-entries () |
292 "Mark days in the calendar window that have Islamic date diary entries. | 295 "Mark days in the calendar window that have Islamic date diary entries. |
293 Each entry in `diary-file' (or included files) visible in the calendar window | 296 Each entry in `diary-file' (or included files) visible in the calendar window |
294 is marked. Islamic date entries are prefaced by `islamic-diary-entry-symbol' | 297 is marked. Islamic date entries are prefaced by `islamic-diary-entry-symbol' |
295 \(normally an `I'). The same `diary-date-forms' govern the style of the Islamic | 298 \(normally an `I'). The same `diary-date-forms' govern the style of the Islamic |
389 (calendar-make-alist | 392 (calendar-make-alist |
390 calendar-islamic-month-name-array) t))))) | 393 calendar-islamic-month-name-array) t))))) |
391 (mark-islamic-calendar-date-pattern mm dd yy))))) | 394 (mark-islamic-calendar-date-pattern mm dd yy))))) |
392 (setq d (cdr d))))) | 395 (setq d (cdr d))))) |
393 | 396 |
397 ;;;###diary-autoload | |
394 (defun mark-islamic-calendar-date-pattern (month day year) | 398 (defun mark-islamic-calendar-date-pattern (month day year) |
395 "Mark dates in calendar window that conform to Islamic date MONTH/DAY/YEAR. | 399 "Mark dates in calendar window that conform to Islamic date MONTH/DAY/YEAR. |
396 A value of 0 in any position is a wildcard." | 400 A value of 0 in any position is a wildcard." |
397 (save-excursion | 401 (save-excursion |
398 (set-buffer calendar-buffer) | 402 (set-buffer calendar-buffer) |
447 (or (zerop year) | 451 (or (zerop year) |
448 (= year i-year)) | 452 (= year i-year)) |
449 (mark-visible-calendar-date | 453 (mark-visible-calendar-date |
450 (calendar-gregorian-from-absolute date))))))))) | 454 (calendar-gregorian-from-absolute date))))))))) |
451 | 455 |
452 ;;;###autoload | 456 ;;;###cal-autoload |
453 (defun insert-islamic-diary-entry (arg) | 457 (defun insert-islamic-diary-entry (arg) |
454 "Insert a diary entry. | 458 "Insert a diary entry. |
455 For the Islamic date corresponding to the date indicated by point. | 459 For the Islamic date corresponding to the date indicated by point. |
456 Prefix argument ARG makes the entry nonmarking." | 460 Prefix argument ARG makes the entry nonmarking." |
457 (interactive "P") | 461 (interactive "P") |
464 (calendar-absolute-from-gregorian | 468 (calendar-absolute-from-gregorian |
465 (calendar-cursor-to-date t))) | 469 (calendar-cursor-to-date t))) |
466 nil t)) | 470 nil t)) |
467 arg))) | 471 arg))) |
468 | 472 |
469 ;;;###autoload | 473 ;;;###cal-autoload |
470 (defun insert-monthly-islamic-diary-entry (arg) | 474 (defun insert-monthly-islamic-diary-entry (arg) |
471 "Insert a monthly diary entry. | 475 "Insert a monthly diary entry. |
472 For the day of the Islamic month corresponding to the date indicated by point. | 476 For the day of the Islamic month corresponding to the date indicated by point. |
473 Prefix argument ARG makes the entry nonmarking." | 477 Prefix argument ARG makes the entry nonmarking." |
474 (interactive "P") | 478 (interactive "P") |
482 (calendar-islamic-from-absolute | 486 (calendar-islamic-from-absolute |
483 (calendar-absolute-from-gregorian | 487 (calendar-absolute-from-gregorian |
484 (calendar-cursor-to-date t))))) | 488 (calendar-cursor-to-date t))))) |
485 arg))) | 489 arg))) |
486 | 490 |
487 ;;;###autoload | 491 ;;;###cal-autoload |
488 (defun insert-yearly-islamic-diary-entry (arg) | 492 (defun insert-yearly-islamic-diary-entry (arg) |
489 "Insert an annual diary entry. | 493 "Insert an annual diary entry. |
490 For the day of the Islamic year corresponding to the date indicated by point. | 494 For the day of the Islamic year corresponding to the date indicated by point. |
491 Prefix argument ARG makes the entry nonmarking." | 495 Prefix argument ARG makes the entry nonmarking." |
492 (interactive "P") | 496 (interactive "P") |
505 arg))) | 509 arg))) |
506 | 510 |
507 (defvar date) | 511 (defvar date) |
508 | 512 |
509 ;; To be called from diary-sexp-entry, where DATE, ENTRY are bound. | 513 ;; To be called from diary-sexp-entry, where DATE, ENTRY are bound. |
514 ;;;###diary-autoload | |
510 (defun diary-islamic-date () | 515 (defun diary-islamic-date () |
511 "Islamic calendar equivalent of date diary entry." | 516 "Islamic calendar equivalent of date diary entry." |
512 (let ((i (calendar-islamic-date-string date))) | 517 (let ((i (calendar-islamic-date-string date))) |
513 (if (string-equal i "") | 518 (if (string-equal i "") |
514 "Date is pre-Islamic" | 519 "Date is pre-Islamic" |
515 (format "Islamic date (until sunset): %s" i)))) | 520 (format "Islamic date (until sunset): %s" i)))) |
516 | 521 |
517 (provide 'cal-islam) | 522 (provide 'cal-islam) |
518 | 523 |
519 ;; Local Variables: | |
520 ;; generated-autoload-file: "cal-loaddefs.el" | |
521 ;; End: | |
522 | |
523 ;; arch-tag: a951b6c1-6f47-48d5-bac3-1b505cd719f7 | 524 ;; arch-tag: a951b6c1-6f47-48d5-bac3-1b505cd719f7 |
524 ;;; cal-islam.el ends here | 525 ;;; cal-islam.el ends here |