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:
parent
c99d4526f0
commit
cc4879d271
@ -185,8 +185,7 @@ remainder mod 4 gives the phase: 0 new moon, 1 first quarter, 2 full moon,
|
|||||||
(let ((m1 displayed-month)
|
(let ((m1 displayed-month)
|
||||||
(y1 displayed-year)
|
(y1 displayed-year)
|
||||||
(m2 displayed-month)
|
(m2 displayed-month)
|
||||||
(y2 displayed-year)
|
(y2 displayed-year))
|
||||||
(lunar-phases-buffer "*Phases of Moon*"))
|
|
||||||
(increment-calendar-month m1 y1 -1)
|
(increment-calendar-month m1 y1 -1)
|
||||||
(increment-calendar-month m2 y2 1)
|
(increment-calendar-month m2 y2 1)
|
||||||
(set-buffer (get-buffer-create lunar-phases-buffer))
|
(set-buffer (get-buffer-create lunar-phases-buffer))
|
||||||
@ -225,25 +224,11 @@ This function is suitable for execution in a .emacs file."
|
|||||||
(interactive "P")
|
(interactive "P")
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(let* ((completion-ignore-case t)
|
(let* ((completion-ignore-case t)
|
||||||
(date (calendar-current-date))
|
(date (if arg
|
||||||
(displayed-month
|
(calendar-read-date t)
|
||||||
(if arg
|
(calendar-current-date)))
|
||||||
(cdr (assoc
|
(displayed-month (extract-calendar-month date))
|
||||||
(capitalize
|
(displayed-year (extract-calendar-year date)))
|
||||||
(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))))
|
|
||||||
(calendar-phases-of-moon))))
|
(calendar-phases-of-moon))))
|
||||||
|
|
||||||
(defun diary-phases-of-moon ()
|
(defun diary-phases-of-moon ()
|
||||||
|
Loading…
Reference in New Issue
Block a user