diff --git a/lisp/calendar/cal-bahai.el b/lisp/calendar/cal-bahai.el index 16176e37b4a3..c2e4205c0bc4 100644 --- a/lisp/calendar/cal-bahai.el +++ b/lisp/calendar/cal-bahai.el @@ -1,4 +1,4 @@ -;;; cal-bahai.el --- calendar functions for the Bahá’í calendar. +;;; cal-bahai.el --- calendar functions for the Bahá’í calendar. -*- lexical-binding: t; -*- ;; Copyright (C) 2001-2021 Free Software Foundation, Inc. @@ -124,9 +124,10 @@ Defaults to today's date if DATE is not given." (y (calendar-extract-year bahai-date))) (if (< y 1) "" ; pre-Bahai - (let* ((m (calendar-extract-month bahai-date)) - (d (calendar-extract-day bahai-date)) - (monthname (if (and (= m 19) + (let ((m (calendar-extract-month bahai-date)) + (d (calendar-extract-day bahai-date))) + (calendar-dlet* + ((monthname (if (and (= m 19) (<= d 0)) "Ayyám-i-Há" (aref calendar-bahai-month-name-array (1- m)))) @@ -137,8 +138,8 @@ Defaults to today's date if DATE is not given." (year (number-to-string y)) (month (number-to-string m)) dayname) - ;; Can't call calendar-date-string because of monthname oddity. - (mapconcat 'eval calendar-date-display-form ""))))) + ;; Can't call calendar-date-string because of monthname oddity. + (mapconcat #'eval calendar-date-display-form "")))))) ;;;###cal-autoload (defun calendar-bahai-print-date () diff --git a/lisp/calendar/cal-china.el b/lisp/calendar/cal-china.el index dd69d849df16..9a28984a7aba 100644 --- a/lisp/calendar/cal-china.el +++ b/lisp/calendar/cal-china.el @@ -1,4 +1,4 @@ -;;; cal-china.el --- calendar functions for the Chinese calendar +;;; cal-china.el --- calendar functions for the Chinese calendar -*- lexical-binding: t; -*- ;; Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc. @@ -185,7 +185,9 @@ N congruent to 1 gives the first name, N congruent to 2 gives the second name, (defun calendar-chinese-zodiac-sign-on-or-after (d) "Absolute date of first new Zodiac sign on or after absolute date D. The Zodiac signs begin when the sun's longitude is a multiple of 30 degrees." - (let* ((year (calendar-extract-year (calendar-gregorian-from-absolute d))) + (with-suppressed-warnings ((lexical year)) + (defvar year)) + (let* ((year (calendar-extract-year (calendar-gregorian-from-absolute d))) (calendar-time-zone (eval calendar-chinese-time-zone)) ; uses year (calendar-daylight-time-offset calendar-chinese-daylight-time-offset) @@ -207,6 +209,8 @@ The Zodiac signs begin when the sun's longitude is a multiple of 30 degrees." (defun calendar-chinese-new-moon-on-or-after (d) "Absolute date of first new moon on or after absolute date D." + (with-suppressed-warnings ((lexical year)) + (defvar year)) (let* ((year (calendar-extract-year (calendar-gregorian-from-absolute d))) (calendar-time-zone (eval calendar-chinese-time-zone)) (calendar-daylight-time-offset @@ -665,17 +669,17 @@ Echo Chinese date unless NOECHO is non-nil." ["正月" "二月" "三月" "四月" "五月" "六月" "七月" "八月" "九月" "十月" "冬月" "臘月"]) -;;; NOTE: In the diary the cycle and year of a Chinese date is -;;; combined using this formula: (+ (* cycle 100) year). +;; NOTE: In the diary the cycle and year of a Chinese date is +;; combined using this formula: (+ (* cycle 100) year). ;;; -;;; These two functions convert to and back from this representation. -(defun calendar-chinese-from-absolute-for-diary (date) - (pcase-let ((`(,c ,y ,m ,d) (calendar-chinese-from-absolute date))) +;; These two functions convert to and back from this representation. +(defun calendar-chinese-from-absolute-for-diary (thedate) + (pcase-let ((`(,c ,y ,m ,d) (calendar-chinese-from-absolute thedate))) ;; Note: For leap months M is a float. (list (floor m) d (+ (* c 100) y)))) -(defun calendar-chinese-to-absolute-for-diary (date &optional prefer-leap) - (pcase-let* ((`(,m ,d ,y) date) +(defun calendar-chinese-to-absolute-for-diary (thedate &optional prefer-leap) + (pcase-let* ((`(,m ,d ,y) thedate) (cycle (floor y 100)) (year (mod y 100)) (months (calendar-chinese-months cycle year)) @@ -693,7 +697,8 @@ Echo Chinese date unless NOECHO is non-nil." (unless (zerop month) (calendar-mark-1 month day year #'calendar-chinese-from-absolute-for-diary - (lambda (date) (calendar-chinese-to-absolute-for-diary date t)) + (lambda (thedate) + (calendar-chinese-to-absolute-for-diary thedate t)) color))) ;;;###cal-autoload diff --git a/lisp/calendar/cal-coptic.el b/lisp/calendar/cal-coptic.el index 2a0e7d81e0c0..346585e1817d 100644 --- a/lisp/calendar/cal-coptic.el +++ b/lisp/calendar/cal-coptic.el @@ -1,4 +1,4 @@ -;;; cal-coptic.el --- calendar functions for the Coptic/Ethiopic calendars +;;; cal-coptic.el --- calendar functions for the Coptic/Ethiopic calendars -*- lexical-binding: t; -*- ;; Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc. @@ -116,12 +116,13 @@ Defaults to today's date if DATE is not given." (m (calendar-extract-month coptic-date))) (if (< y 1) "" - (let ((monthname (aref calendar-coptic-month-name-array (1- m))) - (day (number-to-string (calendar-extract-day coptic-date))) - (dayname nil) - (month (number-to-string m)) - (year (number-to-string y))) - (mapconcat 'eval calendar-date-display-form ""))))) + (calendar-dlet* + ((monthname (aref calendar-coptic-month-name-array (1- m))) + (day (number-to-string (calendar-extract-day coptic-date))) + (dayname nil) + (month (number-to-string m)) + (year (number-to-string y))) + (mapconcat #'eval calendar-date-display-form ""))))) ;;;###cal-autoload (defun calendar-coptic-print-date () @@ -197,30 +198,30 @@ Echo Coptic date unless NOECHO is t." (defconst calendar-ethiopic-name "Ethiopic" "Used in some message strings.") -(defun calendar-ethiopic-to-absolute (date) +(defun calendar-ethiopic-to-absolute (thedate) "Compute absolute date from Ethiopic date DATE. The absolute date is the number of days elapsed since the (imaginary) Gregorian date Sunday, December 31, 1 BC." (let ((calendar-coptic-epoch calendar-ethiopic-epoch)) - (calendar-coptic-to-absolute date))) + (calendar-coptic-to-absolute thedate))) -(defun calendar-ethiopic-from-absolute (date) +(defun calendar-ethiopic-from-absolute (thedate) "Compute the Ethiopic equivalent for absolute date DATE. The result is a list of the form (MONTH DAY YEAR). The absolute date is the number of days elapsed since the imaginary Gregorian date Sunday, December 31, 1 BC." (let ((calendar-coptic-epoch calendar-ethiopic-epoch)) - (calendar-coptic-from-absolute date))) + (calendar-coptic-from-absolute thedate))) ;;;###cal-autoload -(defun calendar-ethiopic-date-string (&optional date) +(defun calendar-ethiopic-date-string (&optional thedate) "String of Ethiopic date of Gregorian DATE. Returns the empty string if DATE is pre-Ethiopic calendar. Defaults to today's date if DATE is not given." (let ((calendar-coptic-epoch calendar-ethiopic-epoch) (calendar-coptic-name calendar-ethiopic-name) (calendar-coptic-month-name-array calendar-ethiopic-month-name-array)) - (calendar-coptic-date-string date))) + (calendar-coptic-date-string thedate))) ;;;###cal-autoload (defun calendar-ethiopic-print-date () @@ -232,8 +233,8 @@ Defaults to today's date if DATE is not given." (call-interactively 'calendar-coptic-print-date))) ;;;###cal-autoload -(defun calendar-ethiopic-goto-date (date &optional noecho) - "Move cursor to Ethiopic date DATE. +(defun calendar-ethiopic-goto-date (thedate &optional noecho) + "Move cursor to Ethiopic date THEDATE. Echo Ethiopic date unless NOECHO is t." (interactive (let ((calendar-coptic-epoch calendar-ethiopic-epoch) @@ -241,7 +242,7 @@ Echo Ethiopic date unless NOECHO is t." (calendar-coptic-month-name-array calendar-ethiopic-month-name-array)) (calendar-coptic-read-date))) (calendar-goto-date (calendar-gregorian-from-absolute - (calendar-ethiopic-to-absolute date))) + (calendar-ethiopic-to-absolute thedate))) (or noecho (calendar-ethiopic-print-date))) ;; To be called from diary-list-sexp-entries, where DATE is bound. diff --git a/lisp/calendar/cal-french.el b/lisp/calendar/cal-french.el index 07c41c00bfe0..639bae700cc9 100644 --- a/lisp/calendar/cal-french.el +++ b/lisp/calendar/cal-french.el @@ -1,4 +1,4 @@ -;;; cal-french.el --- calendar functions for the French Revolutionary calendar +;;; cal-french.el --- calendar functions for the French Revolutionary calendar -*- lexical-binding: t; -*- ;; Copyright (C) 1988-1989, 1992, 1994-1995, 1997, 2001-2021 Free ;; Software Foundation, Inc. diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el index a835f9b430e7..50b4fc363bbf 100644 --- a/lisp/calendar/cal-hebrew.el +++ b/lisp/calendar/cal-hebrew.el @@ -1,4 +1,4 @@ -;;; cal-hebrew.el --- calendar functions for the Hebrew calendar +;;; cal-hebrew.el --- calendar functions for the Hebrew calendar -*- lexical-binding: t; -*- ;; Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc. @@ -399,19 +399,20 @@ is non-nil." (list m (calendar-last-day-of-month m y) y)))))) (abs-h (calendar-hebrew-to-absolute (list 9 25 h-y))) (ord ["first" "second" "third" "fourth" "fifth" "sixth" - "seventh" "eighth"]) - han) + "seventh" "eighth"])) (holiday-filter-visible-calendar (if (or all calendar-hebrew-all-holidays-flag) (append (list (list (calendar-gregorian-from-absolute (1- abs-h)) "Erev Hanukkah")) - (dotimes (i 8 (nreverse han)) - (push (list - (calendar-gregorian-from-absolute (+ abs-h i)) - (format "Hanukkah (%s day)" (aref ord i))) - han))) + (let (han) + (dotimes (i 8) + (push (list + (calendar-gregorian-from-absolute (+ abs-h i)) + (format "Hanukkah (%s day)" (aref ord i))) + han)) + (nreverse han))) (list (list (calendar-gregorian-from-absolute abs-h) "Hanukkah"))))))) ;;;###holiday-autoload diff --git a/lisp/calendar/cal-html.el b/lisp/calendar/cal-html.el index 3d7cc938437f..e5810c3f0276 100644 --- a/lisp/calendar/cal-html.el +++ b/lisp/calendar/cal-html.el @@ -1,4 +1,4 @@ -;;; cal-html.el --- functions for printing HTML calendars +;;; cal-html.el --- functions for printing HTML calendars -*- lexical-binding: t; -*- ;; Copyright (C) 2002-2021 Free Software Foundation, Inc. @@ -250,7 +250,7 @@ Contains links to previous and next month and year, and current minical." calendar-week-start-day)) 7)) (monthpage-name (cal-html-monthpage-name month year)) - date) + ) ;; date ;; Start writing table. (insert (cal-html-comment "MINICAL") (cal-html-b-table "class=minical border=1 align=center")) @@ -276,7 +276,7 @@ Contains links to previous and next month and year, and current minical." (insert cal-html-e-tablerow-string cal-html-b-tablerow-string))) ;; End empty slots (for some browsers like konqueror). - (dotimes (i end-blank-days) + (dotimes (_ end-blank-days) (insert cal-html-b-tabledata-string cal-html-e-tabledata-string))) @@ -431,12 +431,11 @@ holidays in HOLIDAY-LIST." ;;; User commands. ;;;###cal-autoload -(defun cal-html-cursor-month (month year dir &optional event) +(defun cal-html-cursor-month (month year dir &optional _event) "Write an HTML calendar file for numeric MONTH of four-digit YEAR. The output directory DIR is created if necessary. Interactively, -MONTH and YEAR are taken from the calendar cursor position, or from -the position specified by EVENT. Note that any existing output files -are overwritten." +MONTH and YEAR are taken from the calendar cursor position. +Note that any existing output files are overwritten." (interactive (let* ((event last-nonmenu-event) (date (calendar-cursor-to-date t event)) (month (calendar-extract-month date)) @@ -446,11 +445,11 @@ are overwritten." (cal-html-one-month month year dir)) ;;;###cal-autoload -(defun cal-html-cursor-year (year dir &optional event) +(defun cal-html-cursor-year (year dir &optional _event) "Write HTML calendar files (index and monthly pages) for four-digit YEAR. The output directory DIR is created if necessary. Interactively, -YEAR is taken from the calendar cursor position, or from the position -specified by EVENT. Note that any existing output files are overwritten." +YEAR is taken from the calendar cursor position. +Note that any existing output files are overwritten." (interactive (let* ((event last-nonmenu-event) (year (calendar-extract-year (calendar-cursor-to-date t event)))) diff --git a/lisp/calendar/cal-islam.el b/lisp/calendar/cal-islam.el index 4082ed43e5dc..45c6ffa7bd78 100644 --- a/lisp/calendar/cal-islam.el +++ b/lisp/calendar/cal-islam.el @@ -1,4 +1,4 @@ -;;; cal-islam.el --- calendar functions for the Islamic calendar +;;; cal-islam.el --- calendar functions for the Islamic calendar -*- lexical-binding: t; -*- ;; Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc. @@ -67,8 +67,8 @@ "Absolute date of Islamic DATE. The absolute date is the number of days elapsed since the (imaginary) Gregorian date Sunday, December 31, 1 BC." - (let* ((month (calendar-extract-month date)) - (day (calendar-extract-day date)) + (let* (;;(month (calendar-extract-month date)) + ;;(day (calendar-extract-day date)) (year (calendar-extract-year date)) (y (% year 30)) (leap-years-in-cycle (cond ((< y 3) 0) diff --git a/lisp/calendar/cal-iso.el b/lisp/calendar/cal-iso.el index a247b2d15a9a..90f57c25e9d8 100644 --- a/lisp/calendar/cal-iso.el +++ b/lisp/calendar/cal-iso.el @@ -1,4 +1,4 @@ -;;; cal-iso.el --- calendar functions for the ISO calendar +;;; cal-iso.el --- calendar functions for the ISO calendar -*- lexical-binding: t; -*- ;; Copyright (C) 1995, 1997, 2001-2021 Free Software Foundation, Inc. diff --git a/lisp/calendar/cal-mayan.el b/lisp/calendar/cal-mayan.el index e3533e7b1d61..9a2219211301 100644 --- a/lisp/calendar/cal-mayan.el +++ b/lisp/calendar/cal-mayan.el @@ -1,4 +1,4 @@ -;;; cal-mayan.el --- calendar functions for the Mayan calendars +;;; cal-mayan.el --- calendar functions for the Mayan calendars -*- lexical-binding: t; -*- ;; Copyright (C) 1992-1993, 1995, 1997, 2001-2021 Free Software ;; Foundation, Inc. diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el index a30c681a8976..497f33290551 100644 --- a/lisp/calendar/cal-menu.el +++ b/lisp/calendar/cal-menu.el @@ -1,4 +1,4 @@ -;;; cal-menu.el --- calendar functions for menu bar and popup menu support +;;; cal-menu.el --- calendar functions for menu bar and popup menu support -*- lexical-binding: t; -*- ;; Copyright (C) 1994-1995, 2001-2021 Free Software Foundation, Inc. @@ -183,6 +183,8 @@ Signals an error if popups are unavailable." ;; Autoloaded in diary-lib. (declare-function calendar-check-holidays "holidays" (date)) +(defvar diary-list-include-blanks) + (defun calendar-mouse-view-diary-entries (&optional date diary event) "Pop up menu of diary entries for mouse-selected date. Use optional DATE and alternative file DIARY. EVENT is the event diff --git a/lisp/calendar/cal-move.el b/lisp/calendar/cal-move.el index c2b5d618ea0c..9294362cb433 100644 --- a/lisp/calendar/cal-move.el +++ b/lisp/calendar/cal-move.el @@ -1,4 +1,4 @@ -;;; cal-move.el --- calendar functions for movement in the calendar +;;; cal-move.el --- calendar functions for movement in the calendar -*- lexical-binding: t; -*- ;; Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc. diff --git a/lisp/calendar/cal-persia.el b/lisp/calendar/cal-persia.el index 21085284ac83..ca37d803224b 100644 --- a/lisp/calendar/cal-persia.el +++ b/lisp/calendar/cal-persia.el @@ -1,4 +1,4 @@ -;;; cal-persia.el --- calendar functions for the Persian calendar +;;; cal-persia.el --- calendar functions for the Persian calendar -*- lexical-binding: t; -*- ;; Copyright (C) 1996-1997, 2001-2021 Free Software Foundation, Inc. @@ -139,13 +139,14 @@ Gregorian date Sunday, December 31, 1 BC." (calendar-absolute-from-gregorian (or date (calendar-current-date))))) (y (calendar-extract-year persian-date)) - (m (calendar-extract-month persian-date)) - (monthname (aref calendar-persian-month-name-array (1- m))) + (m (calendar-extract-month persian-date))) + (calendar-dlet* + ((monthname (aref calendar-persian-month-name-array (1- m))) (day (number-to-string (calendar-extract-day persian-date))) (year (number-to-string y)) (month (number-to-string m)) dayname) - (mapconcat 'eval calendar-date-display-form ""))) + (mapconcat #'eval calendar-date-display-form "")))) ;;;###cal-autoload (defun calendar-persian-print-date () diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index 9df9f4cbedf1..f5932014dd98 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -1,4 +1,4 @@ -;;; cal-tex.el --- calendar functions for printing calendars with LaTeX +;;; cal-tex.el --- calendar functions for printing calendars with LaTeX -*- lexical-binding: t; -*- ;; Copyright (C) 1995, 2001-2021 Free Software Foundation, Inc. @@ -248,6 +248,8 @@ This definition is the heart of the calendar!") (autoload 'diary-list-entries "diary-lib") +(defvar diary-list-include-blanks) + (defun cal-tex-list-diary-entries (d1 d2) "Generate a list of all diary-entries from absolute date D1 to D2." (let (diary-list-include-blanks) @@ -591,6 +593,8 @@ indicates a buffer position to use instead of point." LaTeX commands are inserted for the days of the MONTH in YEAR. Diary entries on DIARY-LIST are included. Holidays on HOLIDAYS are included. Each day is formatted using format DAY-FORMAT." + (with-suppressed-warnings ((lexical date)) + (defvar date)) ;For `cal-tex-daily-string'. (let ((blank-days ; at start of month (mod (- (calendar-day-of-week (list month 1 year)) @@ -605,7 +609,7 @@ are included. Each day is formatted using format DAY-FORMAT." (insert (format day-format (cal-tex-month-name month) j)) (cal-tex-arg (cal-tex-latexify-list diary-list date)) (cal-tex-arg (cal-tex-latexify-list holidays date)) - (cal-tex-arg (eval cal-tex-daily-string)) + (cal-tex-arg (eval cal-tex-daily-string t)) (cal-tex-arg) (cal-tex-comment)) (when (and (zerop (mod (+ j blank-days) 7)) @@ -885,13 +889,15 @@ argument EVENT specifies a different buffer position." (interactive (list (prefix-numeric-value current-prefix-arg) last-nonmenu-event)) (or n (setq n 1)) + (with-suppressed-warnings ((lexical date)) + (defvar date)) ;For `cal-tex-daily-string'. (let* ((date (calendar-gregorian-from-absolute (calendar-dayname-on-or-before 1 (calendar-absolute-from-gregorian (calendar-cursor-to-date t event))))) (month (calendar-extract-month date)) - (year (calendar-extract-year date)) + ;; (year (calendar-extract-year date)) (day (calendar-extract-day date)) (d1 (calendar-absolute-from-gregorian date)) (d2 (+ (* 7 n) d1)) @@ -932,7 +938,7 @@ argument EVENT specifies a different buffer position." (insert ": ") (cal-tex-large-bf s)) (cal-tex-hfill) - (insert " " (eval cal-tex-daily-string)) + (insert " " (eval cal-tex-daily-string t)) (cal-tex-e-parbox) (cal-tex-nl) (cal-tex-noindent) @@ -951,7 +957,8 @@ argument EVENT specifies a different buffer position." (cal-tex-e-parbox "2cm") (cal-tex-nl) (setq month (calendar-extract-month date) - year (calendar-extract-year date))) + ;; year (calendar-extract-year date) + )) (cal-tex-e-parbox) (unless (= i (1- n)) (run-hooks 'cal-tex-week-hook) @@ -961,13 +968,16 @@ argument EVENT specifies a different buffer position." ;; TODO respect cal-tex-daily-start,end? ;; Using different numbers of hours will probably break some layouts. -(defun cal-tex-week-hours (date holidays height) - "Insert hourly entries for DATE with HOLIDAYS, with line height HEIGHT. +(defun cal-tex-week-hours (thedate holidays height) + "Insert hourly entries for THEDATE with HOLIDAYS, with line height HEIGHT. Uses the 24-hour clock if `cal-tex-24' is non-nil. Note that the hours shown are hard-coded to 8-12, 13-17." - (let ((month (calendar-extract-month date)) + (with-suppressed-warnings ((lexical date)) + (defvar date)) ;For `cal-tex-daily-string'. + (let ((date thedate) + (month (calendar-extract-month date)) (day (calendar-extract-day date)) - (year (calendar-extract-year date)) + ;; (year (calendar-extract-year date)) morning afternoon s) (cal-tex-comment "begin cal-tex-week-hours") (cal-tex-cmd "\\ \\\\[-.2cm]") @@ -983,7 +993,7 @@ shown are hard-coded to 8-12, 13-17." (insert ": ") (cal-tex-large-bf s)) (cal-tex-hfill) - (insert " " (eval cal-tex-daily-string)) + (insert " " (eval cal-tex-daily-string t)) (cal-tex-e-parbox) (cal-tex-nl "-.3cm") (cal-tex-rule "0pt" "6.8in" ".2mm") @@ -1088,14 +1098,16 @@ shown are hard-coded to 8-12, 13-17." (defun cal-tex-weekly-common (n event &optional filofax) "Common code for weekly calendars." (or n (setq n 1)) + (with-suppressed-warnings ((lexical date)) + (defvar date)) ;For `cal-tex-daily-string'. (let* ((date (calendar-gregorian-from-absolute (calendar-dayname-on-or-before 1 (calendar-absolute-from-gregorian (calendar-cursor-to-date t event))))) - (month (calendar-extract-month date)) - (year (calendar-extract-year date)) - (day (calendar-extract-day date)) + ;; (month (calendar-extract-month date)) + ;; (year (calendar-extract-year date)) + ;; (day (calendar-extract-day date)) (d1 (calendar-absolute-from-gregorian date)) (d2 (+ (* 7 n) d1)) (holidays (if cal-tex-holidays @@ -1161,7 +1173,7 @@ shown are hard-coded to 8-12, 13-17." (cal-tex-arg (number-to-string (calendar-extract-day date))) (cal-tex-arg (cal-tex-latexify-list diary-list date)) (cal-tex-arg (cal-tex-latexify-list holidays date)) - (cal-tex-arg (eval cal-tex-daily-string)) + (cal-tex-arg (eval cal-tex-daily-string t)) (insert "%\n") (setq date (cal-tex-incr-date date))) (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n") @@ -1258,14 +1270,16 @@ Optional EVENT indicates a buffer position to use instead of point." (interactive (list (prefix-numeric-value current-prefix-arg) last-nonmenu-event)) (or n (setq n 1)) + (with-suppressed-warnings ((lexical date)) + (defvar date)) ;For `cal-tex-daily-string'. (let* ((date (calendar-gregorian-from-absolute (calendar-dayname-on-or-before calendar-week-start-day (calendar-absolute-from-gregorian (calendar-cursor-to-date t event))))) - (month (calendar-extract-month date)) - (year (calendar-extract-year date)) - (day (calendar-extract-day date)) + ;; (month (calendar-extract-month date)) + ;; (year (calendar-extract-year date)) + ;; (day (calendar-extract-day date)) (d1 (calendar-absolute-from-gregorian date)) (d2 (+ (* 7 n) d1)) (holidays (if cal-tex-holidays @@ -1311,7 +1325,7 @@ Optional EVENT indicates a buffer position to use instead of point." (cal-tex-arg (number-to-string (calendar-extract-day date))) (cal-tex-arg (cal-tex-latexify-list diary-list date)) (cal-tex-arg (cal-tex-latexify-list holidays date)) - (cal-tex-arg (eval cal-tex-daily-string)) + (cal-tex-arg (eval cal-tex-daily-string t)) (insert "%\n") (setq date (cal-tex-incr-date date))) (unless (= i (1- n)) @@ -1342,14 +1356,16 @@ Optional EVENT indicates a buffer position to use instead of point." (interactive (list (prefix-numeric-value current-prefix-arg) last-nonmenu-event)) (or n (setq n 1)) + (with-suppressed-warnings ((lexical date)) + (defvar date)) ;For `cal-tex-daily-string'. (let* ((date (calendar-gregorian-from-absolute (calendar-dayname-on-or-before 1 (calendar-absolute-from-gregorian (calendar-cursor-to-date t event))))) - (month (calendar-extract-month date)) - (year (calendar-extract-year date)) - (day (calendar-extract-day date)) + ;; (month (calendar-extract-month date)) + ;; (year (calendar-extract-year date)) + ;; (day (calendar-extract-day date)) (d1 (calendar-absolute-from-gregorian date)) (d2 (+ (* 7 n) d1)) (holidays (if cal-tex-holidays @@ -1383,11 +1399,11 @@ Optional EVENT indicates a buffer position to use instead of point." "\\leftday"))) (cal-tex-arg (cal-tex-latexify-list diary-list date)) (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t)) - (cal-tex-arg (eval cal-tex-daily-string)) + (cal-tex-arg (eval cal-tex-daily-string t)) (insert "%\n") - (if cal-tex-rules - (insert "\\linesfill\n") - (insert "\\vfill\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")) + (insert (if cal-tex-rules + "\\linesfill\n" + "\\vfill\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")) (cal-tex-newpage) (setq date (cal-tex-incr-date date))) (insert "%\n") @@ -1397,11 +1413,11 @@ Optional EVENT indicates a buffer position to use instead of point." (insert "\\weekend") (cal-tex-arg (cal-tex-latexify-list diary-list date)) (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t)) - (cal-tex-arg (eval cal-tex-daily-string)) + (cal-tex-arg (eval cal-tex-daily-string t)) (insert "%\n") - (if cal-tex-rules - (insert "\\linesfill\n") - (insert "\\vfill")) + (insert (if cal-tex-rules + "\\linesfill\n" + "\\vfill")) (setq date (cal-tex-incr-date date))) (or cal-tex-rules (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n")) @@ -1442,12 +1458,15 @@ a buffer position to use instead of point." (cal-tex-end-document) (run-hooks 'cal-tex-hook))) -(defun cal-tex-daily-page (date) - "Make a calendar page for Gregorian DATE on 8.5 by 11 paper. +(defun cal-tex-daily-page (thedate) + "Make a calendar page for Gregorian THEDATE on 8.5 by 11 paper. Uses the 24-hour clock if `cal-tex-24' is non-nil. Produces hourly sections for the period specified by `cal-tex-daily-start' and `cal-tex-daily-end'." - (let ((month-name (cal-tex-month-name (calendar-extract-month date))) + (with-suppressed-warnings ((lexical date)) + (defvar date)) ;For `cal-tex-daily-string'. + (let ((date thedate) + (month-name (cal-tex-month-name (calendar-extract-month date))) (i (1- cal-tex-daily-start)) hour) (cal-tex-banner "cal-tex-daily-page") @@ -1459,7 +1478,7 @@ and `cal-tex-daily-end'." (cal-tex-bf month-name ) (cal-tex-e-parbox) (cal-tex-hspace "1cm") - (cal-tex-scriptsize (eval cal-tex-daily-string)) + (cal-tex-scriptsize (eval cal-tex-daily-string t)) (cal-tex-hspace "3.5cm") (cal-tex-e-makebox) (cal-tex-hfill) diff --git a/lisp/calendar/cal-x.el b/lisp/calendar/cal-x.el index 1c19a60db103..ca303ce39aed 100644 --- a/lisp/calendar/cal-x.el +++ b/lisp/calendar/cal-x.el @@ -1,4 +1,4 @@ -;;; cal-x.el --- calendar windows in dedicated frames +;;; cal-x.el --- calendar windows in dedicated frames -*- lexical-binding: t; -*- ;; Copyright (C) 1994-1995, 2001-2021 Free Software Foundation, Inc.