Commit e803eab7 authored by Glenn Morris's avatar Glenn Morris

Update for calendar.el name changes.

parent 1b73d7f3
......@@ -79,9 +79,9 @@ Used by `calendar-bahai-to-absolute'.")
"Compute absolute date from Bahá'í date DATE.
The absolute date is the number of days elapsed since the (imaginary)
Gregorian date Sunday, December 31, 1 BC."
(let* ((month (extract-calendar-month date))
(day (extract-calendar-day date))
(year (extract-calendar-year date))
(let* ((month (calendar-extract-month date))
(day (calendar-extract-day date))
(year (calendar-extract-year date))
(prior-years (+ (1- year) 1844))
(leap-days (- (+ (/ prior-years 4) ; leap days in prior years
(- (/ prior-years 100))
......@@ -104,11 +104,11 @@ Gregorian date Sunday, December 31, 1 BC."
(if (< date calendar-bahai-epoch)
(list 0 0 0) ; pre-Bahá'í date
(let* ((greg (calendar-gregorian-from-absolute date))
(gmonth (extract-calendar-month greg))
(year (+ (- (extract-calendar-year greg) 1844)
(gmonth (calendar-extract-month greg))
(year (+ (- (calendar-extract-year greg) 1844)
(if (or (> gmonth 3)
(and (= gmonth 3)
(>= (extract-calendar-day greg) 21)))
(>= (calendar-extract-day greg) 21)))
1 0)))
(month ; search forward from Baha
(1+ (calendar-sum m 1
......@@ -126,11 +126,11 @@ Defaults to today's date if DATE is not given."
(let* ((bahai-date (calendar-bahai-from-absolute
(calendar-absolute-from-gregorian
(or date (calendar-current-date)))))
(y (extract-calendar-year bahai-date)))
(y (calendar-extract-year bahai-date)))
(if (< y 1)
"" ; pre-Bahai
(let* ((m (extract-calendar-month bahai-date))
(d (extract-calendar-day bahai-date))
(let* ((m (calendar-extract-month bahai-date))
(d (calendar-extract-day bahai-date))
(monthname (if (and (= m 19)
(<= d 0))
"Ayyám-i-Há"
......@@ -165,7 +165,7 @@ Reads a year, month and day."
"Bahá'í calendar year (not 0): "
(lambda (x) (not (zerop x)))
(int-to-string
(extract-calendar-year
(calendar-extract-year
(calendar-bahai-from-absolute
(calendar-absolute-from-gregorian today))))))
(completion-ignore-case t)
......@@ -210,8 +210,8 @@ nil if it is not visible in the current calendar window."
(let* ((bahai-date (calendar-bahai-from-absolute
(calendar-absolute-from-gregorian
(list displayed-month 15 displayed-year))))
(m (extract-calendar-month bahai-date))
(y (extract-calendar-year bahai-date))
(m (calendar-extract-month bahai-date))
(y (calendar-extract-year bahai-date))
date)
(unless (< m 1) ; Bahá'í calendar doesn't apply
;; Cf holiday-fixed, holiday-islamic.
......@@ -222,7 +222,7 @@ nil if it is not visible in the current calendar window."
;; m16 is visible. m16 is visible when the central month >= 13.
;; To see if other months are visible we can shift the range
;; accordingly.
(increment-calendar-month m y (- 16 month) 19)
(calendar-increment-month m y (- 16 month) 19)
(and (> m 12) ; Bahá'í date might be visible
(calendar-date-is-visible-p
(setq date (calendar-gregorian-from-absolute
......@@ -282,7 +282,7 @@ will not be marked in the calendar. This function is provided for use with
(defun calendar-bahai-mark-date-pattern (month day year &optional color)
"Mark dates in calendar window that conform to Bahá'í date MONTH/DAY/YEAR.
A value of 0 in any position is a wildcard. Optional argument COLOR is
passed to `mark-visible-calendar-date' as MARK."
passed to `calendar-mark-visible-date' as MARK."
(calendar-mark-1 month day year 'calendar-bahai-from-absolute
'calendar-bahai-to-absolute color))
......
......@@ -213,7 +213,7 @@ 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 (extract-calendar-year (calendar-gregorian-from-absolute d)))
(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)
......@@ -235,7 +235,7 @@ 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."
(let* ((year (extract-calendar-year (calendar-gregorian-from-absolute d)))
(let* ((year (calendar-extract-year (calendar-gregorian-from-absolute d)))
(calendar-time-zone (eval calendar-chinese-time-zone))
(calendar-daylight-time-offset
calendar-chinese-daylight-time-offset)
......@@ -434,7 +434,7 @@ Sunday, December 31, 1 BC is imaginary."
"Compute Chinese date (cycle year month day) corresponding to absolute DATE.
The absolute date is the number of days elapsed since the (imaginary)
Gregorian date Sunday, December 31, 1 BC."
(let* ((g-year (extract-calendar-year
(let* ((g-year (calendar-extract-year
(calendar-gregorian-from-absolute date)))
(c-year (+ g-year 2695))
(list (append (calendar-chinese-year (1- g-year))
......@@ -454,7 +454,7 @@ Gregorian date Sunday, December 31, 1 BC."
(caar list)
(1+ (- date (cadr (car list)))))))
;; Bound in generate-calendar.
;; Bound in calendar-generate.
(defvar displayed-month)
(defvar displayed-year)
......@@ -469,7 +469,7 @@ Returns (((MONTH DAY YEAR) TEXT)), where the date is Gregorian."
;; Jan is visible if displayed-month = 12, 1, 2; Feb if d-m = 1, 2, 3.
;; If we shift the calendar forward one month, we can do a
;; one-sided test, namely: d-m <= 4 means CNY might be visible.
(increment-calendar-month m y 1) ; shift forward a month
(calendar-increment-month m y 1) ; shift forward a month
(and (< m 5)
(calendar-date-is-visible-p
(setq chinese-new-year
......@@ -546,13 +546,13 @@ Defaults to today's date if DATE is not given."
(memq 1 (append
(mapcar (lambda (x)
(car x))
(calendar-chinese-year (extract-calendar-year
(calendar-chinese-year (calendar-extract-year
(calendar-gregorian-from-absolute
(calendar-chinese-to-absolute
(list c y 1 1))))))
(mapcar (lambda (x)
(if (> (car x) 11) (car x)))
(calendar-chinese-year (extract-calendar-year
(calendar-chinese-year (calendar-extract-year
(calendar-gregorian-from-absolute
(calendar-chinese-to-absolute
(list (if (= y 60) (1+ c) c)
......
......@@ -68,9 +68,9 @@ Nisi (Kebus) at the end of the year."
"Compute absolute date from Coptic date DATE.
The absolute date is the number of days elapsed since the (imaginary)
Gregorian date Sunday, December 31, 1 BC."
(let ((month (extract-calendar-month date))
(day (extract-calendar-day date))
(year (extract-calendar-year date)))
(let ((month (calendar-extract-month date))
(day (calendar-extract-day date))
(year (calendar-extract-year date)))
(+ (1- calendar-coptic-epoch) ; days before start of calendar
(* 365 (1- year)) ; days in prior years
(/ year 4) ; leap days in prior years
......@@ -117,12 +117,12 @@ Defaults to today's date if DATE is not given."
(let* ((coptic-date (calendar-coptic-from-absolute
(calendar-absolute-from-gregorian
(or date (calendar-current-date)))))
(y (extract-calendar-year coptic-date))
(m (extract-calendar-month coptic-date)))
(y (calendar-extract-year coptic-date))
(m (calendar-extract-month coptic-date)))
(if (< y 1)
""
(let ((monthname (aref calendar-coptic-month-name-array (1- m)))
(day (int-to-string (extract-calendar-day coptic-date)))
(day (int-to-string (calendar-extract-day coptic-date)))
(dayname nil)
(month (int-to-string m))
(year (int-to-string y)))
......@@ -148,7 +148,7 @@ Reads a year, month, and day."
(format "%s calendar year (>0): " calendar-coptic-name)
(lambda (x) (> x 0))
(int-to-string
(extract-calendar-year
(calendar-extract-year
(calendar-coptic-from-absolute
(calendar-absolute-from-gregorian today))))))
(completion-ignore-case t)
......
......@@ -189,9 +189,9 @@ ABS-DATE must specify a day that contains a daylight saving transition.
The result has the proper form for `calendar-daylight-savings-starts'."
(let* ((date (calendar-gregorian-from-absolute abs-date))
(weekday (% abs-date 7))
(m (extract-calendar-month date))
(d (extract-calendar-day date))
(y (extract-calendar-year date))
(m (calendar-extract-month date))
(d (calendar-extract-day date))
(y (calendar-extract-year date))
(last (calendar-last-day-of-month m y))
j rlist
(candidate-rules ; these return Gregorian dates
......@@ -423,7 +423,7 @@ This function respects the value of `calendar-dst-check-each-year-flag'."
(defun dst-in-effect (date)
"True if on absolute DATE daylight saving time is in effect.
Fractional part of DATE is local standard time of day."
(let* ((year (extract-calendar-year
(let* ((year (calendar-extract-year
(calendar-gregorian-from-absolute (floor date))))
(dst-starts-gregorian (eval calendar-daylight-savings-starts))
(dst-ends-gregorian (eval calendar-daylight-savings-ends))
......
......@@ -114,9 +114,9 @@ The 13th month is not really a month, but the 5 (6 in leap years) day period of
"Compute absolute date from French Revolutionary date DATE.
The absolute date is the number of days elapsed since the (imaginary)
Gregorian date Sunday, December 31, 1 BC."
(let ((month (extract-calendar-month date))
(day (extract-calendar-day date))
(year (extract-calendar-year date)))
(let ((month (calendar-extract-month date))
(day (calendar-extract-day date))
(year (calendar-extract-year date)))
(+ (* 365 (1- year)) ; days in prior years
;; Leap days in prior years.
(if (< year 20)
......@@ -170,9 +170,9 @@ Defaults to today's date if DATE is not given."
(let* ((french-date (calendar-french-from-absolute
(calendar-absolute-from-gregorian
(or date (calendar-current-date)))))
(y (extract-calendar-year french-date))
(m (extract-calendar-month french-date))
(d (extract-calendar-day french-date)))
(y (calendar-extract-year french-date))
(m (calendar-extract-month french-date))
(d (calendar-extract-day french-date)))
(cond
((< y 1) "")
((= m 13) (format (if (calendar-french-accents-p)
......@@ -214,7 +214,7 @@ Echo French Revolutionary date unless NOECHO is non-nil."
"Anne'e de la Re'volution (>0): ")
(lambda (x) (> x 0))
(int-to-string
(extract-calendar-year
(calendar-extract-year
(calendar-french-from-absolute
(calendar-absolute-from-gregorian
(calendar-current-date))))))))
......
This diff is collapsed.
......@@ -207,15 +207,15 @@ Contains links to previous and next month and year, and current minical."
(insert (cal-html-b-table "class=header"))
(insert cal-html-b-tablerow-string)
(insert cal-html-b-tabledata-string) ; month links
(increment-calendar-month month year -1) ; previous month
(calendar-increment-month month year -1) ; previous month
(cal-html-insert-link-monthpage month year t) ; t --> change-dir
(increment-calendar-month month year 1) ; current month
(calendar-increment-month month year 1) ; current month
(cal-html-insert-link-yearpage month year)
(increment-calendar-month month year 1) ; next month
(calendar-increment-month month year 1) ; next month
(cal-html-insert-link-monthpage month year t) ; t --> change-dir
(insert cal-html-e-tabledata-string)
(insert cal-html-b-tabledata-string) ; minical
(increment-calendar-month month year -1)
(calendar-increment-month month year -1)
(cal-html-insert-minical month year)
(insert cal-html-e-tabledata-string)
(insert cal-html-e-tablerow-string) ; end
......@@ -418,8 +418,8 @@ The output directory DIR is created if necessary. Interactively,
MONTH and YEAR are taken from the calendar cursor position. Note
that any existing output files are overwritten."
(interactive (let* ((date (calendar-cursor-to-date t))
(month (extract-calendar-month date))
(year (extract-calendar-year date)))
(month (calendar-extract-month date))
(year (calendar-extract-year date)))
(list month year (cal-html-year-dir-ask-user year))))
(make-directory dir t)
(cal-html-one-month month year dir))
......@@ -430,7 +430,7 @@ that any existing output files are overwritten."
The output directory DIR is created if necessary. Interactively,
YEAR is taken from the calendar cursor position. Note that any
existing output files are overwritten."
(interactive (let ((year (extract-calendar-year
(interactive (let ((year (calendar-extract-year
(calendar-cursor-to-date t))))
(list year (cal-html-year-dir-ask-user year))))
(make-directory dir t)
......
......@@ -59,18 +59,18 @@
(defun calendar-islamic-day-number (date)
"Return the day number within the year of the Islamic date DATE."
(let ((month (extract-calendar-month date)))
(let ((month (calendar-extract-month date)))
(+ (* 30 (/ month 2))
(* 29 (/ (1- month) 2))
(extract-calendar-day date))))
(calendar-extract-day date))))
(defun calendar-islamic-to-absolute (date)
"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 (extract-calendar-month date))
(day (extract-calendar-day date))
(year (extract-calendar-year 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)
((< y 6) 1)
......@@ -130,7 +130,7 @@ Driven by the variable `calendar-date-display-form'."
(islamic-date (calendar-islamic-from-absolute
(calendar-absolute-from-gregorian
(or date (calendar-current-date))))))
(if (< (extract-calendar-year islamic-date) 1)
(if (< (calendar-extract-year islamic-date) 1)
""
(calendar-date-string islamic-date nil t))))
......@@ -154,7 +154,7 @@ Reads a year, month, and day."
"Islamic calendar year (>0): "
(lambda (x) (> x 0))
(int-to-string
(extract-calendar-year
(calendar-extract-year
(calendar-islamic-from-absolute
(calendar-absolute-from-gregorian today))))))
(month-array calendar-islamic-month-name-array)
......@@ -182,7 +182,7 @@ Reads a year, month, and day."
(define-obsolete-function-alias 'calendar-goto-islamic-date
'calendar-islamic-goto-date "23.1")
(defvar displayed-month) ; from generate-calendar
(defvar displayed-month) ; from calendar-generate
(defvar displayed-year)
;;;###holiday-autoload
......@@ -199,8 +199,8 @@ nil if it is not visible in the current calendar window."
(let* ((islamic-date (calendar-islamic-from-absolute
(calendar-absolute-from-gregorian
(list displayed-month 15 displayed-year))))
(m (extract-calendar-month islamic-date))
(y (extract-calendar-year islamic-date))
(m (calendar-extract-month islamic-date))
(y (calendar-extract-year islamic-date))
date)
(unless (< m 1) ; Islamic calendar doesn't apply
;; Since converting to absolute dates can be a complex
......@@ -220,7 +220,7 @@ nil if it is not visible in the current calendar window."
;; Hence to test if any given month might be visible, we can
;; shift things and ask about October.
;; At the same time, we work out the appropriate year y to use.
(increment-calendar-month m y (- 10 month))
(calendar-increment-month m y (- 10 month))
(and (> m 7) ; Islamic date might be visible
(calendar-date-is-visible-p
(setq date (calendar-gregorian-from-absolute
......@@ -237,8 +237,8 @@ nil if it is not visible in the current calendar window."
(list (list date
(format "Islamic New Year %d"
(progn
(increment-calendar-month m y 1)
(extract-calendar-year
(calendar-increment-month m y 1)
(calendar-extract-year
(calendar-islamic-from-absolute
(calendar-absolute-from-gregorian
(list m (calendar-last-day-of-month m y) y)
......@@ -271,7 +271,7 @@ marked in the calendar. This function is provided for use with
(defun calendar-islamic-mark-date-pattern (month day year &optional color)
"Mark dates in calendar window that conform to Islamic date MONTH/DAY/YEAR.
A value of 0 in any position is a wildcard. Optional argument COLOR is
passed to `mark-visible-calendar-date' as MARK."
passed to `calendar-mark-visible-date' as MARK."
(calendar-mark-1 month day year 'calendar-islamic-from-absolute
'calendar-islamic-to-absolute color))
......
......@@ -41,12 +41,12 @@ the first such week in which at least 4 days are in a year. The ISO
commercial DATE has the form (week day year) in which week is in the range
1..52 and day is in the range 0..6 (1 = Monday, 2 = Tuesday, ..., 0 =
Sunday). The Gregorian date Sunday, December 31, 1 BC is imaginary."
(let ((day (extract-calendar-day date)))
(let ((day (calendar-extract-day date)))
(+ (calendar-dayname-on-or-before
1 (+ 3 (calendar-absolute-from-gregorian
(list 1 1 (extract-calendar-year date)))))
(list 1 1 (calendar-extract-year date)))))
;; ISO date is (week day year); normally (month day year).
(* 7 (1- (extract-calendar-month date)))
(* 7 (1- (calendar-extract-month date)))
(if (zerop day) 6 (1- day)))))
(define-obsolete-function-alias 'calendar-absolute-from-iso
......@@ -61,7 +61,7 @@ date has the form (week day year) in which week is in the range 1..52 and
day is in the range 0..6 (1 = Monday, 2 = Tuesday, ..., 0 = Sunday). The
absolute date is the number of days elapsed since the (imaginary) Gregorian
date Sunday, December 31, 1 BC."
(let* ((approx (extract-calendar-year
(let* ((approx (calendar-extract-year
(calendar-gregorian-from-absolute (- date 3))))
(year (+ approx
(calendar-sum y approx
......@@ -82,8 +82,8 @@ date Sunday, December 31, 1 BC."
(iso-date (calendar-iso-from-absolute d)))
(format "Day %s of week %d of %d"
(if (zerop day) 7 day)
(extract-calendar-month iso-date)
(extract-calendar-year iso-date))))
(calendar-extract-month iso-date)
(calendar-extract-year iso-date))))
;;;###cal-autoload
(defun calendar-iso-print-date ()
......@@ -102,9 +102,9 @@ taken to be 1)."
(let* ((year (calendar-read
"ISO calendar year (>0): "
(lambda (x) (> x 0))
(int-to-string (extract-calendar-year
(int-to-string (calendar-extract-year
(calendar-current-date)))))
(no-weeks (extract-calendar-month
(no-weeks (calendar-extract-month
(calendar-iso-from-absolute
(1-
(calendar-dayname-on-or-before
......
......@@ -36,8 +36,8 @@
(defun calendar-julian-to-absolute (date)
"The number of days elapsed between the Gregorian date 12/31/1 BC and DATE.
The Gregorian date Sunday, December 31, 1 BC is imaginary."
(let ((month (extract-calendar-month date))
(year (extract-calendar-year date)))
(let ((month (calendar-extract-month date))
(year (calendar-extract-year date)))
(+ (calendar-day-number date)
(if (and (zerop (% year 100))
(not (zerop (% year 400)))
......@@ -107,7 +107,7 @@ Driven by the variable `calendar-date-display-form'."
"Julian calendar year (>0): "
(lambda (x) (> x 0))
(int-to-string
(extract-calendar-year
(calendar-extract-year
(calendar-julian-from-absolute
(calendar-absolute-from-gregorian
today))))))
......
......@@ -66,8 +66,8 @@
(defun cal-menu-holiday-window-suffix ()
"Return a string suffix for the \"Window\" entry in `cal-menu-holidays-menu'."
(let ((my1 (calendar-increment-month -1))
(my2 (calendar-increment-month 1)))
(let ((my1 (calendar-increment-month-cons -1))
(my2 (calendar-increment-month-cons 1)))
(if (= (cdr my1) (cdr my2))
(format "%s-%s, %d"
(calendar-month-name (car my1) 'abbrev)
......@@ -79,7 +79,7 @@
(calendar-month-name (car my2) 'abbrev)
(cdr my2)))))
(defvar displayed-year) ; from generate-calendar
(defvar displayed-year) ; from calendar-generate
(defconst cal-menu-holidays-menu
`("Holidays"
......@@ -160,17 +160,17 @@ POSITION and MENU are passed to `x-popup-menu'."
(defun cal-menu-list-holidays-year ()
"Display a list of the holidays of the selected date's year."
(interactive)
(holiday-list (extract-calendar-year (calendar-cursor-to-date))))
(holiday-list (calendar-extract-year (calendar-cursor-to-date))))
(defun cal-menu-list-holidays-following-year ()
"Display a list of the holidays of the following year."
(interactive)
(holiday-list (1+ (extract-calendar-year (calendar-cursor-to-date)))))
(holiday-list (1+ (calendar-extract-year (calendar-cursor-to-date)))))
(defun cal-menu-list-holidays-previous-year ()
"Display a list of the holidays of the previous year."
(interactive)
(holiday-list (1- (extract-calendar-year (calendar-cursor-to-date)))))
(holiday-list (1- (calendar-extract-year (calendar-cursor-to-date)))))
(defun calendar-event-to-date (&optional error)
"Date of last event.
......@@ -218,12 +218,12 @@ EVENT is the event that invoked this command."
(and selection (call-interactively selection))))
(autoload 'diary-list-entries "diary-lib")
(defvar holidays-in-diary-buffer) ; only called from calendar.el
(defvar diary-show-holidays-flag) ; only called from calendar.el
(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
that invoked this command. Shows holidays if `holidays-in-diary-buffer'
that invoked this command. Shows holidays if `diary-show-holidays-flag'
is non-nil."
(interactive "i\ni\ne")
(let* ((date (or date (calendar-event-to-date)))
......@@ -233,7 +233,7 @@ is non-nil."
(diary-entries
(mapcar (lambda (x) (split-string (cadr x) "\n"))
(diary-list-entries date 1 'list-only)))
(holidays (if holidays-in-diary-buffer
(holidays (if diary-show-holidays-flag
(calendar-check-holidays date)))
(title (concat "Diary entries "
(if diary (format "from %s " diary) "")
......
......@@ -56,15 +56,15 @@ Returns the list (month day year) giving the cursor position."
(re-search-backward "[0-9]" nil t)))
(calendar-cursor-to-date))))
(defvar displayed-month) ; from generate-calendar
(defvar displayed-month) ; from calendar-generate
(defvar displayed-year)
;;;###cal-autoload
(defun calendar-cursor-to-visible-date (date)
"Move the cursor to DATE that is on the screen."
(let ((month (extract-calendar-month date))
(day (extract-calendar-day date))
(year (extract-calendar-year date)))
(let ((month (calendar-extract-month date))
(day (calendar-extract-day date))
(year (calendar-extract-year date)))
(goto-line (+ 3
(/ (+ day -1
(mod
......@@ -87,8 +87,8 @@ Returns the list (month day year) giving the cursor position."
(interactive)
(let ((today (calendar-current-date))) ; the date might have changed
(if (not (calendar-date-is-visible-p today))
(generate-calendar-window)
(update-calendar-mode-line)
(calendar-generate-window)
(calendar-update-mode-line)
(calendar-cursor-to-visible-date today)))
(run-hooks 'calendar-move-hook))
......@@ -99,11 +99,11 @@ Movement is backward if ARG is negative."
(interactive "p")
(calendar-cursor-to-nearest-date)
(let* ((cursor-date (calendar-cursor-to-date t))
(month (extract-calendar-month cursor-date))
(day (extract-calendar-day cursor-date))
(year (extract-calendar-year cursor-date))
(month (calendar-extract-month cursor-date))
(day (calendar-extract-day cursor-date))
(year (calendar-extract-year cursor-date))
(last (progn
(increment-calendar-month month year arg)
(calendar-increment-month month year arg)
(calendar-last-day-of-month month year)))
(day (min last day))
;; Put the new month on the screen, if needed, and go to the new date.
......@@ -151,8 +151,8 @@ EVENT is an event like `last-nonmenu-event'."
(today (calendar-current-date))
(month displayed-month)
(year displayed-year))
(increment-calendar-month month year arg)
(generate-calendar-window month year)
(calendar-increment-month month year arg)
(calendar-generate-window month year)
(calendar-cursor-to-visible-date
(cond
((calendar-date-is-visible-p old-date) old-date)
......@@ -211,8 +211,8 @@ Moves backward if ARG is negative."
(new-cursor-date
(calendar-gregorian-from-absolute
(+ (calendar-absolute-from-gregorian cursor-date) arg)))
(new-display-month (extract-calendar-month new-cursor-date))
(new-display-year (extract-calendar-year new-cursor-date)))
(new-display-month (calendar-extract-month new-cursor-date))
(new-display-year (calendar-extract-year new-cursor-date)))
;; Put the new month on the screen, if needed, and go to the new date.
(if (not (calendar-date-is-visible-p new-cursor-date))
(calendar-other-month new-display-month new-display-year))
......@@ -270,9 +270,9 @@ Moves forward if ARG is negative."
(interactive "p")
(calendar-cursor-to-nearest-date)
(let* ((date (calendar-cursor-to-date))
(month (extract-calendar-month date))
(day (extract-calendar-day date))
(year (extract-calendar-year date)))
(month (calendar-extract-month date))
(day (calendar-extract-day date))
(year (calendar-extract-year date)))
(if (= day 1)
(calendar-backward-month arg)
(calendar-cursor-to-visible-date (list month 1 year))
......@@ -284,16 +284,16 @@ Moves forward if ARG is negative."
(interactive "p")
(calendar-cursor-to-nearest-date)
(let* ((date (calendar-cursor-to-date))
(month (extract-calendar-month date))
(day (extract-calendar-day date))
(year (extract-calendar-year date))
(month (calendar-extract-month date))
(day (calendar-extract-day date))
(year (calendar-extract-year date))
(last-day (calendar-last-day-of-month month year))
(last-day (progn
(unless (= day last-day)
(calendar-cursor-to-visible-date
(list month last-day year))
(setq arg (1- arg)))
(increment-calendar-month month year arg)
(calendar-increment-month month year arg)
(list month
(calendar-last-day-of-month month year)
year))))
......@@ -308,9 +308,9 @@ Moves forward if ARG is negative."
(interactive "p")
(calendar-cursor-to-nearest-date)
(let* ((date (calendar-cursor-to-date))
(month (extract-calendar-month date))
(day (extract-calendar-day date))
(year (extract-calendar-year date))
(month (calendar-extract-month date))
(day (calendar-extract-day date))
(year (calendar-extract-year date))
(jan-first (list 1 1 year))
(calendar-move-hook nil))
(if (and (= day 1) (= 1 month))
......@@ -328,9 +328,9 @@ Moves forward if ARG is negative."
(interactive "p")
(calendar-cursor-to-nearest-date)
(let* ((date (calendar-cursor-to-date))
(month (extract-calendar-month date))
(day (extract-calendar-day date))
(year (extract-calendar-year date))
(month (calendar-extract-month date))
(day (calendar-extract-day date))
(year (calendar-extract-year date))
(dec-31 (list 12 31 year))
(calendar-move-hook nil))
(if (and (= day 31) (= 12 month))
......@@ -346,8 +346,8 @@ Moves forward if ARG is negative."
(defun calendar-goto-date (date)
"Move cursor to DATE."
(interactive (list (calendar-read-date)))
(let ((month (extract-calendar-month date))
(year (extract-calendar-year date)))
(let ((month (calendar-extract-month date))
(year (calendar-extract-year date)))
(if (not (calendar-date-is-visible-p date))
(calendar-other-month
(if (and (= month 1) (= year 1))
......@@ -365,7 +365,7 @@ Negative DAY counts backward from end of year."
(let* ((year (calendar-read
"Year (>0): "
(lambda (x) (> x 0))
(int-to-string (extract-calendar-year
(int-to-string (calendar-extract-year
(calendar-current-date)))))
(last (if (calendar-leap-year-p year) 366 365))