1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-25 10:47:00 +00:00

Give lunar phases buffer a symbolic name; use new form of calendar-read-date.

This commit is contained in:
Edward M. Reingold 1994-10-26 15:32:51 +00:00
parent c99d4526f0
commit cc4879d271

View File

@ -185,8 +185,7 @@ remainder mod 4 gives the phase: 0 new moon, 1 first quarter, 2 full moon,
(let ((m1 displayed-month)
(y1 displayed-year)
(m2 displayed-month)
(y2 displayed-year)
(lunar-phases-buffer "*Phases of Moon*"))
(y2 displayed-year))
(increment-calendar-month m1 y1 -1)
(increment-calendar-month m2 y2 1)
(set-buffer (get-buffer-create lunar-phases-buffer))
@ -225,25 +224,11 @@ This function is suitable for execution in a .emacs file."
(interactive "P")
(save-excursion
(let* ((completion-ignore-case t)
(date (calendar-current-date))
(displayed-month
(if arg
(cdr (assoc
(capitalize
(completing-read
"Month name: "
(mapcar 'list (append calendar-month-name-array nil))
nil t))
(calendar-make-alist calendar-month-name-array)))
(extract-calendar-month date)))
(displayed-year
(if arg
(calendar-read
"Year (>0): "
'(lambda (x) (> x 0))
(int-to-string
(extract-calendar-year (calendar-current-date))))
(extract-calendar-year date))))
(date (if arg
(calendar-read-date t)
(calendar-current-date)))
(displayed-month (extract-calendar-month date))
(displayed-year (extract-calendar-year date)))
(calendar-phases-of-moon))))
(defun diary-phases-of-moon ()