summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-04-18 21:11:01 -0700
committerGlenn Morris <rgm@gnu.org>2011-04-18 21:11:01 -0700
commitbc4f7f3d586a8d32718e27e99226d1b5ab091db5 (patch)
tree7d3239f45a1385b3686c74fbccce23f5509a71c1
parent16a43933e891bae502efbe367e32608fcfffdec3 (diff)
downloademacs-bc4f7f3d586a8d32718e27e99226d1b5ab091db5.tar.gz
calendar housekeeping prompted by lexical-binding.
* lisp/calendar/appt.el (appt-make-list): * lisp/calendar/cal-china.el (calendar-chinese-date-string): * lisp/calendar/cal-hebrew.el (calendar-hebrew-list-yahrzeits) (diary-hebrew-yahrzeit): * lisp/calendar/cal-tex.el (cal-tex-last-blank-p, cal-tex-cursor-week2): * lisp/calendar/calendar.el (calendar-generate-window): * lisp/calendar/time-date.el (time-to-days): Remove unused local variables. * lisp/calendar/cal-dst.el (dst-adjust-time): Remove never-implemented optional argument `style'. * lisp/calendar/cal-tex.el (cal-tex-list-holidays, cal-tex-cursor-month) (cal-tex-cursor-week, cal-tex-cursor-week2, cal-tex-cursor-week-iso) (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week) (cal-tex-cursor-filofax-daily, cal-tex-mini-calendar) * lisp/calendar/cal-html.el (cal-html-insert-minical): * lisp/calendar/diary-lib.el (diary-list-entries-1, diary-list-entries) (calendar-mark-date-pattern): Prefix "unused" locals.
-rw-r--r--lisp/ChangeLog23
-rw-r--r--lisp/calendar/appt.el1
-rw-r--r--lisp/calendar/cal-china.el3
-rw-r--r--lisp/calendar/cal-dst.el6
-rw-r--r--lisp/calendar/cal-hebrew.el4
-rw-r--r--lisp/calendar/cal-html.el2
-rw-r--r--lisp/calendar/cal-tex.el27
-rw-r--r--lisp/calendar/calendar.el1
-rw-r--r--lisp/calendar/diary-lib.el6
-rw-r--r--lisp/calendar/time-date.el2
10 files changed, 42 insertions, 33 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2e024d34981..693fae97ee5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,26 @@
+2011-04-19 Glenn Morris <rgm@gnu.org>
+
+ * calendar/cal-tex.el (cal-tex-list-holidays, cal-tex-cursor-month)
+ (cal-tex-cursor-week, cal-tex-cursor-week2, cal-tex-cursor-week-iso)
+ (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week)
+ (cal-tex-cursor-filofax-daily, cal-tex-mini-calendar)
+ * calendar/cal-html.el (cal-html-insert-minical):
+ * calendar/diary-lib.el (diary-list-entries-1, diary-list-entries)
+ (calendar-mark-date-pattern):
+ Prefix "unused" locals.
+
+ * calendar/cal-dst.el (dst-adjust-time): Remove never-implemented
+ optional argument `style'.
+
+ * calendar/appt.el (appt-make-list):
+ * calendar/cal-china.el (calendar-chinese-date-string):
+ * calendar/cal-hebrew.el (calendar-hebrew-list-yahrzeits)
+ (diary-hebrew-yahrzeit):
+ * calendar/cal-tex.el (cal-tex-last-blank-p, cal-tex-cursor-week2):
+ * calendar/calendar.el (calendar-generate-window):
+ * calendar/time-date.el (time-to-days):
+ Remove unused local variables.
+
2011-04-18 Chong Yidong <cyd@stupidchicken.com>
* emacs-lisp/tabulated-list.el (tabulated-list-mode): Use a custom
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index c0f4f0f3929..1394efa880e 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -509,7 +509,6 @@ Any appointments made with `appt-add' are not affected by this function."
;; entry begins with a time, add it to the
;; appt-time-msg-list. Then sort the list.
(let ((entry-list diary-entries-list)
- (new-time-string "")
time-string)
;; Below, we assume diary-entries-list was in date
;; order. It is, unless something on
diff --git a/lisp/calendar/cal-china.el b/lisp/calendar/cal-china.el
index fce398709ad..d17c2c71f8a 100644
--- a/lisp/calendar/cal-china.el
+++ b/lisp/calendar/cal-china.el
@@ -575,8 +575,7 @@ Defaults to today's date if DATE is not given."
;; Remainder of (1+(floor month))/12, with
;; 12 instead of 0.
(1+ (mod (floor month) 12))
- 1)))
- (m-cycle (% (+ (* year 5) (floor month)) 60)))
+ 1))))
(format "Cycle %s, year %s (%s), %smonth %s%s, day %s (%s)"
cycle
year (calendar-chinese-sexagesimal-name year)
diff --git a/lisp/calendar/cal-dst.el b/lisp/calendar/cal-dst.el
index e915f7e2696..ffb367a70f6 100644
--- a/lisp/calendar/cal-dst.el
+++ b/lisp/calendar/cal-dst.el
@@ -445,16 +445,12 @@ Fractional part of DATE is local standard time of day."
(or (<= dst-starts date) (< date dst-ends))))))
;; used by calc, lunar, solar.
-(defun dst-adjust-time (date time &optional style)
+(defun dst-adjust-time (date time)
"Adjust, to account for dst on DATE, decimal fraction standard TIME.
Returns a list (date adj-time zone) where `date' and `adj-time' are the values
adjusted for `zone'; here `date' is a list (month day year), `adj-time' is a
decimal fraction time, and `zone' is a string.
-Optional parameter STYLE forces the result time to be standard time when its
-value is 'standard and daylight saving time (if available) when its value is
-'daylight.
-
Conversion to daylight saving time is done according to
`calendar-daylight-savings-starts', `calendar-daylight-savings-ends',
`calendar-daylight-savings-starts-time',
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el
index 44c3e62a7c2..52bf442915f 100644
--- a/lisp/calendar/cal-hebrew.el
+++ b/lisp/calendar/cal-hebrew.el
@@ -764,8 +764,6 @@ from the cursor position."
(message "Computing Yahrzeits...")
(let* ((h-date (calendar-hebrew-from-absolute
(calendar-absolute-from-gregorian death-date)))
- (h-month (calendar-extract-month h-date))
- (h-day (calendar-extract-day h-date))
(h-year (calendar-extract-year h-date))
(i (1- start-year)))
(calendar-in-read-only-buffer calendar-hebrew-yahrzeit-buffer
@@ -900,8 +898,6 @@ use when highlighting the day in the calendar."
(+ (calendar-absolute-from-gregorian
(diary-make-date death-month death-day death-year))
(if after-sunset 1 0))))
- (h-month (calendar-extract-month h-date))
- (h-day (calendar-extract-day h-date))
(h-year (calendar-extract-year h-date))
(d (calendar-absolute-from-gregorian date))
(yr (calendar-extract-year (calendar-hebrew-from-absolute d)))
diff --git a/lisp/calendar/cal-html.el b/lisp/calendar/cal-html.el
index bd10aa176ae..bcc19ccda0b 100644
--- a/lisp/calendar/cal-html.el
+++ b/lisp/calendar/cal-html.el
@@ -247,7 +247,7 @@ Contains links to previous and next month and year, and current minical."
(insert cal-html-e-tablerow-string)
;; Initial empty slots.
(insert cal-html-b-tablerow-string)
- (dotimes (i blank-days)
+ (dotimes (_i blank-days)
(insert
cal-html-b-tabledata-string
cal-html-e-tabledata-string))
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el
index 2fc215c06c4..89e265aeb7e 100644
--- a/lisp/calendar/cal-tex.el
+++ b/lisp/calendar/cal-tex.el
@@ -253,7 +253,7 @@ This definition is the heart of the calendar!")
3)))
holidays in-range a)
(calendar-increment-month displayed-month displayed-year 1)
- (dotimes (idummy number-of-intervals)
+ (dotimes (_idummy number-of-intervals)
(setq holidays (append holidays (calendar-holiday-list)))
(calendar-increment-month displayed-month displayed-year 3))
(dolist (hol holidays)
@@ -525,7 +525,7 @@ indicates a buffer position to use instead of point."
(cal-tex-insert-day-names)
(cal-tex-nl ".2cm")
(cal-tex-insert-blank-days month year cal-tex-day-prefix)
- (dotimes (idummy n)
+ (dotimes (_idummy n)
(cal-tex-insert-days month year diary-list holidays cal-tex-day-prefix)
(when (= (calendar-week-end-day)
(calendar-day-of-week
@@ -642,7 +642,7 @@ in the calendar starting in MONTH YEAR."
;; start of the last week in the month.
(catch 'found
(let ((last-day (calendar-last-day-of-month month year))
- day dow)
+ dow)
(dotimes (i 7)
(if (memq (setq dow (calendar-day-of-week
(list month (- last-day i) year)))
@@ -717,7 +717,7 @@ entries are not shown). The calendar shows the hours 8-12am, 1-5pm."
(cal-tex-e-center)
(cal-tex-hspace "-.2in")
(cal-tex-b-parbox "l" "7in")
- (dotimes (jdummy 7)
+ (dotimes (_jdummy 7)
(cal-tex-week-hours date holidays "3.1")
(setq date (cal-tex-incr-date date)))
(cal-tex-e-parbox)
@@ -749,7 +749,6 @@ Optional EVENT indicates a buffer position to use instead of point."
(calendar-cursor-to-date t event)))))
(month (calendar-extract-month date))
(year (calendar-extract-year date))
- (d date)
(d1 (calendar-absolute-from-gregorian date))
(d2 (+ (* 7 n) d1))
(holidays (if cal-tex-holidays
@@ -773,7 +772,7 @@ Optional EVENT indicates a buffer position to use instead of point."
(cal-tex-e-center)
(cal-tex-hspace "-.2in")
(cal-tex-b-parbox "l" "\\textwidth")
- (dotimes (jdummy 3)
+ (dotimes (_jdummy 3)
(cal-tex-week-hours date holidays "5")
(setq date (cal-tex-incr-date date)))
(cal-tex-e-parbox)
@@ -801,7 +800,7 @@ Optional EVENT indicates a buffer position to use instead of point."
(insert "}")
(cal-tex-nl)
(cal-tex-b-parbox "l" "\\textwidth")
- (dotimes (jdummy 4)
+ (dotimes (_jdummy 4)
(cal-tex-week-hours date holidays "5")
(setq date (cal-tex-incr-date date)))
(cal-tex-e-parbox)
@@ -863,7 +862,7 @@ position to use instead of point."
(cal-tex-nl ".5cm")
(cal-tex-e-center)
(cal-tex-b-parbox "l" "\\textwidth")
- (dotimes (j 7)
+ (dotimes (_j 7)
(cal-tex-b-parbox "t" "\\textwidth")
(cal-tex-b-parbox "t" "\\textwidth")
(cal-tex-rule "0pt" "\\textwidth" ".2mm")
@@ -1112,7 +1111,7 @@ Optional EVENT indicates a buffer position to use instead of point."
(cal-tex-month-name (calendar-extract-month d))
(calendar-extract-year d))))))
(insert "%\n")
- (dotimes (jdummy 7)
+ (dotimes (_jdummy 7)
(if (zerop (mod i 2))
(insert "\\rightday")
(insert "\\leftday"))
@@ -1216,7 +1215,7 @@ Optional EVENT indicates a buffer position to use instead of point."
(cal-tex-month-name (calendar-extract-month d))
(calendar-extract-year d))))))
(insert "%\n")
- (dotimes (jdummy 3)
+ (dotimes (_jdummy 3)
(insert "\\leftday")
(cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
(cal-tex-arg (number-to-string (calendar-extract-day date)))
@@ -1247,7 +1246,7 @@ Optional EVENT indicates a buffer position to use instead of point."
(cal-tex-month-name (calendar-extract-month d))
(calendar-extract-year d))))))
(insert "%\n")
- (dotimes (jdummy 2)
+ (dotimes (_jdummy 2)
(insert "\\rightday")
(cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
(cal-tex-arg (number-to-string (calendar-extract-day date)))
@@ -1256,7 +1255,7 @@ Optional EVENT indicates a buffer position to use instead of point."
(cal-tex-arg (eval cal-tex-daily-string))
(insert "%\n")
(setq date (cal-tex-incr-date date)))
- (dotimes (jdummy 2)
+ (dotimes (_jdummy 2)
(insert "\\weekend")
(cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
(cal-tex-arg (number-to-string (calendar-extract-day date)))
@@ -1362,7 +1361,7 @@ Optional EVENT indicates a buffer position to use instead of point."
(cal-tex-newpage)
(setq date (cal-tex-incr-date date)))
(insert "%\n")
- (dotimes (jdummy 2)
+ (dotimes (_jdummy 2)
(insert "\\lefthead")
(cal-tex-arg (calendar-date-string date))
(insert "\\weekend")
@@ -1523,7 +1522,7 @@ Optional string COLSEP gives the column separation (default \"1mm\")."
(if (= i 6)
"\\\\[0.7mm]\n"
" & "))))
- (dotimes (idummy blank-days)
+ (dotimes (_idummy blank-days)
(setq str (concat str " & ")))
(dotimes (i last)
(setq str (concat str (number-to-string (1+ i)))
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 99b0c21c94c..e81eb554458 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -1363,7 +1363,6 @@ Optional integers MON and YR are used instead of today's date."
(year (calendar-extract-year today))
(today-visible (or (not mon)
(<= (abs (calendar-interval mon yr month year)) 1)))
- (day-in-week (calendar-day-of-week today))
(in-calendar-window (eq (window-buffer (selected-window))
(get-buffer calendar-buffer))))
(calendar-generate (or mon month) (or yr year))
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 9a455c4f2f0..a2528ac22ca 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -710,7 +710,7 @@ MONTHS is an array of month names. SYMBOL marks diary entries of the type
in question. ABSFUNC is a function that converts absolute dates to dates
of the appropriate type."
(let ((gdate original-date))
- (dotimes (idummy number)
+ (dotimes (_idummy number)
(diary-list-entries-2
(funcall absfunc (calendar-absolute-from-gregorian gdate))
diary-nonmarking-symbol file-glob-attrs list-only months symbol gdate)
@@ -820,7 +820,7 @@ LIST-ONLY is non-nil, in which case it just returns the list."
(set (make-local-variable 'diary-selective-display) t)
(overlay-put ol 'invisible 'diary)
(overlay-put ol 'evaporate t)))
- (dotimes (idummy number)
+ (dotimes (_idummy number)
(let ((sexp-found (diary-list-sexp-entries date))
(entry-found (diary-list-entries-2
date diary-nonmarking-symbol
@@ -1509,7 +1509,7 @@ passed to `calendar-mark-visible-date' as MARK."
(let ((m displayed-month)
(y displayed-year))
(calendar-increment-month m y -1)
- (dotimes (idummy 3)
+ (dotimes (_idummy 3)
(calendar-mark-month m y month day year color)
(calendar-increment-month m y 1)))))
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index 62203600612..70d096c4108 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -243,8 +243,6 @@ DATE1 and DATE2 should be date-time strings."
TIME should be a time value.
The Gregorian date Sunday, December 31, 1bce is imaginary."
(let* ((tim (decode-time time))
- (month (nth 4 tim))
- (day (nth 3 tim))
(year (nth 5 tim)))
(+ (time-to-day-in-year time) ; Days this year
(* 365 (1- year)) ; + Days in prior years