1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-19 18:13:55 +00:00

(calendar-iso-to-absolute): Rename calendar-absolute-from-iso.

Update callers, keep old name as alias.
(calendar-iso-print-date): Rename calendar-print-iso-date.
Update callers, keep old name as alias.
(calendar-iso-goto-date): Rename calendar-goto-iso-date.
Keep old name as alias.
(calendar-iso-goto-week): Rename calendar-goto-iso-week.
Keep old name as alias.
This commit is contained in:
Glenn Morris 2008-04-04 07:14:38 +00:00
parent 88c4ca186c
commit 216a3e253c

View File

@ -33,7 +33,7 @@
(require 'calendar)
(defun calendar-absolute-from-iso (date)
(defun calendar-iso-to-absolute (date)
"The number of days elapsed between the Gregorian date 12/31/1 BC and DATE.
The `ISO year' corresponds approximately to the Gregorian year, but
weeks start on Monday and end on Sunday. The first week of the ISO year is
@ -49,6 +49,9 @@ Sunday). The Gregorian date Sunday, December 31, 1 BC is imaginary."
(* 7 (1- (extract-calendar-month date)))
(if (zerop day) 6 (1- day)))))
(define-obsolete-function-alias 'calendar-absolute-from-iso
'calendar-iso-to-absolute "23.1")
(defun calendar-iso-from-absolute (date)
"Compute the `ISO commercial date' corresponding to the absolute DATE.
The ISO year corresponds approximately to the Gregorian year, but weeks
@ -62,11 +65,11 @@ date Sunday, December 31, 1 BC."
(calendar-gregorian-from-absolute (- date 3))))
(year (+ approx
(calendar-sum y approx
(>= date (calendar-absolute-from-iso
(>= date (calendar-iso-to-absolute
(list 1 1 (1+ y))))
1))))
(list
(1+ (/ (- date (calendar-absolute-from-iso (list 1 1 year))) 7))
(1+ (/ (- date (calendar-iso-to-absolute (list 1 1 year))) 7))
(% date 7)
year)))
@ -83,12 +86,15 @@ date Sunday, December 31, 1 BC."
(extract-calendar-year iso-date))))
;;;###cal-autoload
(defun calendar-print-iso-date ()
(defun calendar-iso-print-date ()
"Show equivalent ISO date for the date under the cursor."
(interactive)
(message "ISO date: %s"
(calendar-iso-date-string (calendar-cursor-to-date t))))
(define-obsolete-function-alias 'calendar-print-iso-date
'calendar-iso-print-date "23.1")
(defun calendar-iso-read-date (&optional dayflag)
"Interactively read the arguments for an ISO date command.
Reads a year and week, and if DAYFLAG is non-nil a day (otherwise
@ -113,25 +119,31 @@ taken to be 1)."
1)))
(list (list week day year))))
(define-obsolete-function-alias
'calendar-iso-read-args 'calendar-iso-read-date "23.1")
(define-obsolete-function-alias 'calendar-iso-read-args
'calendar-iso-read-date "23.1")
;;;###cal-autoload
(defun calendar-goto-iso-date (date &optional noecho)
(defun calendar-iso-goto-date (date &optional noecho)
"Move cursor to ISO DATE; echo ISO date unless NOECHO is non-nil."
(interactive (calendar-iso-read-date t))
(calendar-goto-date (calendar-gregorian-from-absolute
(calendar-absolute-from-iso date)))
(or noecho (calendar-print-iso-date)))
(calendar-iso-to-absolute date)))
(or noecho (calendar-iso-print-date)))
(define-obsolete-function-alias 'calendar-goto-iso-date
'calendar-iso-goto-date "23.1")
;;;###cal-autoload
(defun calendar-goto-iso-week (date &optional noecho)
(defun calendar-iso-goto-week (date &optional noecho)
"Move cursor to ISO DATE; echo ISO date unless NOECHO is non-nil.
Interactively, goes to the first day of the specified week."
(interactive (calendar-iso-read-date))
(calendar-goto-date (calendar-gregorian-from-absolute
(calendar-absolute-from-iso date)))
(or noecho (calendar-print-iso-date)))
(calendar-iso-to-absolute date)))
(or noecho (calendar-iso-print-date)))
(define-obsolete-function-alias 'calendar-goto-iso-week
'calendar-iso-goto-week "23.1")
(defvar date)