我試圖在我的.emacs
中實施節氣,所以我的「假期」將顯示太陽經度與15度的每個倍數交叉的時間。這裏是相關的snipplet。爲什麼Emacs會在我的.emacs文件中抱怨無效顯示年份?
(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的(版本23.2-R2上的Gentoo)抱怨顯示,今年是啓動時的空隙變,並試圖生成的Mx日曆RET日曆也沒有幫助。任何想法如何我可以解決這個問題? (當然不是在我的.emacs
中定義顯示年份,因爲這肯定會把所有其他東西都搞砸了......)
在運行此功能之前,您是否需要日曆並加載它? – 2010-11-29 18:26:02