私は.emacs
私の「休日」が太陽経度が15度の各倍数を横切る時間を表示するように、太陽の用語を実装しようとしています。関連するスニペットは次のとおりです。
(defun next-solar-term-date (d)
(solar-date-next-longitude d 15))
(defconst solar-term-names
["moderate cold" "severe cold" "spring commerces"
"rain water" "insects awaken" "vernal equinox"
"Ching Ming" "corn rain" "summer commerces"
"corn forms" "corn on ear" "summer solstice"
"minor heat" "great heat" "autumn commerces"
"end of heat" "white dew" "autumnal equinox"
"cold dew" "frost" "winter commerces"
"light snow" "heavy snow" "winter solstice"])
(setq solar-terms-holidays
(let* ((k 0) (mylist nil))
(dotimes (k 4);k=season
(let* ((j 0))
(dotimes (j 5);no equinoxes/solstices --- use solar for them
(let* ((i (+ j (* 6 k)))
(month (+ 1 (/ i 2)))
(astronextdate (next-solar-term-date
(calendar-astro-from-absolute
(+ (* 15 i)
(calendar-absolute-from-gregorian
(list 1 1 displayed-year))))))
(s (aref solar-term-names i))
(absnextdate (calendar-absolute-from-astro
astronextdate))
(gregnextdate (calendar-gregorian-from-absolute
(floor absnextdate)))
(compt (* 24 (- absnextdate (floor absnextdate))))
(str (concat s " "
(solar-time-string
compt (if (dst-in-effect absnextdate)
calendar-daylight-time-zone-name
calendar-standard-time-zone-name))))
(d (extract-calendar-day gregnextdate)))
(setq mylist (append mylist
(list
(list 'holiday-fixed month d str))))))))
mylist))
しかし、emacs (Gentoo のバージョン 23.2-r2) は、display-year が起動時に void 変数であることに文句を言い、カレンダーを生成しようとしてM-x calendar RETも役に立ちません。どうすればそれを修正できますか?.emacs
(これは間違いなく他のすべてを台無しにするので、myで表示された年を定義することは確かにありません...)