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

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

Re: Calendar hack: Displaying ISO weeks, update for emacs 22, the real u


From: Edward M. Reingold
Subject: Re: Calendar hack: Displaying ISO weeks, update for emacs 22, the real update
Date: 07 Dec 2006 11:48:35 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

>>>>> "AH" == Alf-Ivar Holm <address@hidden> writes:

    AH> (defun local-holiday-easter-etc () "List of dates related to Easter in
    AH> Norway, as visible in calendar window."  (if (and (> displayed-month
    AH> 5)) nil;; Ash Wednesday, Good Friday, and Easter are not visible.

This a good example of why the wider window can cause erroneous results.
The test

   (if (> displayed-month 5)

checks if the center of the 3 month window is beyond May, in which case (as
the comment from my code says!) Ash Wednesday, Good Friday, and Easter cannot
be visibible because they occur in Feb/Mar/Apr.  But if the window is 5 months
wide, they could be visible and the command to list or highlight all holidays
will miss them.

Almost all of the non-trivial holidays/diary entries would suffer in the same
way, so rewriting the code properly to display a wider window means modifying
almost every holiday/diary function in some (usually non-obvious) way.
-- 

Professor Edward M. Reingold                Email: address@hidden
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]