diff options
| author | Jim Blandy | 1993-03-11 07:03:17 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-03-11 07:03:17 +0000 |
| commit | 63f76385380d82e75bfad51d049dc2f30249a751 (patch) | |
| tree | c1b3b9c3c290703be769f02dd62a9ced7135c143 | |
| parent | a055a1cd6e038214a1a9f3d0f3619b93865d9973 (diff) | |
| download | emacs-63f76385380d82e75bfad51d049dc2f30249a751.tar.gz emacs-63f76385380d82e75bfad51d049dc2f30249a751.zip | |
* cal-mayan.el (calendar-mayan-haab-on-or-before,
calendar-mayan-tzolkin-on-or-before): Change `mod' to `%'.
* cal-mayan.el (calendar-next-tzolkin-date): Delete bogus second
defun.
| -rw-r--r-- | lisp/calendar/cal-mayan.el | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/lisp/calendar/cal-mayan.el b/lisp/calendar/cal-mayan.el index c0eff55355c..0ee7c8613e4 100644 --- a/lisp/calendar/cal-mayan.el +++ b/lisp/calendar/cal-mayan.el | |||
| @@ -139,11 +139,11 @@ haab date DATE2." | |||
| 139 | 139 | ||
| 140 | (defun calendar-mayan-haab-on-or-before (haab-date date) | 140 | (defun calendar-mayan-haab-on-or-before (haab-date date) |
| 141 | "Absolute date of latest HAAB-DATE on or before absolute DATE." | 141 | "Absolute date of latest HAAB-DATE on or before absolute DATE." |
| 142 | (- date | 142 | (- date |
| 143 | (mod (- date | 143 | (% (- date |
| 144 | (calendar-mayan-haab-difference | 144 | (calendar-mayan-haab-difference |
| 145 | (calendar-mayan-haab-from-absolute 0) haab-date)) | 145 | (calendar-mayan-haab-from-absolute 0) haab-date)) |
| 146 | 365))) | 146 | 365))) |
| 147 | 147 | ||
| 148 | (defun calendar-next-haab-date (haab-date &optional noecho) | 148 | (defun calendar-next-haab-date (haab-date &optional noecho) |
| 149 | "Move cursor to next instance of Mayan HAAB-DATE. | 149 | "Move cursor to next instance of Mayan HAAB-DATE. |
| @@ -202,11 +202,11 @@ Mayan tzolkin date DATE2." | |||
| 202 | 202 | ||
| 203 | (defun calendar-mayan-tzolkin-on-or-before (tzolkin-date date) | 203 | (defun calendar-mayan-tzolkin-on-or-before (tzolkin-date date) |
| 204 | "Absolute date of latest TZOLKIN-DATE on or before absolute DATE." | 204 | "Absolute date of latest TZOLKIN-DATE on or before absolute DATE." |
| 205 | (- date | 205 | (- date |
| 206 | (mod (- date (calendar-mayan-tzolkin-difference | 206 | (% (- date (calendar-mayan-tzolkin-difference |
| 207 | (calendar-mayan-tzolkin-from-absolute 0) | 207 | (calendar-mayan-tzolkin-from-absolute 0) |
| 208 | tzolkin-date)) | 208 | tzolkin-date)) |
| 209 | 260))) | 209 | 260))) |
| 210 | 210 | ||
| 211 | (defun calendar-next-tzolkin-date (tzolkin-date &optional noecho) | 211 | (defun calendar-next-tzolkin-date (tzolkin-date &optional noecho) |
| 212 | "Move cursor to next instance of Mayan TZOLKIN-DATE. | 212 | "Move cursor to next instance of Mayan TZOLKIN-DATE. |
| @@ -291,20 +291,6 @@ and HAAB-DATE; returns nil if such a tzolkin-haab combination is impossible." | |||
| 291 | tzolkin-name-list 1 'capitalize))))) | 291 | tzolkin-name-list 1 'capitalize))))) |
| 292 | (cons tzolkin-count tzolkin-name))) | 292 | (cons tzolkin-count tzolkin-name))) |
| 293 | 293 | ||
| 294 | (defun calendar-next-tzolkin-date (tzolkin-date &optional noecho) | ||
| 295 | "Move cursor to next instance of Mayan TZOLKIN-DATE. | ||
| 296 | Echo Mayan date if NOECHO is t." | ||
| 297 | (interactive (list (calendar-read-mayan-tzolkin-date))) | ||
| 298 | (let* ((date (calendar-absolute-from-gregorian (calendar-cursor-to-date))) | ||
| 299 | (tomorrow-tzolkin-date | ||
| 300 | (calendar-mayan-tzolkin-from-absolute (1+ date)))) | ||
| 301 | (calendar-goto-date | ||
| 302 | (calendar-gregorian-from-absolute | ||
| 303 | (+ date 1 | ||
| 304 | (calendar-mayan-tzolkin-difference | ||
| 305 | tomorrow-tzolkin-date tzolkin-date))))) | ||
| 306 | (or noecho (calendar-print-mayan-date))) | ||
| 307 | |||
| 308 | (defun calendar-next-calendar-round-date | 294 | (defun calendar-next-calendar-round-date |
| 309 | (tzolkin-date haab-date &optional noecho) | 295 | (tzolkin-date haab-date &optional noecho) |
| 310 | "Move cursor to next instance of Mayan HAAB-DATE TZOKLIN-DATE combination. | 296 | "Move cursor to next instance of Mayan HAAB-DATE TZOKLIN-DATE combination. |