emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: Holidays in fancy diary


From: Matthew Mundell
Subject: Re: Holidays in fancy diary
Date: 04 Feb 2004 20:39:11 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Ed Reingold <address@hidden> writes:

> > 
> > With the CVS Emacs, any holidays are missing from a fancily displayed
> > diary.
> 
> Did you overwrite the default value of holidays-in-diary-buffer (it should be 
> t)?

No, it is t.

> 
> > This seems to be because changes to increment-calendar-month have
> > introduced a possible nil return, which causes fancy-diary-display to
> > skip the holiday processing.  A simple patch follows.
> 
> Huh? increment-calendar-month is a macro, the last line of which does a setq
> which is never nil (did somebody mess that up?).  I don't think the code needs
> to altered.

Changed here:

revision 1.152
date: 2003/10/01 20:48:17;  author: gm;  state: Exp;  lines: +59 -23
(increment-calendar-month, calendar-leap-year-p)
(calendar-absolute-from-gregorian, generate-calendar)
(calendar-read-date, calendar-interval)
(calendar-day-of-week): Handle years BC.
(generate-calendar-month, calendar-gregorian-from-absolute): Doc fix.

to

(defmacro increment-calendar-month (mon yr n)
  "Increment the variables MON and YR by N months.
Forward if N is positive or backward if N is negative.
A negative YR is interpreted as BC; -1 being 1 BC, and so on."
  `(let (macro-y)
     (if (< ,yr 0) (setq ,yr (1+ ,yr))) ; -1 BC -> 0 AD, etc
     (setq macro-y (+ (* ,yr 12) ,mon -1 ,n)
           ,mon (1+ (mod macro-y 12))
           ,yr (/ macro-y 12))
     (and (< macro-y 0) (> ,mon 1) (setq ,yr (1- ,yr)))
     (if (< ,yr 1) (setq ,yr (1- ,yr))))) ; 0 AD -> -1 BC, etc




reply via email to

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