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

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

calender/solar.el wrong sunset/sunrise report for polar regions


From: Lee Sau Dan
Subject: calender/solar.el wrong sunset/sunrise report for polar regions
Date: 05 Nov 2001 13:08:32 +0100

This bug report will be sent to the Free Software Foundation,
 not to your local site managers!!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

In GNU Emacs 20.7.1 (i386-redhat-linux-gnu, X toolkit)
 of Fri Mar 16 2001 on porky.devel.redhat.com
configured using `configure  --mandir=/usr/share/man --infodir=/usr/share/info 
--prefix=/usr --libexecdir=/usr/lib --sharedstatedir=/var --with-gcc --with-pop 
--with-x-toolkit i386-redhat-linux-gnu'

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

In calendar-mode,  key "S" triggers  function calendar-sunrise-sunset,
which reports the sunrise/sunset times according to the longtitude and
latitude settings  in some ELisp variables.   When I set  these to the
north-polar region, such as 10E, 80N, it say:

Nov 5, 2001: No sunrise, no sunset at 80N, 10E (24:00 hours daylight)

But this  is wrong.   November is winter  in the  northern hemisphere.
The parts of  the Artic region should have  00:00 hours daylight, i.e.
24:00 night.  A  corresponding error is observed when  the latitude is
set to the Antarctic region, such as 80S.

Sep 23, 2001: No sunrise, no sunset at 90S, 10W (0:00 hours daylight)

The longtitude setting seems to have no effects on this bug.


The following patch to the .el file would correct the problem.  I know
nothing in caldenars and astrology.   Could the author or someone else
verify it?


--- /usr/share/emacs/20.7/lisp/calendar/solar.el        Tue Dec 16 20:12:36 1997
+++ ./solar.el  Mon Nov  5 13:00:39 2001
@@ -316,8 +316,8 @@
     (if (not (and rise-time set-time))
         (if (or (and (> latitude 0) solar-spring-or-summer-season)
                 (and (< latitude 0) (not solar-spring-or-summer-season)))
-          (setq day-length 24)
-          (setq day-length 0))
+          (setq day-length 0)
+          (setq day-length 24))
         (setq day-length (- set-time rise-time)))
     (list (if rise-time (+ rise-time (/ calendar-time-zone 60.0)) nil)
           (if set-time (+ set-time (/ calendar-time-zone 60.0)) nil)



This bug is also observed with Emacs 2.1:

In GNU Emacs 21.1.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2001-10-23 on camaro
configured using `configure  --prefix=/tmp/e21'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: POSIX
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: t

Since the source file  solar.el remains basically unchanged from Emacs
20.7 to Emacs 21.1, the above patch is also applicable to the solar.el
code in Emacs 21.1.



Lee Sau Dan
.----------------------------------------------------------------------------.
| e-mail: danlee@informatik.uni-freiburg.de    http://www.csis.hku.hk/~sdlee |
`----------------------------------------------------------------------------'



reply via email to

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