Commit 3d186118 authored by Glenn Morris's avatar Glenn Morris

(calendar-insert-indented): Doc fix. Use when rather than if.

(exit-calendar): Use mapc rather than mapcar.
(calendar-cursor-to-date): Use zerop.
parent 668bd187
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
Move to diary-lib. Move to diary-lib.
(all-christian-calendar-holidays, all-islamic-calendar-holidays) (all-christian-calendar-holidays, all-islamic-calendar-holidays)
(all-bahai-calendar-holidays): Doc fix. (all-bahai-calendar-holidays): Doc fix.
(calendar-insert-indented): Doc fix. Use when rather than if.
(exit-calendar): Use mapc rather than mapcar.
(calendar-cursor-to-date): Use zerop.
(calendar-mark-ring): Add doc-string. (calendar-mark-ring): Add doc-string.
(calendar-starred-day): Defvar it. (calendar-starred-day): Defvar it.
(calendar-mode): Make calendar-starred-day local. (calendar-mode): Make calendar-starred-day local.
...@@ -52,6 +55,7 @@ ...@@ -52,6 +55,7 @@
(mark-diary-entries-hook, nongregorian-diary-listing-hook) (mark-diary-entries-hook, nongregorian-diary-listing-hook)
(nongregorian-diary-marking-hook, print-diary-entries-hook): (nongregorian-diary-marking-hook, print-diary-entries-hook):
Move here from calendar.el. Move here from calendar.el.
(diary-file-name-prefix-function): Use 'identity.
(diary-face): Make it a defcustom, and mark as obsolete. (diary-face): Make it a defcustom, and mark as obsolete.
(top-level): No need to require cal-hebrew, cal-islam when (top-level): No need to require cal-hebrew, cal-islam when
compiling. compiling.
......
...@@ -1592,7 +1592,7 @@ line." ...@@ -1592,7 +1592,7 @@ line."
"Insert STRING at column INDENT. "Insert STRING at column INDENT.
If the optional parameter NEWLINE is t, leave point at start of next line, If the optional parameter NEWLINE is t, leave point at start of next line,
inserting a newline if there was no next line; otherwise, leave point after inserting a newline if there was no next line; otherwise, leave point after
the inserted text. Value is always t." the inserted text. Returns t."
;; Try to move to that column. ;; Try to move to that column.
(move-to-column indent) (move-to-column indent)
;; If line is too short, indent out to that column. ;; If line is too short, indent out to that column.
...@@ -1600,12 +1600,11 @@ the inserted text. Value is always t." ...@@ -1600,12 +1600,11 @@ the inserted text. Value is always t."
(indent-to indent)) (indent-to indent))
(insert string) (insert string)
;; Advance to next line, if requested. ;; Advance to next line, if requested.
(if newline (when newline
(progn (end-of-line)
(end-of-line) (if (eobp)
(if (eobp) (newline)
(newline) (forward-line 1)))
(forward-line 1))))
t) t)
(defun redraw-calendar () (defun redraw-calendar ()
...@@ -1955,10 +1954,10 @@ the STRINGS are just concatenated and the result truncated." ...@@ -1955,10 +1954,10 @@ the STRINGS are just concatenated and the result truncated."
(not (buffer-modified-p diary-buffer)) (not (buffer-modified-p diary-buffer))
(yes-or-no-p (yes-or-no-p
"Diary modified; do you really want to exit the calendar? ")) "Diary modified; do you really want to exit the calendar? "))
;; Need to do this multiple times because one time can replace some ;; Need to do this multiple times because one time can replace some
;; calendar-related buffers with other calendar-related buffers ;; calendar-related buffers with other calendar-related buffers
(mapcar (lambda (x) (mapc (lambda (x)
(mapcar 'calendar-hide-window (calendar-window-list))) (mapc 'calendar-hide-window (calendar-window-list)))
(calendar-window-list))))) (calendar-window-list)))))
(defun calendar-hide-window (window) (defun calendar-hide-window (window)
...@@ -1991,10 +1990,10 @@ If cursor is not on a specific date, signals an error if optional parameter ...@@ -1991,10 +1990,10 @@ If cursor is not on a specific date, signals an error if optional parameter
ERROR is t, otherwise just returns nil." ERROR is t, otherwise just returns nil."
(let* ((segment (/ (current-column) 25)) (let* ((segment (/ (current-column) 25))
(month (% (+ displayed-month segment -1) 12)) (month (% (+ displayed-month segment -1) 12))
(month (if (= 0 month) 12 month)) (month (if (zerop month) 12 month))
(year (year
(cond (cond
((and (= 12 month) (= segment 0)) (1- displayed-year)) ((and (= 12 month) (zerop segment)) (1- displayed-year))
((and (= 1 month) (= segment 2)) (1+ displayed-year)) ((and (= 1 month) (= segment 2)) (1+ displayed-year))
(t displayed-year)))) (t displayed-year))))
(if (and (looking-at "[ 0-9]?[0-9][^0-9]") (if (and (looking-at "[ 0-9]?[0-9][^0-9]")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment