1. xemacs
  2. calendar

Source

calendar / cal-julian.el

Diff from to

File cal-julian.el

 ;;; cal-julian.el --- calendar functions for the Julian calendar
 
-;; Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006
+;;   Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
+;; Maintainer: Glenn Morris <rgm@gnu.org>
 ;; Keywords: calendar
 ;; Human-Keywords: Julian calendar, Julian day number, calendar, diary
 
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with XEmacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF 21.4
+;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
 
 ;;; Commentary:
 
 ;; diary.el that deal with the Julian calendar.
 
 ;; Technical details of all the calendrical calculations can be found in
-;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold,
-;; Cambridge University Press (1997).
+;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold
+;; and Nachum Dershowitz, Cambridge University Press (2001).
 
 ;; Comments, corrections, and improvements should be sent to
 ;;  Edward M. Reingold               Department of Computer Science
 
 ;;; Code:
 
+(defvar date)
+(defvar displayed-month)
+(defvar displayed-year)
+
 (require 'calendar)
 
 (defun calendar-julian-from-absolute (date)
                      today))))))
           (month-array calendar-month-name-array)
           (completion-ignore-case t)
-          (month (cdr (assoc-ignore-case
+          ;; XEmacs change, we don't have assoc-string
+          (month (cdr (cal-assoc-string
                         (completing-read
                          "Julian calendar month name: "
                          (mapcar 'list (append month-array nil))
                          nil t)
-                       (calendar-make-alist month-array 1))))
-          (last 
+                       (calendar-make-alist month-array 1) t)))
+          (last
            (if (and (zerop (% year 4)) (= month 2))
                29
              (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- month))))
           (day (calendar-read
                 (format "Julian calendar day (%d-%d): "
                         (if (and (= year 1) (= month 1)) 3 1) last)
-                '(lambda (x) 
+                '(lambda (x)
                    (and (< (if (and (= year 1) (= month 1)) 2 0) x)
                         (<= x last))))))
      (list (list month day year))))
       (or date (calendar-current-date)))))))
 
 (defun calendar-print-astro-day-number ()
-  "Show astronomical (Julian) day numberafter noon UTC on date shown by cursor."
+  "Show astronomical (Julian) day number after noon UTC on date shown by cursor."
   (interactive)
   (message
    "Astronomical (Julian) day number (at noon UTC): %s.0"
   (interactive (list (calendar-read
                       "Astronomical (Julian) day number (>1721425): "
                       '(lambda (x) (> x 1721425)))))
-  (calendar-goto-date 
-   (calendar-gregorian-from-absolute 
-    (floor 
-     (calendar-absolute-from-astro daynumber ))))
+  (calendar-goto-date
+   (calendar-gregorian-from-absolute
+    (floor
+     (calendar-absolute-from-astro daynumber))))
   (or noecho (calendar-print-astro-day-number)))
 
 (defun diary-astro-day-number ()
 
 (provide 'cal-julian)
 
+;;; arch-tag: 0520acdd-1c60-4188-9aa8-9b8c24d856ae
 ;;; cal-julian.el ends here