* Re: TZ ignored by (display-time)
@ 2008-03-14 17:09 Jason Rumney
2008-03-14 21:26 ` James Cloos
2008-03-14 23:54 ` Jason Rumney
0 siblings, 2 replies; 3+ messages in thread
From: Jason Rumney @ 2008-03-14 17:09 UTC (permalink / raw)
To: 14; +Cc: emacs-pretest-bug@gnu.org
> (display-time) fails to take the contents of TZ into effect when
> formatting the time string.
The problem seems to be caused by the new display-time-world
functionality, so this bug shouldn't affect Emacs 22.
When time.el is loaded, the following code clobbers the internal
timezone setting:
(defcustom display-time-world-list
;; Determine if zoneinfo style timezones are supported by testing that
;; America/New York and Europe/London return different timezones.
(let (gmt nyt)
(set-time-zone-rule "America/New York")
(setq nyt (format-time-string "%z"))
(set-time-zone-rule "Europe/London")
(setq gmt (format-time-string "%z"))
(set-time-zone-rule nil)
According to the documentation for set-time-zone-rule, it should set the
timezone back to the local timezone when the argument is nil. But it
doesn't seem to take note of the TZ environment variable when it does this.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: TZ ignored by (display-time)
2008-03-14 17:09 TZ ignored by (display-time) Jason Rumney
@ 2008-03-14 21:26 ` James Cloos
2008-03-14 23:54 ` Jason Rumney
1 sibling, 0 replies; 3+ messages in thread
From: James Cloos @ 2008-03-14 21:26 UTC (permalink / raw)
To: Jason Rumney; +Cc: 14, emacs-pretest-bug@gnu.org
>>>>> "Jason" == Jason Rumney <jasonr@f2s.com> writes:
JimC> (display-time) fails to take the contents of TZ into effect when
JimC> formatting the time string.
Jason> The problem seems to be caused by the new display-time-world
Jason> functionality, so this bug shouldn't affect Emacs 22.
Jason> According to the documentation for set-time-zone-rule, it should
Jason> set the timezone back to the local timezone when the argument is
Jason> nil. But it doesn't seem to take note of the TZ environment
Jason> variable when it does this.
Cool. Thanks for tracking it down.
Running (set-time-zone-rule (getenv "TZ")) does indeed cause
the (display-time) output to match the timezone specified by TZ.
I looked at the set-time-zone-rule DEFUN as well as set_time_zone_rule()
in src/editfns.c but am not sure how best to fix this....
-JimC
--
James Cloos <cloos@jhcloos.com> OpenPGP: 1024D/ED7DAEA6
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: TZ ignored by (display-time)
2008-03-14 17:09 TZ ignored by (display-time) Jason Rumney
2008-03-14 21:26 ` James Cloos
@ 2008-03-14 23:54 ` Jason Rumney
1 sibling, 0 replies; 3+ messages in thread
From: Jason Rumney @ 2008-03-14 23:54 UTC (permalink / raw)
To: 14-done; +Cc: emacs-pretest-bug@gnu.org
Jason Rumney wrote:
> According to the documentation for set-time-zone-rule, it should set
> the timezone back to the local timezone when the argument is nil. But
> it doesn't seem to take note of the TZ environment variable when it
> does this.
I've now changed the trunk so that the initial value of TZ is saved so
it can be restored in the above case.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-03-14 23:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-14 17:09 TZ ignored by (display-time) Jason Rumney
2008-03-14 21:26 ` James Cloos
2008-03-14 23:54 ` Jason Rumney
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).