(defvar calendar-hook nil "\ List of functions called after the calendar buffer has been prepared with the calendar of the current month. This can be used, for example, to highlight today's date with asterisks--a function star-date is included for this purpose. The variable offset-calendar-hook is the list of functions called when the calendar function was called for a past or future month.") (defvar offset-calendar-hook nil "\ List of functions called after the calendar buffer has been prepared with the calendar of a past or future month. The variable calendar-hook is the list of functions called when the calendar function was called for the current month.") (defun calendar (&optional month-offset) "\ Display three-month calendar in another window. The three months appear side by side, with the current month in the middle surrounded by the previous and next months. The cursor is put on today's date. An optional prefix argument ARG causes the calendar displayed to be ARG months in the future if ARG is positive or in the past if ARG is negative; in this case the cursor goes on the first day of the month. The Gregorian calendar is assumed. After preparing the calendar window, the hooks calendar-hook are run when the calendar is for the current month--that is, the was no prefix argument. If the calendar is for a future or past month--that is, there was a prefix argument--the hooks offset-calendar-hook are run. Thus, for example, setting calendar-hooks to 'star-date will cause today's date to be replaced by asterisks to highlight it in the window." (interactive "P") (byte-code "?. B T\"O\\%^a T\"% )^aOUf^ (defun leap-year-p (year) "\ Returns true if YEAR is a Gregorian leap year, and false if not." (byte-code "AA\"AU. (defun day-number (month day year) "\ Return day-number within year (origin-1) of the date MONTH DAY YEAR. For example, (day-number 1 1 1987) returns the value 1, while (day-number 12 31 1980) returns 366." (byte-code " AA S\"\\ AV.& \"\\E\"Z%^E !.& (defun day-of-week (month day year) "\ Returns the day-of-the-week index of MONTH DAY, YEAR. Value is 0 for Sunday, 1 for Monday, etc." (byte-code "AAA #CE S\"E SE\"#CE SE\"I\"A E\"IUf+ (defun generate-month (month year indent &optional day) "\ Produce a calendar for MONTH, YEAR on the Gregorian calendar, inserted in the buffer starting at the line on which point is currently located, but indented INDENT spaces. The position in the buffer of the optional parameter DAY is returned. The indentation is done from the first character on the line and does not disturb the first INDENT characters on the line." (byte-code "I I #IZI !. #C#^O*C#^OO\"^UT%X.P (defun insert-indented (string indent &optional newline) "\ Insert STRING at column INDENT. If the optional parameter NEWLINE is true, leave point at start of next line, inserting a newline if there was no next line; otherwise, leave point after the inserted text. Value is always `t'." (byte-code "A!^iW. .# (defun star-date nil "\ Replace today's date with asterisks in the calendar window. This function can be used with the calendar-hook run after the calendar window has been prepared." (byte-code "AAA!^AA!^Ac^CA!)+" [buffer-read-only nil forward-char 1 delete-backward-char 2 "**" backward-char] 4)) .