diff options
| author | Glenn Morris | 2008-03-13 05:40:02 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-03-13 05:40:02 +0000 |
| commit | dedac6ab10e26307aca17b23fa173efb1523b020 (patch) | |
| tree | 2cdf93110cc97b826a122b88fc1a8a097ea7f7a4 | |
| parent | 0162aaa7db29c8726b114a609bb6f4f7e62946f5 (diff) | |
| download | emacs-dedac6ab10e26307aca17b23fa173efb1523b020.tar.gz emacs-dedac6ab10e26307aca17b23fa173efb1523b020.zip | |
Move variable declarations where they are needed.
(diary-bahai-date): Move to end.
(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.
| -rw-r--r-- | lisp/calendar/cal-bahai.el | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/lisp/calendar/cal-bahai.el b/lisp/calendar/cal-bahai.el index 3e522572191..3bb21e9bef5 100644 --- a/lisp/calendar/cal-bahai.el +++ b/lisp/calendar/cal-bahai.el | |||
| @@ -55,12 +55,6 @@ | |||
| 55 | 55 | ||
| 56 | ;;; Code: | 56 | ;;; Code: |
| 57 | 57 | ||
| 58 | (defvar date) | ||
| 59 | (defvar displayed-month) | ||
| 60 | (defvar displayed-year) | ||
| 61 | (defvar number) | ||
| 62 | (defvar original-date) | ||
| 63 | |||
| 64 | (require 'cal-julian) | 58 | (require 'cal-julian) |
| 65 | 59 | ||
| 66 | (defconst calendar-bahai-month-name-array | 60 | (defconst calendar-bahai-month-name-array |
| @@ -118,7 +112,7 @@ Gregorian date Sunday, December 31, 1 BC." | |||
| 118 | (1- (calendar-absolute-from-bahai (list month 1 year)))))) | 112 | (1- (calendar-absolute-from-bahai (list month 1 year)))))) |
| 119 | (list month day year)))) | 113 | (list month day year)))) |
| 120 | 114 | ||
| 121 | ;;;###autoload | 115 | ;;;###cal-autoload |
| 122 | (defun calendar-bahai-date-string (&optional date) | 116 | (defun calendar-bahai-date-string (&optional date) |
| 123 | "String of Bahá'í date of Gregorian DATE. | 117 | "String of Bahá'í date of Gregorian DATE. |
| 124 | Defaults to today's date if DATE is not given." | 118 | Defaults to today's date if DATE is not given." |
| @@ -144,14 +138,14 @@ Defaults to today's date if DATE is not given." | |||
| 144 | (year (int-to-string y))) | 138 | (year (int-to-string y))) |
| 145 | (mapconcat 'eval calendar-date-display-form "")))) | 139 | (mapconcat 'eval calendar-date-display-form "")))) |
| 146 | 140 | ||
| 147 | ;;;###autoload | 141 | ;;;###cal-autoload |
| 148 | (defun calendar-bahai-print-date () | 142 | (defun calendar-bahai-print-date () |
| 149 | "Show the Bahá'í calendar equivalent of the selected date." | 143 | "Show the Bahá'í calendar equivalent of the selected date." |
| 150 | (interactive) | 144 | (interactive) |
| 151 | (message "Bahá'í date: %s" | 145 | (message "Bahá'í date: %s" |
| 152 | (calendar-bahai-date-string (calendar-cursor-to-date t)))) | 146 | (calendar-bahai-date-string (calendar-cursor-to-date t)))) |
| 153 | 147 | ||
| 154 | ;;;###autoload | 148 | ;;;###cal-autoload |
| 155 | (defun calendar-bahai-goto-date (date &optional noecho) | 149 | (defun calendar-bahai-goto-date (date &optional noecho) |
| 156 | "Move cursor to Bahá'í date DATE. | 150 | "Move cursor to Bahá'í date DATE. |
| 157 | Echo Bahá'í date unless NOECHO is t." | 151 | Echo Bahá'í date unless NOECHO is t." |
| @@ -183,10 +177,10 @@ Echo Bahá'í date unless NOECHO is t." | |||
| 183 | (lambda (x) (and (< 0 x) (<= x 19)))))) | 177 | (lambda (x) (and (< 0 x) (<= x 19)))))) |
| 184 | (list (list month day year)))) | 178 | (list (list month day year)))) |
| 185 | 179 | ||
| 186 | (defun diary-bahai-date () | 180 | (defvar displayed-month) |
| 187 | "Bahá'í calendar equivalent of date diary entry." | 181 | (defvar displayed-year) |
| 188 | (format "Bahá'í date: %s" (calendar-bahai-date-string date))) | ||
| 189 | 182 | ||
| 183 | ;;;###holiday-autoload | ||
| 190 | (defun holiday-bahai (month day string) | 184 | (defun holiday-bahai (month day string) |
| 191 | "Holiday on MONTH, DAY (Bahá'í) called STRING. | 185 | "Holiday on MONTH, DAY (Bahá'í) called STRING. |
| 192 | If MONTH, DAY (Bahá'í) is visible, the value returned is corresponding | 186 | If MONTH, DAY (Bahá'í) is visible, the value returned is corresponding |
| @@ -207,10 +201,14 @@ nil if it is not visible in the current calendar window." | |||
| 207 | (if (calendar-date-is-visible-p date) | 201 | (if (calendar-date-is-visible-p date) |
| 208 | (list (list date string)))))))) | 202 | (list (list date string)))))))) |
| 209 | 203 | ||
| 204 | (defvar number) | ||
| 205 | (defvar original-date) | ||
| 206 | |||
| 210 | ;; d-b-l-e should be called from diary code. | 207 | ;; d-b-l-e should be called from diary code. |
| 211 | (declare-function add-to-diary-list "diary-lib" | 208 | (declare-function add-to-diary-list "diary-lib" |
| 212 | (date string specifier &optional marker globcolor literal)) | 209 | (date string specifier &optional marker globcolor literal)) |
| 213 | 210 | ||
| 211 | ;;;###diary-autoload | ||
| 214 | (defun diary-bahai-list-entries () | 212 | (defun diary-bahai-list-entries () |
| 215 | "Add any Bahá'í date entries from the diary file to `diary-entries-list'. | 213 | "Add any Bahá'í date entries from the diary file to `diary-entries-list'. |
| 216 | Bahá'í date diary entries must be prefaced by an | 214 | Bahá'í date diary entries must be prefaced by an |
| @@ -303,6 +301,7 @@ calendar. This function is provided for use with the | |||
| 303 | (declare-function mark-calendar-days-named "diary-lib" | 301 | (declare-function mark-calendar-days-named "diary-lib" |
| 304 | (dayname &optional color)) | 302 | (dayname &optional color)) |
| 305 | 303 | ||
| 304 | ;;;###diary-autoload | ||
| 306 | (defun diary-bahai-mark-entries () | 305 | (defun diary-bahai-mark-entries () |
| 307 | "Mark days in the calendar window that have Bahá'í date diary entries. | 306 | "Mark days in the calendar window that have Bahá'í date diary entries. |
| 308 | Each entry in `diary-file' (or included files) visible in the calendar | 307 | Each entry in `diary-file' (or included files) visible in the calendar |
| @@ -412,6 +411,7 @@ part of `nongregorian-diary-marking-hook'." | |||
| 412 | (calendar-bahai-mark-date-pattern mm dd yy))))) | 411 | (calendar-bahai-mark-date-pattern mm dd yy))))) |
| 413 | (setq d (cdr d))))) | 412 | (setq d (cdr d))))) |
| 414 | 413 | ||
| 414 | ;;;###diary-autoload | ||
| 415 | (defun calendar-bahai-mark-date-pattern (month day year) | 415 | (defun calendar-bahai-mark-date-pattern (month day year) |
| 416 | "Mark dates in calendar window that conform to Bahá'í date MONTH/DAY/YEAR. | 416 | "Mark dates in calendar window that conform to Bahá'í date MONTH/DAY/YEAR. |
| 417 | A value of 0 in any position is a wildcard." | 417 | A value of 0 in any position is a wildcard." |
| @@ -470,7 +470,7 @@ A value of 0 in any position is a wildcard." | |||
| 470 | (mark-visible-calendar-date | 470 | (mark-visible-calendar-date |
| 471 | (calendar-gregorian-from-absolute date))))))))) | 471 | (calendar-gregorian-from-absolute date))))))))) |
| 472 | 472 | ||
| 473 | ;;;###autoload | 473 | ;;;###cal-autoload |
| 474 | (defun diary-bahai-insert-entry (arg) | 474 | (defun diary-bahai-insert-entry (arg) |
| 475 | "Insert a diary entry. | 475 | "Insert a diary entry. |
| 476 | For the Bahá'í date corresponding to the date indicated by point. | 476 | For the Bahá'í date corresponding to the date indicated by point. |
| @@ -487,7 +487,7 @@ Prefix argument ARG makes the entry nonmarking." | |||
| 487 | nil t)) | 487 | nil t)) |
| 488 | arg))) | 488 | arg))) |
| 489 | 489 | ||
| 490 | ;;;###autoload | 490 | ;;;###cal-autoload |
| 491 | (defun diary-bahai-insert-monthly-entry (arg) | 491 | (defun diary-bahai-insert-monthly-entry (arg) |
| 492 | "Insert a monthly diary entry. | 492 | "Insert a monthly diary entry. |
| 493 | For the day of the Bahá'í month corresponding to the date indicated by point. | 493 | For the day of the Bahá'í month corresponding to the date indicated by point. |
| @@ -505,7 +505,7 @@ Prefix argument ARG makes the entry nonmarking." | |||
| 505 | (calendar-cursor-to-date t))))) | 505 | (calendar-cursor-to-date t))))) |
| 506 | arg))) | 506 | arg))) |
| 507 | 507 | ||
| 508 | ;;;###autoload | 508 | ;;;###cal-autoload |
| 509 | (defun diary-bahai-insert-yearly-entry (arg) | 509 | (defun diary-bahai-insert-yearly-entry (arg) |
| 510 | "Insert an annual diary entry. | 510 | "Insert an annual diary entry. |
| 511 | For the day of the Bahá'í year corresponding to the date indicated by point. | 511 | For the day of the Bahá'í year corresponding to the date indicated by point. |
| @@ -525,6 +525,15 @@ Prefix argument ARG will make the entry nonmarking." | |||
| 525 | (calendar-cursor-to-date t))))) | 525 | (calendar-cursor-to-date t))))) |
| 526 | arg))) | 526 | arg))) |
| 527 | 527 | ||
| 528 | (defvar date) | ||
| 529 | |||
| 530 | ;; To be called from list-sexp-diary-entries, where DATE is bound. | ||
| 531 | ;;;###diary-autoload | ||
| 532 | (defun diary-bahai-date () | ||
| 533 | "Bahá'í calendar equivalent of date diary entry." | ||
| 534 | (format "Bahá'í date: %s" (calendar-bahai-date-string date))) | ||
| 535 | |||
| 536 | |||
| 528 | ;; Backward compatibility. | 537 | ;; Backward compatibility. |
| 529 | (define-obsolete-function-alias | 538 | (define-obsolete-function-alias |
| 530 | 'list-bahai-diary-entries 'diary-bahai-list-entries "23.1") | 539 | 'list-bahai-diary-entries 'diary-bahai-list-entries "23.1") |
| @@ -547,7 +556,6 @@ Prefix argument ARG will make the entry nonmarking." | |||
| 547 | 556 | ||
| 548 | ;; Local Variables: | 557 | ;; Local Variables: |
| 549 | ;; coding: utf-8 | 558 | ;; coding: utf-8 |
| 550 | ;; generated-autoload-file: "cal-loaddefs.el" | ||
| 551 | ;; End: | 559 | ;; End: |
| 552 | 560 | ||
| 553 | ;; arch-tag: c1cb1d67-862a-4264-a01c-41cb4df01f14 | 561 | ;; arch-tag: c1cb1d67-862a-4264-a01c-41cb4df01f14 |