help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: chinese calendar entries for diary


From: Edward M. Reingold
Subject: Re: chinese calendar entries for diary
Date: 12 Apr 2006 11:38:18 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

>>>>> "k" == ken  <gebser@speakeasy.net> writes:

    k> I'm looking for a way to have my diary include "tsoh" days, i.e., the
    k> 10th and 25th days of each month of the Chinese calendar.  Google
    k> turned up nothing.  (Buddhists would appreciate that. :)

You need to write an Elisp function that is t on the dates you want and false
otherwise, then use this as a diary-sexp.  Here is such a function:

(defun tsoh ()
  "Chinese tsoh diary entry.
Entry applies on the 10th and 25th of the Chinese month."
  (let* ((chinese-date (calendar-chinese-from-absolute
                       (calendar-absolute-from-gregorian
                        (or date (calendar-current-date)))))
         (day (car (cdr (cdr (cdr chinese-date))))))
    (if (or (= day 10) (= day 25))
        "Tsoh")))
 
In your diary you use it like any other diary-sexp:

&%%(tsoh)

 


-- 

Professor Edward M. Reingold                Email: reingold@iit.edu
Chairman, Department of Computer Science    Voice: (312) 567-3309
Illinois Institute of Technology            Assistant: (312) 567-5152
Stuart Building                             Fax:   (312) 567-5067
10 West 31st Street, Suite 236
Chicago, IL  60616-3729  U.S.A.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]