changeset 92960:5a10f6dafd69

(displayed-month, displayed-year): Move declarations where needed. (calendar-list-holidays): Doc fix.
author Glenn Morris <rgm@gnu.org>
date Sat, 15 Mar 2008 02:55:45 +0000
parents 1f109b306995
children 6392aaa2f903
files lisp/calendar/holidays.el
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/holidays.el	Sat Mar 15 02:55:25 2008 +0000
+++ b/lisp/calendar/holidays.el	Sat Mar 15 02:55:45 2008 +0000
@@ -52,9 +52,6 @@
 (eval-and-compile
   (load "hol-loaddefs" nil 'quiet))
 
-(defvar displayed-month)                ; from generate-calendar
-(defvar displayed-year)
-
 ;;;###diary-autoload
 (defun calendar-holiday-list ()
   "Form the list of holidays that occur on dates in the calendar window.
@@ -74,11 +71,14 @@
             (setq holiday-list (append holidays holiday-list)))))
     (setq holiday-list (sort holiday-list 'calendar-date-compare))))
 
+(defvar displayed-month)                ; from generate-calendar
+(defvar displayed-year)
+
 ;;;###cal-autoload
 (defun calendar-list-holidays ()
   "Create a buffer containing the holidays for the current calendar window.
 The holidays are those in the list `calendar-notable-days'.  Returns t if any
-holidays are found, nil if not."
+holidays are found, otherwise nil."
   (interactive)
   (message "Looking up holidays...")
   (let ((holiday-list (calendar-holiday-list))
@@ -331,11 +331,11 @@
          (y2 y1))
     (increment-calendar-month m1 y1 -1)
     (increment-calendar-month m2 y2 1)
-    (let* ((d1                 ;  first possible base date for holiday
+    (let* ((d1                 ; first possible base date for holiday
             (+ (calendar-nth-named-absday 1 dayname m1 y1)
                (* -7 n)
                (if (> n 0) 1 -7)))
-           (d2                  ;  last possible base date for holiday
+           (d2                  ; last possible base date for holiday
             (+ (calendar-nth-named-absday -1 dayname m2 y2)
                (* -7 n)
                (if (> n 0) 7 -1)))
@@ -453,14 +453,14 @@
               (setq res-list (append res res-list)))))
     (let* ((century (1+ (/ displayed-year 100)))
            (shifted-epact               ; age of moon for April 5...
-            (% (+ 14 (* 11 (% displayed-year 19)) ;     ...by Nicaean rule
+            (% (+ 14 (* 11 (% displayed-year 19)) ; ...by Nicaean rule
                   (-     ; ...corrected for the Gregorian century rule
                    (/ (* 3 century) 4))
                   (/       ; ...corrected for Metonic cycle inaccuracy
                    (+ 5 (* 8 century)) 25)
-                  (* 30 century))  ;              keeps value positive
+                  (* 30 century))       ; keeps value positive
                30))
-           (adjusted-epact              ;  adjust for 29.5 day month
+           (adjusted-epact              ; adjust for 29.5 day month
             (if (or (zerop shifted-epact)
                     (and (= shifted-epact 1) (< 10 (% displayed-year 19))))
                 (1+ shifted-epact)