diff options
| author | Stefan Monnier | 2000-09-19 15:50:54 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2000-09-19 15:50:54 +0000 |
| commit | 3cbb486089298f0f4ac02fee56d5f5a988dbce5a (patch) | |
| tree | 9498edaeb07d4a9781fd409fa76a48ea858e3744 | |
| parent | 1c024bdaaadbff9b228b5bc1bd6598c58051cec5 (diff) | |
| download | emacs-3cbb486089298f0f4ac02fee56d5f5a988dbce5a.tar.gz emacs-3cbb486089298f0f4ac02fee56d5f5a988dbce5a.zip | |
Docstring fixes.
(calendar-make-alist): Don't quote lambda.
(calendar-star-date): Use make-local-variable.
| -rw-r--r-- | lisp/calendar/calendar.el | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 0248119d1e8..c98ecd6d14c 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -164,7 +164,7 @@ is governed by the variable `number-of-diary-entries'." | |||
| 164 | ;;;###autoload | 164 | ;;;###autoload |
| 165 | (defcustom number-of-diary-entries 1 | 165 | (defcustom number-of-diary-entries 1 |
| 166 | "*Specifies how many days of diary entries are to be displayed initially. | 166 | "*Specifies how many days of diary entries are to be displayed initially. |
| 167 | This variable affects the diary display when the command M-x diary is used, | 167 | This variable affects the diary display when the command \\[diary] is used, |
| 168 | or if the value of the variable `view-diary-entries-initially' is t. For | 168 | or if the value of the variable `view-diary-entries-initially' is t. For |
| 169 | example, if the default value 1 is used, then only the current day's diary | 169 | example, if the default value 1 is used, then only the current day's diary |
| 170 | entries will be displayed. If the value 2 is used, then both the current | 170 | entries will be displayed. If the value 2 is used, then both the current |
| @@ -489,7 +489,7 @@ See the documentation for the function `include-other-diary-files'." | |||
| 489 | 489 | ||
| 490 | ;;;###autoload | 490 | ;;;###autoload |
| 491 | (defcustom sexp-diary-entry-symbol "%%" | 491 | (defcustom sexp-diary-entry-symbol "%%" |
| 492 | "*The string used to indicate a sexp diary entry in diary-file. | 492 | "*The string used to indicate a sexp diary entry in `diary-file'. |
| 493 | See the documentation for the function `list-sexp-diary-entries'." | 493 | See the documentation for the function `list-sexp-diary-entries'." |
| 494 | :type 'string | 494 | :type 'string |
| 495 | :group 'diary) | 495 | :group 'diary) |
| @@ -742,7 +742,7 @@ describes the style of such diary entries." | |||
| 742 | "*List of functions called after marking diary entries in the calendar. | 742 | "*List of functions called after marking diary entries in the calendar. |
| 743 | 743 | ||
| 744 | A function `mark-included-diary-files' is also provided for use as the | 744 | A function `mark-included-diary-files' is also provided for use as the |
| 745 | mark-diary-entries-hook; it enables you to use shared diary files together | 745 | `mark-diary-entries-hook'; it enables you to use shared diary files together |
| 746 | with your own. The files included are specified in the diary file by lines | 746 | with your own. The files included are specified in the diary file by lines |
| 747 | of the form | 747 | of the form |
| 748 | #include \"filename\" | 748 | #include \"filename\" |
| @@ -1036,7 +1036,7 @@ See the documentation for `calendar-holidays' for details." | |||
| 1036 | (append general-holidays local-holidays other-holidays | 1036 | (append general-holidays local-holidays other-holidays |
| 1037 | christian-holidays hebrew-holidays islamic-holidays | 1037 | christian-holidays hebrew-holidays islamic-holidays |
| 1038 | oriental-holidays solar-holidays) | 1038 | oriental-holidays solar-holidays) |
| 1039 | "*List of notable days for the command M-x holidays. | 1039 | "*List of notable days for the command \\[holidays]. |
| 1040 | 1040 | ||
| 1041 | Additional holidays are easy to add to the list, just put them in the list | 1041 | Additional holidays are easy to add to the list, just put them in the list |
| 1042 | `other-holidays' in your .emacs file. Similarly, by setting any of | 1042 | `other-holidays' in your .emacs file. Similarly, by setting any of |
| @@ -1055,7 +1055,7 @@ Several basic functions are provided for this purpose: | |||
| 1055 | (holiday-float MONTH DAYNAME K STRING &optional day) is the Kth DAYNAME in | 1055 | (holiday-float MONTH DAYNAME K STRING &optional day) is the Kth DAYNAME in |
| 1056 | MONTH on the Gregorian calendar (0 for Sunday, | 1056 | MONTH on the Gregorian calendar (0 for Sunday, |
| 1057 | etc.); K<0 means count back from the end of the | 1057 | etc.); K<0 means count back from the end of the |
| 1058 | month. An optional parameter DAY means the Kth | 1058 | month. An optional parameter DAY means the Kth |
| 1059 | DAYNAME after/before MONTH DAY. | 1059 | DAYNAME after/before MONTH DAY. |
| 1060 | (holiday-hebrew MONTH DAY STRING) a fixed date on the Hebrew calendar | 1060 | (holiday-hebrew MONTH DAY STRING) a fixed date on the Hebrew calendar |
| 1061 | (holiday-islamic MONTH DAY STRING) a fixed date on the Islamic calendar | 1061 | (holiday-islamic MONTH DAY STRING) a fixed date on the Islamic calendar |
| @@ -1205,7 +1205,7 @@ Forward if N is positive or backward if N is negative." | |||
| 1205 | (car (cdr (cdr date)))) | 1205 | (car (cdr (cdr date)))) |
| 1206 | 1206 | ||
| 1207 | (defsubst calendar-leap-year-p (year) | 1207 | (defsubst calendar-leap-year-p (year) |
| 1208 | "Returns t if YEAR is a Gregorian leap year." | 1208 | "Return t if YEAR is a Gregorian leap year." |
| 1209 | (and (zerop (% year 4)) | 1209 | (and (zerop (% year 4)) |
| 1210 | (or (not (zerop (% year 100))) | 1210 | (or (not (zerop (% year 100))) |
| 1211 | (zerop (% year 400))))) | 1211 | (zerop (% year 400))))) |
| @@ -1395,7 +1395,7 @@ necessary to display the desired date. | |||
| 1395 | 1395 | ||
| 1396 | Diary entries can be marked on the calendar or displayed in another window. | 1396 | Diary entries can be marked on the calendar or displayed in another window. |
| 1397 | 1397 | ||
| 1398 | Use M-x describe-mode for details of the key bindings in the calendar window. | 1398 | Use \\[describe-mode] for details of the key bindings in the calendar window. |
| 1399 | 1399 | ||
| 1400 | The Gregorian calendar is assumed. | 1400 | The Gregorian calendar is assumed. |
| 1401 | 1401 | ||
| @@ -2191,12 +2191,12 @@ the STRINGS are just concatenated and the result truncated." | |||
| 2191 | (bury-buffer)))))) | 2191 | (bury-buffer)))))) |
| 2192 | 2192 | ||
| 2193 | (defun calendar-current-date () | 2193 | (defun calendar-current-date () |
| 2194 | "Returns the current date in a list (month day year)." | 2194 | "Return the current date in a list (month day year)." |
| 2195 | (let ((now (decode-time))) | 2195 | (let ((now (decode-time))) |
| 2196 | (list (nth 4 now) (nth 3 now) (nth 5 now)))) | 2196 | (list (nth 4 now) (nth 3 now) (nth 5 now)))) |
| 2197 | 2197 | ||
| 2198 | (defun calendar-cursor-to-date (&optional error) | 2198 | (defun calendar-cursor-to-date (&optional error) |
| 2199 | "Returns a list (month day year) of current cursor position. | 2199 | "Return a list (month day year) of current cursor position. |
| 2200 | If cursor is not on a specific date, signals an error if optional parameter | 2200 | If cursor is not on a specific date, signals an error if optional parameter |
| 2201 | ERROR is t, otherwise just returns nil." | 2201 | ERROR is t, otherwise just returns nil." |
| 2202 | (let* ((segment (/ (current-column) 25)) | 2202 | (let* ((segment (/ (current-column) 25)) |
| @@ -2350,10 +2350,10 @@ is a string to insert in the minibuffer before reading." | |||
| 2350 | value)) | 2350 | value)) |
| 2351 | 2351 | ||
| 2352 | (defun calendar-read-date (&optional noday) | 2352 | (defun calendar-read-date (&optional noday) |
| 2353 | "Prompt for Gregorian date. Returns a list (month day year). | 2353 | "Prompt for Gregorian date. Return a list (month day year). |
| 2354 | If optional NODAY is t, does not ask for day, but just returns | 2354 | If optional NODAY is t, does not ask for day, but just returns |
| 2355 | \(month nil year); if NODAY is any other non-nil value the value returned is | 2355 | \(month nil year); if NODAY is any other non-nil value the value returned is |
| 2356 | \(month year) " | 2356 | \(month year)" |
| 2357 | (let* ((year (calendar-read | 2357 | (let* ((year (calendar-read |
| 2358 | "Year (>0): " | 2358 | "Year (>0): " |
| 2359 | (lambda (x) (> x 0)) | 2359 | (lambda (x) (> x 0)) |
| @@ -2383,7 +2383,7 @@ If optional NODAY is t, does not ask for day, but just returns | |||
| 2383 | (- mon2 mon1))) | 2383 | (- mon2 mon1))) |
| 2384 | 2384 | ||
| 2385 | (defun calendar-day-name (date &optional width absolute) | 2385 | (defun calendar-day-name (date &optional width absolute) |
| 2386 | "Returns a string with the name of the day of the week of DATE. | 2386 | "Return a string with the name of the day of the week of DATE. |
| 2387 | If WIDTH is non-nil, return just the first WIDTH characters of the name. | 2387 | If WIDTH is non-nil, return just the first WIDTH characters of the name. |
| 2388 | If ABSOLUTE is non-nil, then DATE is actually the day-of-the-week | 2388 | If ABSOLUTE is non-nil, then DATE is actually the day-of-the-week |
| 2389 | rather than a date." | 2389 | rather than a date." |
| @@ -2408,7 +2408,7 @@ Start at index 1, unless optional START-INDEX is provided. | |||
| 2408 | If FILTER is provided, apply it to each item in the list." | 2408 | If FILTER is provided, apply it to each item in the list." |
| 2409 | (let ((index (if start-index (1- start-index) 0))) | 2409 | (let ((index (if start-index (1- start-index) 0))) |
| 2410 | (mapcar | 2410 | (mapcar |
| 2411 | '(lambda (x) | 2411 | (lambda (x) |
| 2412 | (setq index (1+ index)) | 2412 | (setq index (1+ index)) |
| 2413 | (cons (if filter (funcall filter x) x) | 2413 | (cons (if filter (funcall filter x) x) |
| 2414 | index)) | 2414 | index)) |
| @@ -2429,7 +2429,7 @@ If WIDTH is non-nil, return just the first WIDTH characters of the name." | |||
| 2429 | string))) | 2429 | string))) |
| 2430 | 2430 | ||
| 2431 | (defun calendar-day-of-week (date) | 2431 | (defun calendar-day-of-week (date) |
| 2432 | "Returns the day-of-the-week index of DATE, 0 for Sunday, 1 for Monday, etc." | 2432 | "Return the day-of-the-week index of DATE, 0 for Sunday, 1 for Monday, etc." |
| 2433 | (% (calendar-absolute-from-gregorian date) 7)) | 2433 | (% (calendar-absolute-from-gregorian date) 7)) |
| 2434 | 2434 | ||
| 2435 | (defun calendar-unmark () | 2435 | (defun calendar-unmark () |
| @@ -2440,14 +2440,14 @@ If WIDTH is non-nil, return just the first WIDTH characters of the name." | |||
| 2440 | (redraw-calendar)) | 2440 | (redraw-calendar)) |
| 2441 | 2441 | ||
| 2442 | (defun calendar-date-is-visible-p (date) | 2442 | (defun calendar-date-is-visible-p (date) |
| 2443 | "Returns t if DATE is legal and is visible in the calendar window." | 2443 | "Return t if DATE is legal and is visible in the calendar window." |
| 2444 | (let ((gap (calendar-interval | 2444 | (let ((gap (calendar-interval |
| 2445 | displayed-month displayed-year | 2445 | displayed-month displayed-year |
| 2446 | (extract-calendar-month date) (extract-calendar-year date)))) | 2446 | (extract-calendar-month date) (extract-calendar-year date)))) |
| 2447 | (and (calendar-date-is-legal-p date) (> 2 gap) (< -2 gap)))) | 2447 | (and (calendar-date-is-legal-p date) (> 2 gap) (< -2 gap)))) |
| 2448 | 2448 | ||
| 2449 | (defun calendar-date-is-legal-p (date) | 2449 | (defun calendar-date-is-legal-p (date) |
| 2450 | "Returns t if DATE is a legal date." | 2450 | "Return t if DATE is a legal date." |
| 2451 | (let ((month (extract-calendar-month date)) | 2451 | (let ((month (extract-calendar-month date)) |
| 2452 | (day (extract-calendar-day date)) | 2452 | (day (extract-calendar-day date)) |
| 2453 | (year (extract-calendar-year date))) | 2453 | (year (extract-calendar-year date))) |
| @@ -2456,7 +2456,7 @@ If WIDTH is non-nil, return just the first WIDTH characters of the name." | |||
| 2456 | (<= 1 year)))) | 2456 | (<= 1 year)))) |
| 2457 | 2457 | ||
| 2458 | (defun calendar-date-equal (date1 date2) | 2458 | (defun calendar-date-equal (date1 date2) |
| 2459 | "Returns t if the DATE1 and DATE2 are the same." | 2459 | "Return t if the DATE1 and DATE2 are the same." |
| 2460 | (and | 2460 | (and |
| 2461 | (= (extract-calendar-month date1) (extract-calendar-month date2)) | 2461 | (= (extract-calendar-month date1) (extract-calendar-month date2)) |
| 2462 | (= (extract-calendar-day date1) (extract-calendar-day date2)) | 2462 | (= (extract-calendar-day date1) (extract-calendar-day date2)) |
| @@ -2482,10 +2482,10 @@ MARK defaults to diary-entry-marker." | |||
| 2482 | 2482 | ||
| 2483 | (defun calendar-star-date () | 2483 | (defun calendar-star-date () |
| 2484 | "Replace the date under the cursor in the calendar window with asterisks. | 2484 | "Replace the date under the cursor in the calendar window with asterisks. |
| 2485 | This function can be used with the today-visible-calendar-hook run after the | 2485 | This function can be used with the `today-visible-calendar-hook' run after the |
| 2486 | calendar window has been prepared." | 2486 | calendar window has been prepared." |
| 2487 | (let ((buffer-read-only nil)) | 2487 | (let ((inhibit-read-only t)) |
| 2488 | (make-variable-buffer-local 'calendar-starred-day) | 2488 | (make-local-variable 'calendar-starred-day) |
| 2489 | (forward-char 1) | 2489 | (forward-char 1) |
| 2490 | (setq calendar-starred-day | 2490 | (setq calendar-starred-day |
| 2491 | (string-to-int | 2491 | (string-to-int |
| @@ -2498,14 +2498,14 @@ calendar window has been prepared." | |||
| 2498 | (defun calendar-mark-today () | 2498 | (defun calendar-mark-today () |
| 2499 | "Mark the date under the cursor in the calendar window. | 2499 | "Mark the date under the cursor in the calendar window. |
| 2500 | The date is marked with calendar-today-marker. This function can be used with | 2500 | The date is marked with calendar-today-marker. This function can be used with |
| 2501 | the today-visible-calendar-hook run after the calendar window has been | 2501 | the `today-visible-calendar-hook' run after the calendar window has been |
| 2502 | prepared." | 2502 | prepared." |
| 2503 | (mark-visible-calendar-date | 2503 | (mark-visible-calendar-date |
| 2504 | (calendar-cursor-to-date) | 2504 | (calendar-cursor-to-date) |
| 2505 | calendar-today-marker)) | 2505 | calendar-today-marker)) |
| 2506 | 2506 | ||
| 2507 | (defun calendar-date-compare (date1 date2) | 2507 | (defun calendar-date-compare (date1 date2) |
| 2508 | "Returns t if DATE1 is before DATE2, nil otherwise. | 2508 | "Return t if DATE1 is before DATE2, nil otherwise. |
| 2509 | The actual dates are in the car of DATE1 and DATE2." | 2509 | The actual dates are in the car of DATE1 and DATE2." |
| 2510 | (< (calendar-absolute-from-gregorian (car date1)) | 2510 | (< (calendar-absolute-from-gregorian (car date1)) |
| 2511 | (calendar-absolute-from-gregorian (car date2)))) | 2511 | (calendar-absolute-from-gregorian (car date2)))) |
| @@ -2532,7 +2532,7 @@ omits the name of the day of the week." | |||
| 2532 | (mapconcat 'eval calendar-date-display-form ""))) | 2532 | (mapconcat 'eval calendar-date-display-form ""))) |
| 2533 | 2533 | ||
| 2534 | (defun calendar-dayname-on-or-before (dayname date) | 2534 | (defun calendar-dayname-on-or-before (dayname date) |
| 2535 | "Returns the absolute date of the DAYNAME on or before absolute DATE. | 2535 | "Return the absolute date of the DAYNAME on or before absolute DATE. |
| 2536 | DAYNAME=0 means Sunday, DAYNAME=1 means Monday, and so on. | 2536 | DAYNAME=0 means Sunday, DAYNAME=1 means Monday, and so on. |
| 2537 | 2537 | ||
| 2538 | Note: Applying this function to d+6 gives us the DAYNAME on or after an | 2538 | Note: Applying this function to d+6 gives us the DAYNAME on or after an |