;;; cal-mayan.el --- calendar functions for the Mayan calendars.
-;; Copyright (C) 1992, 1993 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc.
;; Author: Stewart M. Clamen <clamen@cs.cmu.edu>
;; Edward M. Reingold <reingold@cs.uiuc.edu>
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
;;; Commentary:
(require 'calendar)
-(defun mayan-adjusted-mod (m n)
- "Non-negative remainder of M/N with N instead of 0."
- (1+ (mod (1- m) n)))
-
(defconst calendar-mayan-days-before-absolute-zero 1137140
"Number of days of the Mayan calendar epoch before absolute day 0.
According to the Goodman-Martinez-Thompson correlation. This correlation is
(defun calendar-mayan-tzolkin-from-absolute (date)
"Convert absolute DATE into a Mayan tzolkin date (a pair)."
(let* ((long-count (+ date calendar-mayan-days-before-absolute-zero))
- (day (mayan-adjusted-mod
+ (day (calendar-mod
(+ long-count (car calendar-mayan-tzolkin-at-epoch))
13))
- (name (mayan-adjusted-mod
+ (name (calendar-mod
(+ long-count (cdr calendar-mayan-tzolkin-at-epoch))
20)))
(cons day name)))
(defun calendar-next-calendar-round-date
(tzolkin-date haab-date &optional noecho)
- "Move cursor to next instance of Mayan HAAB-DATE TZOKLIN-DATE combination.
+ "Move cursor to next instance of Mayan HAAB-DATE TZOLKIN-DATE combination.
Echo Mayan date if NOECHO is t."
(interactive (list (calendar-read-mayan-tzolkin-date)
(calendar-read-mayan-haab-date)))
(defun calendar-previous-calendar-round-date
(tzolkin-date haab-date &optional noecho)
- "Move to previous instance of Mayan TZOKLIN-DATE HAAB-DATE combination.
+ "Move to previous instance of Mayan TZOLKIN-DATE HAAB-DATE combination.
Echo Mayan date if NOECHO is t."
(interactive (list (calendar-read-mayan-tzolkin-date)
(calendar-read-mayan-haab-date)))