aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward M. Reingold1994-10-30 00:25:33 +0000
committerEdward M. Reingold1994-10-30 00:25:33 +0000
commitecd42d42f14e5477d9459afcba14e40272edd1fa (patch)
tree05aab4c63c8ef14e3b67d2da93062c231d26a055
parent47d52240aaa01f48adc6e07ed8ea3b4c023435af (diff)
downloademacs-ecd42d42f14e5477d9459afcba14e40272edd1fa.tar.gz
emacs-ecd42d42f14e5477d9459afcba14e40272edd1fa.zip
Redo the noday option for calendar-read-date.
-rw-r--r--lisp/calendar/calendar.el25
1 files changed, 12 insertions, 13 deletions
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index db7413599d5..18e5ea10efc 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -1096,8 +1096,7 @@ to be replaced by asterisks to highlight it whenever it is in the window."
1096 (interactive "P") 1096 (interactive "P")
1097 (set-buffer (get-buffer-create calendar-buffer)) 1097 (set-buffer (get-buffer-create calendar-buffer))
1098 (calendar-mode) 1098 (calendar-mode)
1099 (let* ((completion-ignore-case t) 1099 (let* ((pop-up-windows t)
1100 (pop-up-windows t)
1101 (split-height-threshold 1000) 1100 (split-height-threshold 1000)
1102 (date (if arg 1101 (date (if arg
1103 (calendar-read-date t) 1102 (calendar-read-date t)
@@ -1975,9 +1974,7 @@ Gregorian date Sunday, December 31, 1 BC."
1975 1974
1976(defun calendar-other-month (month year) 1975(defun calendar-other-month (month year)
1977 "Display a three-month calendar centered around MONTH and YEAR." 1976 "Display a three-month calendar centered around MONTH and YEAR."
1978 (interactive 1977 (interactive (calendar-read-date 'noday))
1979 (let* ((completion-ignore-case t))
1980 (calendar-read-date t)))
1981 (if (and (= month displayed-month) 1978 (if (and (= month displayed-month)
1982 (= year displayed-year)) 1979 (= year displayed-year))
1983 nil 1980 nil
@@ -2052,7 +2049,8 @@ is a string to insert in the minibuffer before reading."
2052(defun calendar-read-date (&optional noday) 2049(defun calendar-read-date (&optional noday)
2053 "Prompt for Gregorian date. Returns a list (month day year). 2050 "Prompt for Gregorian date. Returns a list (month day year).
2054If optional NODAY is t, does not ask for day, but just returns 2051If optional NODAY is t, does not ask for day, but just returns
2055(month nil year)." 2052(month nil year); if NODAY is any other non-nil value the value returned is
2053(month year) "
2056 (let* ((year (calendar-read 2054 (let* ((year (calendar-read
2057 "Year (>0): " 2055 "Year (>0): "
2058 '(lambda (x) (> x 0)) 2056 '(lambda (x) (> x 0))
@@ -2068,13 +2066,14 @@ If optional NODAY is t, does not ask for day, but just returns
2068 nil t)) 2066 nil t))
2069 (calendar-make-alist month-array 1 'capitalize)))) 2067 (calendar-make-alist month-array 1 'capitalize))))
2070 (last (calendar-last-day-of-month month year))) 2068 (last (calendar-last-day-of-month month year)))
2071 (list month 2069 (if noday
2072 (if noday 2070 (if (eq noday t)
2073 nil 2071 (list month nil year)
2074 (day (calendar-read 2072 (list month year))
2075 (format "Day (1-%d): " last) 2073 (list month
2076 '(lambda (x) (and (< 0 x) (<= x last)))))) 2074 (calendar-read (format "Day (1-%d): " last)
2077 year))) 2075 '(lambda (x) (and (< 0 x) (<= x last))))
2076 year))))
2078 2077
2079(defun calendar-goto-date (date) 2078(defun calendar-goto-date (date)
2080 "Move cursor to DATE." 2079 "Move cursor to DATE."