-;;; 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
;; 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."
(/ 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.
(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.
(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)
(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, 8 C.E. (Julian).")
(defconst ethiopic-name "Ethiopic")
(provide 'cal-coptic)
+;;; arch-tag: 72d49161-25df-4072-9312-b182cdca7627
;;; cal-coptic.el ends here