Add 2008 to copyright years.
[bpt/emacs.git] / lisp / calendar / cal-coptic.el
index 12c4686..3649c93 100644 (file)
@@ -1,8 +1,10 @@
-;;; cal-coptic.el --- calendar functions for the Coptic/Ethiopic calendars.
+;;; cal-coptic.el --- calendar functions for the Coptic/Ethiopic calendars
 
-;; Copyright (C) 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+;;   Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
+;; Maintainer: Glenn Morris <rgm@gnu.org>
 ;; Keywords: calendar
 ;; Human-Keywords: Coptic calendar, Ethiopic calendar, calendar, diary
 
@@ -10,7 +12,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; 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., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
 ;; This collection of functions implements the features of calendar.el and
 ;; diary.el that deal with the Coptic and Ethiopic calendars.
 
-;; Comments, corrections, and improvements should be sent to
-;;  Edward M. Reingold               Department of Computer Science
-;;  (217) 333-6733                   University of Illinois at Urbana-Champaign
-;;  reingold@cs.uiuc.edu             1304 West Springfield Avenue
-;;                                   Urbana, Illinois 61801
+;; Technical details of all the calendrical calculations can be found in
+;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
+;; and Nachum Dershowitz, Cambridge University Press (2001).
 
 ;;; Code:
 
+(defvar date)
+
 (require 'cal-julian)
 
 (defvar coptic-calendar-month-name-array
-  ["Tot" "Babe" "Hatur" "Kihak" "Tube" "Amshir" "Baramhat" "Barmuda"
-   "Bashnas" "Bauna" "Abib" "Misra" "Nisi"])
+  ["Tut" "Babah" "Hatur" "Kiyahk" "Tubah" "Amshir" "Baramhat" "Barmundah"
+   "Bashans" "Baunah" "Abib" "Misra" "al-Nasi"])
 
 (defvar coptic-calendar-epoch (calendar-absolute-from-julian '(8 29 284))
   "Absolute date of start of Coptic calendar = August 29, 284 A.D. (Julian).")
 
-(defconst coptic-name "Coptic")
+(defvar coptic-name "Coptic")
 
 (defun coptic-calendar-leap-year-p (year)
   "True if YEAR is a leap year on the Coptic calendar."
@@ -72,7 +75,7 @@ Gregorian date Sunday, December 31, 1 BC."
        (/ year 4)                ;; Leap days in prior years
        (* 30 (1- month))         ;; Days in prior months this year
        day)))                    ;; Days so far this month
-       
+
 
 (defun calendar-coptic-from-absolute (date)
   "Compute the Coptic equivalent for absolute date DATE.
@@ -125,7 +128,7 @@ Defaults to today's date if DATE is not given."
   (let ((f (calendar-coptic-date-string (calendar-cursor-to-date t))))
     (if (string-equal f "")
         (message "Date is pre-%s calendar" coptic-name)
-      (message f))))
+      (message "%s date: %s" coptic-name f))))
 
 (defun calendar-goto-coptic-date (date &optional noecho)
   "Move cursor to Coptic date DATE.
@@ -146,15 +149,14 @@ Echo Coptic date unless NOECHO is t."
                   (calendar-coptic-from-absolute
                    (calendar-absolute-from-gregorian today))))))
          (completion-ignore-case t)
-         (month (cdr (assoc
-                      (capitalize
-                       (completing-read
-                        (format "%s calendar month name: " coptic-name)
-                        (mapcar 'list
-                                (append coptic-calendar-month-name-array nil))
-                        nil t))
+         (month (cdr (assoc-string
+                      (completing-read
+                       (format "%s calendar month name: " coptic-name)
+                       (mapcar 'list
+                               (append coptic-calendar-month-name-array nil))
+                       nil t)
                       (calendar-make-alist coptic-calendar-month-name-array
-                                           1 'capitalize))))
+                                           1) t)))
          (last (coptic-calendar-last-day-of-month month year))
          (day (calendar-read
                (format "%s calendar day (1-%d): " coptic-name last)
@@ -163,17 +165,17 @@ Echo Coptic date unless NOECHO is t."
 
 (defun diary-coptic-date ()
   "Coptic calendar equivalent of date diary entry."
-  (let ((f (calendar-coptic-date-string (calendar-cursor-to-date t))))
+  (let ((f (calendar-coptic-date-string date)))
     (if (string-equal f "")
         (format "Date is pre-%s calendar" coptic-name)
-      f)))
+      (format "%s date: %s" coptic-name f))))
 
 (defconst ethiopic-calendar-month-name-array
-  ["Maskarram" "Tekemt" "Hadar" "Tahsas" "Tarr" "Yekatit" "Magawit" "Miaziah"
-   "Genbot" "Sanni" "Hamle" "Nas'hi" "Pagnem"])
+  ["Maskaram" "Teqemt" "Khedar" "Takhsas" "Ter" "Yakatit" "Magabit" "Miyazya"
+   "Genbot" "Sane" "Hamle" "Nahas" "Paguem"])
 
-(defconst ethiopic-calendar-epoch -2006079
-  "Absolute date of start of Ethiopic calendar = August 29, 5493 B.C.E. (Julian).")
+(defconst ethiopic-calendar-epoch 2796
+  "Absolute date of start of Ethiopic calendar = August 29, C.E. (Julian).")
 
 (defconst ethiopic-name "Ethiopic")
 
@@ -230,4 +232,5 @@ Echo Ethiopic date unless NOECHO is t."
 
 (provide 'cal-coptic)
 
+;;; arch-tag: 72d49161-25df-4072-9312-b182cdca7627
 ;;; cal-coptic.el ends here