unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Patch for Chinese Mid-Autumn Festival
@ 2006-09-19 10:47 Ben Wong
  2006-09-20  2:00 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Wong @ 2006-09-19 10:47 UTC (permalink / raw)


Hi, I couldn't help but notice that in my copy of emacs (version
21.4), that the only Chinese holiday in the calendar is Chinese New
Year.

There is at least one other very major Chinese holiday which GNU emacs
should know about: the Mid-Autumn Festival. The changes needed to
support it are fairly trivial and are included in the attached patch.
Please consider including this minor change in the next version of
emacs.

--b9

P.S. The optimal fix would be to add a holiday-chinese function
similar to holiday-hebrew. However, that requires more knowledge about
"leap months" than I possess.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch for Chinese Mid-Autumn Festival
  2006-09-19 10:47 Patch for Chinese Mid-Autumn Festival Ben Wong
@ 2006-09-20  2:00 ` Glenn Morris
  2006-09-20  5:04   ` Ben Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2006-09-20  2:00 UTC (permalink / raw)
  Cc: bug-gnu-emacs

"Ben Wong" wrote:

> There is at least one other very major Chinese holiday which GNU
> emacs should know about: the Mid-Autumn Festival. The changes needed
> to support it are fairly trivial and are included in the attached
> patch.

Umm, no patch seems to be attached...

Maybe send it again, but as inline text rather than an attachment?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch for Chinese Mid-Autumn Festival
  2006-09-20  2:00 ` Glenn Morris
@ 2006-09-20  5:04   ` Ben Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Wong @ 2006-09-20  5:04 UTC (permalink / raw)


Oops. Here it is inline.

--- lisp/calendar/cal-china.el.orig	2001-07-16 00:46:48.000000000 -0700
+++ lisp/calendar/cal-china.el	2006-09-18 23:45:01.000000000 -0700
@@ -374,6 +374,15 @@
                  (format "Chinese New Year (%s)"
                          (calendar-chinese-sexagesimal-name (+ y 57))))))))))

+(defun holiday-mid-autumn-festival ()
+  "Date of Chinese Mid-Autumn (Harvest Moon) Festival."
+    (let ((moon-festival		; 15th day of 8th lunar month
+	   (calendar-gregorian-from-absolute
+	    (+ (car (cdr (assoc 8 (chinese-year displayed-year)))) 14))))
+      (if (calendar-date-is-visible-p moon-festival)
+          (list (list moon-festival "Chinese Mid-Autumn Festival")))))
+
+
 (defun calendar-chinese-date-string (&optional date)
   "String of Chinese date of Gregorian DATE.
 Defaults to today's date if DATE is not given."
--- lisp/calendar/holidays.el.orig	2001-05-09 08:11:07.000000000 -0700
+++ lisp/calendar/holidays.el	2006-09-18 23:45:03.000000000 -0700
@@ -85,6 +85,10 @@
   "Date of Chinese New Year."
   t)

+(autoload 'holiday-mid-autumn-festival "cal-china"
+  "Date of Chinese Mid-Autumn (Harvest Moon) Festival."
+  t)
+
 (autoload 'solar-equinoxes-solstices "solar"
   "Date and time of equinoxes and solstices, if visible in the calendar window.
 Requires floating point."
--- lisp/calendar/calendar.el.orig	2003-01-29 00:12:34.000000000 -0800
+++ lisp/calendar/calendar.el	2006-09-19 03:00:35.000000000 -0700
@@ -819,7 +819,9 @@
 ;;;###autoload
 (defcustom oriental-holidays
   '((if (fboundp 'atan)
-	(holiday-chinese-new-year)))
+	(holiday-chinese-new-year))
+    (if (fboundp 'atan)
+	(holiday-mid-autumn-festival)))
   "*Oriental holidays.
 See the documentation for `calendar-holidays' for details."
   :type 'sexp



On 9/19/06, Glenn Morris <rgm@gnu.org> wrote:
> "Ben Wong" wrote:
>
> > There is at least one other very major Chinese holiday which GNU
> > emacs should know about: the Mid-Autumn Festival. The changes needed
> > to support it are fairly trivial and are included in the attached
> > patch.
>
> Umm, no patch seems to be attached...
>
> Maybe send it again, but as inline text rather than an attachment?
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-09-20  5:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-19 10:47 Patch for Chinese Mid-Autumn Festival Ben Wong
2006-09-20  2:00 ` Glenn Morris
2006-09-20  5:04   ` Ben Wong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).