all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* chinese calendar entries for diary
@ 2006-04-12 15:28 ken
  0 siblings, 0 replies; 2+ messages in thread
From: ken @ 2006-04-12 15:28 UTC (permalink / raw)



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

Looking at cal-chin.el, there's some defuns there which might lead to a
solution... eventually.  But they all trace back to something which the
docs call an "absolute date".  Info has no mention of this that I could
find.  Is there a elisp function for fetching this integer for the
current day?  (There must be!)  I tried using

(calendar-absolute-from-gregorian (list 4 22 2006))

and this works fine, but what do I replace (list 4 22 2006) with so that
it plugs in the current gregorian date (in the correct form)?


Thanks,
ken

-- 
"This world ain't big enough for the both of us,"
said the big noema to the little noema.

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

* Re: chinese calendar entries for diary
       [not found] <mailman.339.1144855795.9609.help-gnu-emacs@gnu.org>
@ 2006-04-12 16:38 ` Edward M. Reingold
  0 siblings, 0 replies; 2+ messages in thread
From: Edward M. Reingold @ 2006-04-12 16:38 UTC (permalink / raw)


>>>>> "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.

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

end of thread, other threads:[~2006-04-12 16:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-12 15:28 chinese calendar entries for diary ken
     [not found] <mailman.339.1144855795.9609.help-gnu-emacs@gnu.org>
2006-04-12 16:38 ` Edward M. Reingold

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.