(generate-calendar, (generate-calendar-month): Use dotimes rather than
authorGlenn Morris <rgm@gnu.org>
Tue, 24 Jul 2007 06:12:32 +0000 (06:12 +0000)
committerGlenn Morris <rgm@gnu.org>
Tue, 24 Jul 2007 06:12:32 +0000 (06:12 +0000)
calendar-for-loop.
(calendar-for-loop): Doc fix.

lisp/ChangeLog
lisp/calendar/calendar.el

index 32599427112bb191131424677bba77578c623e6e..99dccffd837b59bc05522b30abdfb7cfeb72cec9 100644 (file)
        (cal-tex-em, cal-tex-bf, cal-tex-Huge-bf, cal-tex-large-bf): Use
        \textit and \textbf rather than \em and \it.
 
+       * calendar/cal-bahai.el (list-bahai-diary-entries)
+       * calendar/cal-hebrew.el (list-hebrew-diary-entries)
+       * calendar/cal-islam.el (list-islamic-diary-entries)
+       * calendar/calendar.el (generate-calendar)
+       (generate-calendar-month)
+       * calendar/diary-lib.el (diary-list-entries)
+       (mark-calendar-date-pattern): Use `dotimes' rather than
+       `calendar-for-loop'.
+
+       * calendar/calendar.el (calendar-for-loop): Doc fix.
+
 2007-07-23  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * ses.el (ses-cleanup): Prevent Emacs from spuriously checking if the
index 83ec95c844c6ac0d2599b851b75072ed0ec786ce..74ee75f295baf4ef0a9ef0c88e9b95f7853129b5 100644 (file)
@@ -1343,7 +1343,9 @@ MON defaults to `displayed-month'.  YR defaults to `displayed-year'."
   (cons mon yr))
 
 (defmacro calendar-for-loop (var from init to final do &rest body)
-  "Execute a for loop."
+  "Execute a for loop.
+Evaluate BODY with VAR bound to successive integers from INIT to FINAL,
+inclusive."
   (declare (debug (symbolp "from" form "to" form "do" body)))
   `(let ((,var (1- ,init)))
     (while (>= ,final (setq ,var (1+ ,var)))
@@ -2110,9 +2112,9 @@ Or, for optional MON, YR."
         displayed-year year)
   (erase-buffer)
   (increment-calendar-month month year -1)
-  (calendar-for-loop i from 0 to 2 do
-       (generate-calendar-month month year (+ 5 (* 25 i)))
-       (increment-calendar-month month year 1)))
+  (dotimes (i 3)
+    (generate-calendar-month month year (+ 5 (* 25 i)))
+    (increment-calendar-month month year 1)))
 
 (defun generate-calendar-month (month year indent)
   "Produce a calendar for MONTH, YEAR on the Gregorian calendar.
@@ -2133,18 +2135,18 @@ line."
     indent t)
    (calendar-insert-indented "" indent);; Go to proper spot
    ;; Use the first two characters of each day to head the columns.
-   (calendar-for-loop i from 0 to 6 do
-      (insert
-       (let ((string
-              (calendar-day-name (mod (+ calendar-week-start-day i) 7) nil t)))
-         (if enable-multibyte-characters
-             (truncate-string-to-width string 2)
-           (substring string 0 2)))
-       " "))
+   (dotimes (i 7)
+     (insert
+      (let ((string
+             (calendar-day-name (mod (+ calendar-week-start-day i) 7) nil t)))
+        (if enable-multibyte-characters
+            (truncate-string-to-width string 2)
+          (substring string 0 2)))
+      " "))
    (calendar-insert-indented "" 0 t);; Force onto following line
    (calendar-insert-indented "" indent);; Go to proper spot
    ;; Add blank days before the first of the month
-   (calendar-for-loop i from 1 to blank-days do (insert "   "))
+   (dotimes (idummy blank-days) (insert "   "))
    ;; Put in the days of the month
    (calendar-for-loop i from 1 to last do
       (insert (format "%2d " i))