diff options
| author | Glenn Morris | 2008-03-08 03:39:49 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-03-08 03:39:49 +0000 |
| commit | bfcb51726fe2c4d99f28d49a417c4917e33396b1 (patch) | |
| tree | 1617ff89ac6d4a50df9e08a402f77897aab3b4dc | |
| parent | e708e9d98763fbaba8cf46606afce8414ea6c3e4 (diff) | |
| download | emacs-bfcb51726fe2c4d99f28d49a417c4917e33396b1.tar.gz emacs-bfcb51726fe2c4d99f28d49a417c4917e33396b1.zip | |
Unquote lambda functions. Add autoload cookies to functions formerly
autoloaded in calendar.el. Set `generated-autoload-file' to
"cal-loaddefs.el".
(chinese-calendar): Move custom group here from calendar.el.
(chinese-calendar-celestial-stem, chinese-calendar-terrestrial-branch):
Make constants.
| -rw-r--r-- | lisp/calendar/cal-china.el | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/lisp/calendar/cal-china.el b/lisp/calendar/cal-china.el index e7b8a531612..1a2f2210f38 100644 --- a/lisp/calendar/cal-china.el +++ b/lisp/calendar/cal-china.el | |||
| @@ -51,11 +51,9 @@ | |||
| 51 | 51 | ||
| 52 | (require 'lunar) | 52 | (require 'lunar) |
| 53 | 53 | ||
| 54 | (defvar chinese-calendar-celestial-stem | 54 | (defgroup chinese-calendar nil |
| 55 | ["Jia" "Yi" "Bing" "Ding" "Wu" "Ji" "Geng" "Xin" "Ren" "Gui"]) | 55 | "Chinese calendar support." |
| 56 | 56 | :group 'calendar) | |
| 57 | (defvar chinese-calendar-terrestrial-branch | ||
| 58 | ["Zi" "Chou" "Yin" "Mao" "Chen" "Si" "Wu" "Wei" "Shen" "You" "Xu" "Hai"]) | ||
| 59 | 57 | ||
| 60 | (defcustom chinese-calendar-time-zone | 58 | (defcustom chinese-calendar-time-zone |
| 61 | '(if (< year 1928) | 59 | '(if (< year 1928) |
| @@ -131,6 +129,15 @@ Chinese calendar. Default is for no daylight saving time." | |||
| 131 | :type 'integer | 129 | :type 'integer |
| 132 | :group 'chinese-calendar) | 130 | :group 'chinese-calendar) |
| 133 | 131 | ||
| 132 | ;;; End of user options. | ||
| 133 | |||
| 134 | |||
| 135 | (defconst chinese-calendar-celestial-stem | ||
| 136 | ["Jia" "Yi" "Bing" "Ding" "Wu" "Ji" "Geng" "Xin" "Ren" "Gui"]) | ||
| 137 | |||
| 138 | (defconst chinese-calendar-terrestrial-branch | ||
| 139 | ["Zi" "Chou" "Yin" "Mao" "Chen" "Si" "Wu" "Wei" "Shen" "You" "Xu" "Hai"]) | ||
| 140 | |||
| 134 | (defun chinese-zodiac-sign-on-or-after (d) | 141 | (defun chinese-zodiac-sign-on-or-after (d) |
| 135 | "Absolute date of first new Zodiac sign on or after absolute date d. | 142 | "Absolute date of first new Zodiac sign on or after absolute date d. |
| 136 | The Zodiac signs begin when the sun's longitude is a multiple of 30 degrees." | 143 | The Zodiac signs begin when the sun's longitude is a multiple of 30 degrees." |
| @@ -374,6 +381,7 @@ Gregorian date Sunday, December 31, 1 BC." | |||
| 374 | (format "Chinese New Year (%s)" | 381 | (format "Chinese New Year (%s)" |
| 375 | (calendar-chinese-sexagesimal-name (+ y 57)))))))))) | 382 | (calendar-chinese-sexagesimal-name (+ y 57)))))))))) |
| 376 | 383 | ||
| 384 | ;;;###autoload | ||
| 377 | (defun calendar-chinese-date-string (&optional date) | 385 | (defun calendar-chinese-date-string (&optional date) |
| 378 | "String of Chinese date of Gregorian DATE. | 386 | "String of Chinese date of Gregorian DATE. |
| 379 | Defaults to today's date if DATE is not given." | 387 | Defaults to today's date if DATE is not given." |
| @@ -415,6 +423,7 @@ N congruent to 1 gives the first name, N congruent to 2 gives the second name, | |||
| 415 | (aref chinese-calendar-celestial-stem (% (1- n) 10)) | 423 | (aref chinese-calendar-celestial-stem (% (1- n) 10)) |
| 416 | (aref chinese-calendar-terrestrial-branch (% (1- n) 12)))) | 424 | (aref chinese-calendar-terrestrial-branch (% (1- n) 12)))) |
| 417 | 425 | ||
| 426 | ;;;###autoload | ||
| 418 | (defun calendar-print-chinese-date () | 427 | (defun calendar-print-chinese-date () |
| 419 | "Show the Chinese date equivalents of date." | 428 | "Show the Chinese date equivalents of date." |
| 420 | (interactive) | 429 | (interactive) |
| @@ -422,6 +431,7 @@ N congruent to 1 gives the first name, N congruent to 2 gives the second name, | |||
| 422 | (message "Chinese date: %s" | 431 | (message "Chinese date: %s" |
| 423 | (calendar-chinese-date-string (calendar-cursor-to-date t)))) | 432 | (calendar-chinese-date-string (calendar-cursor-to-date t)))) |
| 424 | 433 | ||
| 434 | ;;;###autoload | ||
| 425 | (defun calendar-goto-chinese-date (date &optional noecho) | 435 | (defun calendar-goto-chinese-date (date &optional noecho) |
| 426 | "Move cursor to Chinese date DATE. | 436 | "Move cursor to Chinese date DATE. |
| 427 | Echo Chinese date unless NOECHO is t." | 437 | Echo Chinese date unless NOECHO is t." |
| @@ -431,11 +441,11 @@ Echo Chinese date unless NOECHO is t." | |||
| 431 | (calendar-current-date)))) | 441 | (calendar-current-date)))) |
| 432 | (cycle (calendar-read | 442 | (cycle (calendar-read |
| 433 | "Chinese calendar cycle number (>44): " | 443 | "Chinese calendar cycle number (>44): " |
| 434 | '(lambda (x) (> x 44)) | 444 | (lambda (x) (> x 44)) |
| 435 | (int-to-string (car c)))) | 445 | (int-to-string (car c)))) |
| 436 | (year (calendar-read | 446 | (year (calendar-read |
| 437 | "Year in Chinese cycle (1..60): " | 447 | "Year in Chinese cycle (1..60): " |
| 438 | '(lambda (x) (and (<= 1 x) (<= x 60))) | 448 | (lambda (x) (and (<= 1 x) (<= x 60))) |
| 439 | (int-to-string (car (cdr c))))) | 449 | (int-to-string (car (cdr c))))) |
| 440 | (month-list (make-chinese-month-assoc-list | 450 | (month-list (make-chinese-month-assoc-list |
| 441 | (chinese-months cycle year))) | 451 | (chinese-months cycle year))) |
| @@ -453,7 +463,7 @@ Echo Chinese date unless NOECHO is t." | |||
| 453 | 29)) | 463 | 29)) |
| 454 | (day (calendar-read | 464 | (day (calendar-read |
| 455 | (format "Chinese calendar day (1-%d): " last) | 465 | (format "Chinese calendar day (1-%d): " last) |
| 456 | '(lambda (x) (and (<= 1 x) (<= x last)))))) | 466 | (lambda (x) (and (<= 1 x) (<= x last)))))) |
| 457 | (list (list cycle year month day)))) | 467 | (list (list cycle year month day)))) |
| 458 | (calendar-goto-date (calendar-gregorian-from-absolute | 468 | (calendar-goto-date (calendar-gregorian-from-absolute |
| 459 | (calendar-absolute-from-chinese date))) | 469 | (calendar-absolute-from-chinese date))) |
| @@ -462,13 +472,13 @@ Echo Chinese date unless NOECHO is t." | |||
| 462 | (defun chinese-months (c y) | 472 | (defun chinese-months (c y) |
| 463 | "A list of the months in cycle C, year Y of the Chinese calendar." | 473 | "A list of the months in cycle C, year Y of the Chinese calendar." |
| 464 | (let* ((l (memq 1 (append | 474 | (let* ((l (memq 1 (append |
| 465 | (mapcar '(lambda (x) | 475 | (mapcar (lambda (x) |
| 466 | (car x)) | 476 | (car x)) |
| 467 | (chinese-year (extract-calendar-year | 477 | (chinese-year (extract-calendar-year |
| 468 | (calendar-gregorian-from-absolute | 478 | (calendar-gregorian-from-absolute |
| 469 | (calendar-absolute-from-chinese | 479 | (calendar-absolute-from-chinese |
| 470 | (list c y 1 1)))))) | 480 | (list c y 1 1)))))) |
| 471 | (mapcar '(lambda (x) | 481 | (mapcar (lambda (x) |
| 472 | (if (> (car x) 11) (car x))) | 482 | (if (> (car x) 11) (car x))) |
| 473 | (chinese-year (extract-calendar-year | 483 | (chinese-year (extract-calendar-year |
| 474 | (calendar-gregorian-from-absolute | 484 | (calendar-gregorian-from-absolute |
| @@ -498,5 +508,9 @@ Echo Chinese date unless NOECHO is t." | |||
| 498 | 508 | ||
| 499 | (provide 'cal-china) | 509 | (provide 'cal-china) |
| 500 | 510 | ||
| 501 | ;;; arch-tag: 7e5b7e0d-676c-47e3-8696-93e7ea0ab644 | 511 | ;; Local Variables: |
| 512 | ;; generated-autoload-file: "cal-loaddefs.el" | ||
| 513 | ;; End: | ||
| 514 | |||
| 515 | ;; arch-tag: 7e5b7e0d-676c-47e3-8696-93e7ea0ab644 | ||
| 502 | ;;; cal-china.el ends here | 516 | ;;; cal-china.el ends here |