unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* does Calendar understand DST rules for past years?
@ 2006-12-21 18:06 Richard Stallman
  2006-12-25  0:07 ` Glenn Morris
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Stallman @ 2006-12-21 18:06 UTC (permalink / raw)
  Cc: emacs-devel

I asked Glenn Morris to look at this, but since he is away for a couple
of weeks, I ask if anyone else can figure out what is right here.

man/calendar.el says

      The dates used by Emacs for holidays are based on @emph{current
    practice}, not historical fact.  Historically, for instance, the start
    of daylight savings time and even its existence have varied from year to
    year, but present United States law mandates that daylight savings time
    begins on the first Sunday in April.  When the daylight savings rules
    are set up for the United States, Emacs always uses the present
    definition, even though it is wrong for some prior years.

but the code seems to test calendar-dst-check-each-year-flag, which is
normally true.  I do not understand the code which that calls; it
needs a lot more comments.  Can you please add comments?  But I can't
see any sense in checking each year unless there is a facility for
recording the changes in rules between years.  In that case, the drawback
which is documented is not reallky true.

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

* Re: does Calendar understand DST rules for past years?
  2006-12-21 18:06 does Calendar understand DST rules for past years? Richard Stallman
@ 2006-12-25  0:07 ` Glenn Morris
  2006-12-25 16:53   ` Richard Stallman
  0 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2006-12-25  0:07 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman wrote:

> I asked Glenn Morris to look at this, but since he is away for a couple
> of weeks, I ask if anyone else can figure out what is right here.

I can at least reply to mail, even if I can't access CVS.

> man/calendar.el says
>
>       The dates used by Emacs for holidays are based on @emph{current
>     practice}, not historical fact.  Historically, for instance, the start
>     of daylight savings time and even its existence have varied from year to
>     year, but present United States law mandates that daylight savings time
>     begins on the first Sunday in April.  When the daylight savings rules
>     are set up for the United States, Emacs always uses the present
>     definition, even though it is wrong for some prior years.
>
> but the code seems to test calendar-dst-check-each-year-flag, which is
> normally true. 

The above manual text is out of date following my recent changes to
cal-dst (one month ago?). Above is how it used to work. Now if the
flag is true (as you say), it checks each year as needed whenever the
dst start/end dates for the year are first required. Then it caches
the results for that year and reuses them if needed.

If the flag is false, it works as the manual says.

> I do not understand the code which that calls; it needs a lot more
> comments. Can you please add comments?

Comments not critical, can add those on my return.

> But I can't see any sense in checking each year unless there is a
> facility for recording the changes in rules between years. 

Results for each year stored in the cache variable I added a month or
so ago.

> In that case, the drawback which is documented is not reallky true.

Not sure what drawback is. Above manual text is now incorrect when
flag is true. Should have updated the manual when I made my changes,
sorry.

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

* Re: does Calendar understand DST rules for past years?
  2006-12-25  0:07 ` Glenn Morris
@ 2006-12-25 16:53   ` Richard Stallman
  2006-12-25 23:29     ` Kevin Ryde
  2006-12-26 22:37     ` Glenn Morris
  0 siblings, 2 replies; 6+ messages in thread
From: Richard Stallman @ 2006-12-25 16:53 UTC (permalink / raw)
  Cc: emacs-devel

It seems that the best thing to do is simply delete this paragraph:

>       The dates used by Emacs for holidays are based on @emph{current
>     practice}, not historical fact.  Historically, for instance, the start
>     of daylight savings time and even its existence have varied from year to
>     year, but present United States law mandates that daylight savings time
>     begins on the first Sunday in April.  When the daylight savings rules
>     are set up for the United States, Emacs always uses the present
>     definition, even though it is wrong for some prior years.

(I see no need to document in the manual the possibility of
setting calendar-dst-check-each-year-flag to nil.)

Do you see any problem with that solution?
Any more that needs to be done?

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

* Re: does Calendar understand DST rules for past years?
  2006-12-25 16:53   ` Richard Stallman
@ 2006-12-25 23:29     ` Kevin Ryde
  2006-12-26 17:22       ` Richard Stallman
  2006-12-26 22:37     ` Glenn Morris
  1 sibling, 1 reply; 6+ messages in thread
From: Kevin Ryde @ 2006-12-25 23:29 UTC (permalink / raw)


Richard Stallman <rms@gnu.org> writes:
>
> It seems that the best thing to do is simply delete this paragraph:

The first sentence about the holidays is still true though.  Perhaps

	The dates used by Emacs for holidays are based on
	@emph{current practice}, not historical fact.  For example
	Veteran's Day began in 1919, but is shown in earlier years.

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

* Re: does Calendar understand DST rules for past years?
  2006-12-25 23:29     ` Kevin Ryde
@ 2006-12-26 17:22       ` Richard Stallman
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Stallman @ 2006-12-26 17:22 UTC (permalink / raw)
  Cc: emacs-devel

    The first sentence about the holidays is still true though.  Perhaps

	    The dates used by Emacs for holidays are based on
	    @emph{current practice}, not historical fact.  For example
	    Veteran's Day began in 1919, but is shown in earlier years.

Thanks.

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

* Re: does Calendar understand DST rules for past years?
  2006-12-25 16:53   ` Richard Stallman
  2006-12-25 23:29     ` Kevin Ryde
@ 2006-12-26 22:37     ` Glenn Morris
  1 sibling, 0 replies; 6+ messages in thread
From: Glenn Morris @ 2006-12-26 22:37 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman wrote:

> (I see no need to document in the manual the possibility of
> setting calendar-dst-check-each-year-flag to nil.)

OK. Then no, I don't think there is anything that needs to be said in
the manual about DST. Emacs should just Do The Right Thing (provided
the system clock gets it right). Don't think we need to explain in the
manual _how_ it does it.

> Do you see any problem with that solution?
> Any more that needs to be done?

Don't think so. Leaving in the comment about holidays being based on
current practice was good.

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

end of thread, other threads:[~2006-12-26 22:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-21 18:06 does Calendar understand DST rules for past years? Richard Stallman
2006-12-25  0:07 ` Glenn Morris
2006-12-25 16:53   ` Richard Stallman
2006-12-25 23:29     ` Kevin Ryde
2006-12-26 17:22       ` Richard Stallman
2006-12-26 22:37     ` Glenn Morris

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