]> code.delx.au - gnu-emacs/blobdiff - lisp/calendar/cal-coptic.el
Merge from trunk.
[gnu-emacs] / lisp / calendar / cal-coptic.el
index 217e861dc7888e5d66035c111255d81d156c223b..4db2743777fbcc216fdde9fb2e269ee4c0b443a2 100644 (file)
@@ -1,19 +1,19 @@
 ;;; cal-coptic.el --- calendar functions for the Coptic/Ethiopic calendars
 
-;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;;   2008  Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997, 2001-2011  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
+;; Package: calendar
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; 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 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,9 +21,7 @@
 ;; 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, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -68,9 +66,9 @@ Nisi (Kebus) at the end of the year."
   "Compute absolute date from Coptic date DATE.
 The absolute date is the number of days elapsed since the (imaginary)
 Gregorian date Sunday, December 31, 1 BC."
-  (let ((month (extract-calendar-month date))
-        (day (extract-calendar-day date))
-        (year (extract-calendar-year date)))
+  (let ((month (calendar-extract-month date))
+        (day (calendar-extract-day date))
+        (year (calendar-extract-year date)))
     (+ (1- calendar-coptic-epoch)     ; days before start of calendar
        (* 365 (1- year))              ; days in prior years
        (/ year 4)                     ; leap days in prior years
@@ -117,15 +115,15 @@ Defaults to today's date if DATE is not given."
   (let* ((coptic-date (calendar-coptic-from-absolute
                        (calendar-absolute-from-gregorian
                         (or date (calendar-current-date)))))
-         (y (extract-calendar-year coptic-date))
-         (m (extract-calendar-month coptic-date)))
+         (y (calendar-extract-year coptic-date))
+         (m (calendar-extract-month coptic-date)))
     (if (< y 1)
         ""
       (let ((monthname (aref calendar-coptic-month-name-array (1- m)))
-            (day (int-to-string (extract-calendar-day coptic-date)))
+            (day (number-to-string (calendar-extract-day coptic-date)))
             (dayname nil)
-            (month (int-to-string m))
-            (year (int-to-string y)))
+            (month (number-to-string m))
+            (year (number-to-string y)))
         (mapconcat 'eval calendar-date-display-form "")))))
 
 ;;;###cal-autoload
@@ -147,8 +145,8 @@ Reads a year, month, and day."
          (year (calendar-read
                 (format "%s calendar year (>0): " calendar-coptic-name)
                 (lambda (x) (> x 0))
-                (int-to-string
-                 (extract-calendar-year
+                (number-to-string
+                 (calendar-extract-year
                   (calendar-coptic-from-absolute
                    (calendar-absolute-from-gregorian today))))))
          (completion-ignore-case t)
@@ -183,7 +181,7 @@ Echo Coptic date unless NOECHO is t."
 
 (defvar date)
 
-;; To be called from list-sexp-diary-entries, where DATE is bound.
+;; To be called from diary-list-sexp-entries, where DATE is bound.
 ;;;###diary-autoload
 (defun diary-coptic-date ()
   "Coptic calendar equivalent of date diary entry."
@@ -259,7 +257,7 @@ Echo Ethiopic date unless NOECHO is t."
 (define-obsolete-function-alias 'calendar-goto-ethiopic-date
   'calendar-ethiopic-goto-date "23.1")
 
-;; To be called from list-sexp-diary-entries, where DATE is bound.
+;; To be called from diary-list-sexp-entries, where DATE is bound.
 ;;;###diary-autoload
 (defun diary-ethiopic-date ()
   "Ethiopic calendar equivalent of date diary entry."
@@ -270,5 +268,4 @@ Echo Ethiopic date unless NOECHO is t."
 
 (provide 'cal-coptic)
 
-;; arch-tag: 72d49161-25df-4072-9312-b182cdca7627
 ;;; cal-coptic.el ends here