Emacs 日历与日记设置


;;------------------- Diary & Calendar ----------------
;; holiday-fixed m d 固定阳历节日, m 月 d 日
;; holiday-float m w n 浮动阳历节日, m 月的第 n 个星期 w%7
;;
;; ----------------------------------------------
;; . 跳回当前天
;; o 跳到某一个月
;; g d 跳到某年某月某日
;; g c 跳到某年某星期的星期几
;; g C 跳到阴历的某一天
;; p C 显示当前的阴历日期
;; h 显示当前节日
;; i d 加入当前这一天的日程安排
;; i w 加入每周这一天的日程安排
;; i m 加入每月这一天的日程安排
;; i y 加入每年这一天的日程安排
;; i a 加入周年纪念(anniversary),比如生日等
;; d 察看当前日期的diary
;; -----------------------------------------------
;;

(defun animals(birthyear)
"Calculate the Chinese aninal by year"
(let ((x (% (- 1997 birthyear) 12)))
(cond ((or (= x 1) (= x -11)) "鼠")
((= x 0) "牛")
((or (= x 11) (= x -1)) "虎")
((or (= x 10) (= x -2)) "兔")
((or (= x 9) (= x -3)) "龙")
((or (= x 8) (= x -4)) "蛇")
((or (= x 7) (= x -5)) "马")
((or (= x 6) (= x -6)) "羊")
((or (= x 5) (= x -7)) "猴")
((or (= x 4) (= x -8)) "鸡")
((or (= x 3) (= x -9)) "狗")
((or (= x 2) (= x -10)) "猪")
)
)
)


;; 默认的日记文件
(setq diary-file "~/Dropbox/Informatik-Studium/Ablauf/diary")
(setq diary-mail-addr "xxx@xxx.xxx")
(add-hook 'diary-hook 'appt-make-list)

;; make the calendar and diary display fancier
(setq view-diary-entries-initially t
mark-diary-entries-in-calendar t
number-of-diary-entries 7)
(add-hook 'diary-display-hook 'fancy-diary-display)
(add-hook 'today-visible-calendar-hook 'calendar-mark-today)

;;appointment
(setq appt-issue-message t)


;;设置所在地的经纬度和地名,calendar中按S,可以根据这些信息告知你每天的
;;日出和日落的时间。
(setq calendar-latitude +51.765201)
(setq calendar-longitude +14.326211)
(setq calendar-location-name "Cottbus")

(setq calendar-remove-frame-by-deleting t)
(setq calendar-week-start-day 0) ; 每周第一天是周日
(setq mark-diary-entries-in-calendar t) ; 标记有记录的日子
(setq mark-holidays-in-calendar t) ; 日历中突出标记节日
(setq view-calendar-holidays-initially t) ; 不显示节日列表

;;除去基督徒的节日、希伯来人的节日和伊斯兰教的节日。
(setq christian-holidays nil
hebrew-holidays nil
islamic-holidays nil
solar-holidays nil
bahai-holidays nil
)

;;要过的节日
(setq general-holidays '((holiday-fixed 1 1 "元旦")
(holiday-fixed 2 14 "情人节")
(holiday-fixed 4 1 "愚人节")
(holiday-fixed 12 25 "圣诞节")
(holiday-float 5 0 2 "母亲节")
(holiday-float 6 0 3 "父亲节")
(holiday-float 10 1 "国庆节")))

;; Calendar 中 p C 可以看到我们的阴历有中文的天干地支。
(setq chinese-calendar-celestial-stem
["甲" "乙" "丙" "丁" "戊" "己" "庚" "辛" "壬" "癸"])
(setq chinese-calendar-terrestrial-branch
["子" "丑" "寅" "卯" "辰" "巳" "午" "未" "申" "酉" "戌" "亥"])


;;------------------- Diary & Calendar ----------------

posted @ 2011-10-25 08:49  Kaffeeck  阅读(1189)  评论(0编辑  收藏  举报