[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Improvement to cal-china.el
From: |
Yong Lu |
Subject: |
Improvement to cal-china.el |
Date: |
12 Nov 2001 22:27:31 +0800 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.50 |
Hi,
I just discovered this chinese calendar library in Emacs. After
playing with it for a while, I think it's better to let it display
chinese date in chinese characters if the current languange
environment is Chinese-GB or Chinese-BIG5.
Here's the patch:
*** c:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/cal-china.el2108LcG Mon Nov 12
22:21:40 2001
--- c:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/cal-china.el2108YmM Mon Nov 12
22:21:40 2001
***************
*** 54,62 ****
--- 54,74 ----
(defvar chinese-calendar-celestial-stem
["Jia" "Yi" "Bing" "Ding" "Wu" "Ji" "Geng" "Xin" "Ren" "Gui"])
+ (defvar chinese-calendar-terrestrial-branch-chs
+ ["子" "丑" "寅" "卯" "辰" "巳" "午" "未" "申" "酉" "戌" "亥"])
+
+ (defvar chinese-calendar-terrestrial-branch-cht
+ ["子" "丑" "寅" "卯" "辰" "巳" "午" "未" "申" "酉" "戌" "亥"])
+
(defvar chinese-calendar-terrestrial-branch
["Zi" "Chou" "Yin" "Mao" "Chen" "Si" "Wu" "Wei" "Shen" "You" "Xu" "Hai"])
+ (defvar chinese-calendar-celestial-stem-chs
+ ["甲" "乙" "丙" "丁" "戊" "己" "庚" "辛" "壬" "癸"])
+
+ (defvar chinese-calendar-celestial-stem-cht
+ ["甲" "乙" "丙" "丁" "戊" "己" "庚" "辛" "壬" "癸"])
+
(defcustom chinese-calendar-time-zone
'(if (< year 1928)
(+ 465 (/ 40.0 60.0))
***************
*** 411,419 ****
"The N-th name of the Chinese sexagesimal cycle.
N congruent to 1 gives the first name, N congruent to 2 gives the second name,
..., N congruent to 60 gives the sixtieth name."
! (format "%s-%s"
! (aref chinese-calendar-celestial-stem (% (1- n) 10))
! (aref chinese-calendar-terrestrial-branch (% (1- n) 12))))
(defun calendar-print-chinese-date ()
"Show the Chinese date equivalents of date."
--- 423,441 ----
"The N-th name of the Chinese sexagesimal cycle.
N congruent to 1 gives the first name, N congruent to 2 gives the second name,
..., N congruent to 60 gives the sixtieth name."
! (cond
! ((equal current-language-environment "Chinese-GB")
! (format "%s%s"
! (aref chinese-calendar-celestial-stem-chs (% (1- n) 10))
! (aref chinese-calendar-terrestrial-branch-chs (% (1- n) 12))))
! ((equal current-language-environment "Chinese BIG5")
! (format "%s%s"
! (aref chinese-calendar-celestial-stem-cht (% (1- n) 10))
! (aref chinese-calendar-terrestrial-branch-cht (% (1- n) 12))))
! (t
! (format "%s-%s"
! (aref chinese-calendar-celestial-stem (% (1- n) 10))
! (aref chinese-calendar-terrestrial-branch (% (1- n) 12))))))
(defun calendar-print-chinese-date ()
"Show the Chinese date equivalents of date."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Improvement to cal-china.el,
Yong Lu <=