diff options
| author | Glenn Morris | 2008-03-08 04:21:13 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-03-08 04:21:13 +0000 |
| commit | f83f0d87a59774bb0c6f1167f8c7639a98a05366 (patch) | |
| tree | fc1dcd681213940cec151a6b97e26914ae9299bf | |
| parent | 1ddbd3a6f2956a72c0e2ff2307a0dd3d73277f77 (diff) | |
| download | emacs-f83f0d87a59774bb0c6f1167f8c7639a98a05366.tar.gz emacs-f83f0d87a59774bb0c6f1167f8c7639a98a05366.zip | |
(calendar-absolute-from-julian): Use zerop.
Comments.
| -rw-r--r-- | lisp/calendar/cal-julian.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/calendar/cal-julian.el b/lisp/calendar/cal-julian.el index f033e6864d9..d8752cb03a7 100644 --- a/lisp/calendar/cal-julian.el +++ b/lisp/calendar/cal-julian.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; cal-julian.el --- calendar functions for the Julian calendar | 1 | ;;; cal-julian.el --- calendar functions for the Julian calendar |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 | 3 | ;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; 2008 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> | 6 | ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> |
| 7 | ;; Maintainer: Glenn Morris <rgm@gnu.org> | 7 | ;; Maintainer: Glenn Morris <rgm@gnu.org> |
| @@ -36,7 +36,6 @@ | |||
| 36 | 36 | ||
| 37 | ;;; Code: | 37 | ;;; Code: |
| 38 | 38 | ||
| 39 | (defvar date) | ||
| 40 | (defvar displayed-month) | 39 | (defvar displayed-month) |
| 41 | (defvar displayed-year) | 40 | (defvar displayed-year) |
| 42 | 41 | ||
| @@ -75,7 +74,7 @@ The Gregorian date Sunday, December 31, 1 BC is imaginary." | |||
| 75 | (day (extract-calendar-day date)) | 74 | (day (extract-calendar-day date)) |
| 76 | (year (extract-calendar-year date))) | 75 | (year (extract-calendar-year date))) |
| 77 | (+ (calendar-day-number date) | 76 | (+ (calendar-day-number date) |
| 78 | (if (and (= (% year 100) 0) | 77 | (if (and (zerop (% year 100)) |
| 79 | (/= (% year 400) 0) | 78 | (/= (% year 400) 0) |
| 80 | (> month 2)) | 79 | (> month 2)) |
| 81 | 1 0);; Correct for Julian but not Gregorian leap year. | 80 | 1 0);; Correct for Julian but not Gregorian leap year. |
| @@ -164,6 +163,9 @@ nil if it is not visible in the current calendar window." | |||
| 164 | (if (calendar-date-is-visible-p date) | 163 | (if (calendar-date-is-visible-p date) |
| 165 | (list (list date string))))))) | 164 | (list (list date string))))))) |
| 166 | 165 | ||
| 166 | (defvar date) | ||
| 167 | |||
| 168 | ;; To be called from list-sexp-diary-entries, where DATE is bound. | ||
| 167 | (defun diary-julian-date () | 169 | (defun diary-julian-date () |
| 168 | "Julian calendar equivalent of date diary entry." | 170 | "Julian calendar equivalent of date diary entry." |
| 169 | (format "Julian date: %s" (calendar-julian-date-string date))) | 171 | (format "Julian date: %s" (calendar-julian-date-string date))) |
| @@ -209,6 +211,7 @@ Echo astronomical (Julian) day number unless NOECHO is t." | |||
| 209 | (calendar-absolute-from-astro daynumber)))) | 211 | (calendar-absolute-from-astro daynumber)))) |
| 210 | (or noecho (calendar-print-astro-day-number))) | 212 | (or noecho (calendar-print-astro-day-number))) |
| 211 | 213 | ||
| 214 | ;; To be called from list-sexp-diary-entries, where DATE is bound. | ||
| 212 | (defun diary-astro-day-number () | 215 | (defun diary-astro-day-number () |
| 213 | "Astronomical (Julian) day number diary entry." | 216 | "Astronomical (Julian) day number diary entry." |
| 214 | (format "Astronomical (Julian) day number at noon UTC: %s.0" | 217 | (format "Astronomical (Julian) day number at noon UTC: %s.0" |