diff options
| author | Glenn Morris | 2008-03-08 03:57:36 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-03-08 03:57:36 +0000 |
| commit | 3d1861183d68f4aa3b6b9d55604692174aa860d0 (patch) | |
| tree | b1aa7c3358e1c648204139eeaaf0dd88b7a1d714 | |
| parent | 668bd187b9ce6bc5df0514a88e3e048b4fcffc44 (diff) | |
| download | emacs-3d1861183d68f4aa3b6b9d55604692174aa860d0.tar.gz emacs-3d1861183d68f4aa3b6b9d55604692174aa860d0.zip | |
(calendar-insert-indented): Doc fix. Use when rather than if.
(exit-calendar): Use mapc rather than mapcar.
(calendar-cursor-to-date): Use zerop.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/calendar/calendar.el | 25 |
2 files changed, 16 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c2daeaf2d66..2845beacdef 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -39,6 +39,9 @@ | |||
| 39 | Move to diary-lib. | 39 | Move to diary-lib. |
| 40 | (all-christian-calendar-holidays, all-islamic-calendar-holidays) | 40 | (all-christian-calendar-holidays, all-islamic-calendar-holidays) |
| 41 | (all-bahai-calendar-holidays): Doc fix. | 41 | (all-bahai-calendar-holidays): Doc fix. |
| 42 | (calendar-insert-indented): Doc fix. Use when rather than if. | ||
| 43 | (exit-calendar): Use mapc rather than mapcar. | ||
| 44 | (calendar-cursor-to-date): Use zerop. | ||
| 42 | (calendar-mark-ring): Add doc-string. | 45 | (calendar-mark-ring): Add doc-string. |
| 43 | (calendar-starred-day): Defvar it. | 46 | (calendar-starred-day): Defvar it. |
| 44 | (calendar-mode): Make calendar-starred-day local. | 47 | (calendar-mode): Make calendar-starred-day local. |
| @@ -52,6 +55,7 @@ | |||
| 52 | (mark-diary-entries-hook, nongregorian-diary-listing-hook) | 55 | (mark-diary-entries-hook, nongregorian-diary-listing-hook) |
| 53 | (nongregorian-diary-marking-hook, print-diary-entries-hook): | 56 | (nongregorian-diary-marking-hook, print-diary-entries-hook): |
| 54 | Move here from calendar.el. | 57 | Move here from calendar.el. |
| 58 | (diary-file-name-prefix-function): Use 'identity. | ||
| 55 | (diary-face): Make it a defcustom, and mark as obsolete. | 59 | (diary-face): Make it a defcustom, and mark as obsolete. |
| 56 | (top-level): No need to require cal-hebrew, cal-islam when | 60 | (top-level): No need to require cal-hebrew, cal-islam when |
| 57 | compiling. | 61 | compiling. |
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 9096d0988e1..ee1463cc4d3 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -1592,7 +1592,7 @@ line." | |||
| 1592 | "Insert STRING at column INDENT. | 1592 | "Insert STRING at column INDENT. |
| 1593 | If the optional parameter NEWLINE is t, leave point at start of next line, | 1593 | If the optional parameter NEWLINE is t, leave point at start of next line, |
| 1594 | inserting a newline if there was no next line; otherwise, leave point after | 1594 | inserting a newline if there was no next line; otherwise, leave point after |
| 1595 | the inserted text. Value is always t." | 1595 | the inserted text. Returns t." |
| 1596 | ;; Try to move to that column. | 1596 | ;; Try to move to that column. |
| 1597 | (move-to-column indent) | 1597 | (move-to-column indent) |
| 1598 | ;; If line is too short, indent out to that column. | 1598 | ;; If line is too short, indent out to that column. |
| @@ -1600,12 +1600,11 @@ the inserted text. Value is always t." | |||
| 1600 | (indent-to indent)) | 1600 | (indent-to indent)) |
| 1601 | (insert string) | 1601 | (insert string) |
| 1602 | ;; Advance to next line, if requested. | 1602 | ;; Advance to next line, if requested. |
| 1603 | (if newline | 1603 | (when newline |
| 1604 | (progn | 1604 | (end-of-line) |
| 1605 | (end-of-line) | 1605 | (if (eobp) |
| 1606 | (if (eobp) | 1606 | (newline) |
| 1607 | (newline) | 1607 | (forward-line 1))) |
| 1608 | (forward-line 1)))) | ||
| 1609 | t) | 1608 | t) |
| 1610 | 1609 | ||
| 1611 | (defun redraw-calendar () | 1610 | (defun redraw-calendar () |
| @@ -1955,10 +1954,10 @@ the STRINGS are just concatenated and the result truncated." | |||
| 1955 | (not (buffer-modified-p diary-buffer)) | 1954 | (not (buffer-modified-p diary-buffer)) |
| 1956 | (yes-or-no-p | 1955 | (yes-or-no-p |
| 1957 | "Diary modified; do you really want to exit the calendar? ")) | 1956 | "Diary modified; do you really want to exit the calendar? ")) |
| 1958 | ;; Need to do this multiple times because one time can replace some | 1957 | ;; Need to do this multiple times because one time can replace some |
| 1959 | ;; calendar-related buffers with other calendar-related buffers | 1958 | ;; calendar-related buffers with other calendar-related buffers |
| 1960 | (mapcar (lambda (x) | 1959 | (mapc (lambda (x) |
| 1961 | (mapcar 'calendar-hide-window (calendar-window-list))) | 1960 | (mapc 'calendar-hide-window (calendar-window-list))) |
| 1962 | (calendar-window-list))))) | 1961 | (calendar-window-list))))) |
| 1963 | 1962 | ||
| 1964 | (defun calendar-hide-window (window) | 1963 | (defun calendar-hide-window (window) |
| @@ -1991,10 +1990,10 @@ If cursor is not on a specific date, signals an error if optional parameter | |||
| 1991 | ERROR is t, otherwise just returns nil." | 1990 | ERROR is t, otherwise just returns nil." |
| 1992 | (let* ((segment (/ (current-column) 25)) | 1991 | (let* ((segment (/ (current-column) 25)) |
| 1993 | (month (% (+ displayed-month segment -1) 12)) | 1992 | (month (% (+ displayed-month segment -1) 12)) |
| 1994 | (month (if (= 0 month) 12 month)) | 1993 | (month (if (zerop month) 12 month)) |
| 1995 | (year | 1994 | (year |
| 1996 | (cond | 1995 | (cond |
| 1997 | ((and (= 12 month) (= segment 0)) (1- displayed-year)) | 1996 | ((and (= 12 month) (zerop segment)) (1- displayed-year)) |
| 1998 | ((and (= 1 month) (= segment 2)) (1+ displayed-year)) | 1997 | ((and (= 1 month) (= segment 2)) (1+ displayed-year)) |
| 1999 | (t displayed-year)))) | 1998 | (t displayed-year)))) |
| 2000 | (if (and (looking-at "[ 0-9]?[0-9][^0-9]") | 1999 | (if (and (looking-at "[ 0-9]?[0-9][^0-9]") |