From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Sebastian Luque Newsgroups: gmane.emacs.help Subject: Re: date discrepancies Date: Thu, 02 Sep 2004 12:17:00 -0400 Organization: Memorial University of Newfoundland Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <200409021217.00789.sluque@mun.ca> References: <87k6vdjgnv.fsf@thalassa.informatimago.com> <200409021042.03878.sluque@mun.ca> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1094145694 15327 80.91.224.253 (2 Sep 2004 17:21:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 2 Sep 2004 17:21:34 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 02 19:21:22 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C2vH0-00045d-00 for ; Thu, 02 Sep 2004 19:21:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C2vLy-0003P1-Nn for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Sep 2004 13:26:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C2vLn-0003MC-N2 for help-gnu-emacs@gnu.org; Thu, 02 Sep 2004 13:26:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C2vLn-0003LV-0q for help-gnu-emacs@gnu.org; Thu, 02 Sep 2004 13:26:19 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C2vLm-0003LQ-SX for help-gnu-emacs@gnu.org; Thu, 02 Sep 2004 13:26:18 -0400 Original-Received: from [64.59.134.9] (helo=pd7mo1no.prod.shaw.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C2vGe-0003jg-FJ for help-gnu-emacs@gnu.org; Thu, 02 Sep 2004 13:21:00 -0400 Original-Received: from pd6mr2no.prod.shaw.ca (pd6mr2no-qfe2.prod.shaw.ca [10.0.144.189]) by l-daemon (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0I3F00D9NBWO9JF0@l-daemon> for help-gnu-emacs@gnu.org; Thu, 02 Sep 2004 11:14:48 -0600 (MDT) Original-Received: from pn7ml2no.prod.shaw.ca ([10.0.149.111]) by pd6mr2no.prod.shaw.ca (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0I3F001UJBWO0GA0@pd6mr2no.prod.shaw.ca> for help-gnu-emacs@gnu.org; Thu, 02 Sep 2004 11:14:48 -0600 (MDT) Original-Received: from s0106000ae61de208.wp.shawcable.net (S0106000ae61de208.wp.shawcable.net [24.77.43.235]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.18 (built Jul 28 2003)) with ESMTP id <0I3F0017PBWNRX@l-daemon> for help-gnu-emacs@gnu.org; Thu, 02 Sep 2004 11:14:48 -0600 (MDT) In-reply-to: <200409021042.03878.sluque@mun.ca> Original-To: help-gnu-emacs@gnu.org Content-Disposition: inline User-Agent: KMail/1.6.2 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:20418 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20418 I have just found out that launching emacs from a shell (typing either 'emacs' or 'emacs21') and then typing 'M-! date' gives the correct time and time zone. However, launching emacs from the K-menu in KDE, which is set to /usr/bin/emacs21, gives the incorrect time zone. So the difference is not, in fact, linked to the various emacs binaries, but to the environment in place when launching the application from k-menu, as opposed to a shell. Sebastian On Thu, 2 September 2004 10:42 -0500, Sebastian Luque wrote: > Thanks Pascal, I'm a bit confused about which environment Emacs is getting > to run shell commands. All date and time variables are correct in shell. > I'm using a Debian box and checking the binaries for emacs, there are three > of them: emacs, emacs21, and emacs21-x. I've always been using emacs21, > which gives the wrong time. But if I run emacs, then it gives the correct > time variables. Why is there a difference? > > On Thu, 2 September 2004 03:04 -0500, Pascal Bourguignon wrote: > > To see the time zone in emacs, type in *scratch*: (getenv "TZ") C-u C-x > > C-e To see it in shell, type: echo $TZ > > Under emacs21, the result was "nil", and in shell, I get > "America/Winnipeg", which is correct. > > > Try it in a shell on xterm and in a shell on emacs: M-x shell RET echo > > $TZ RET > > This emacs command gives the correct result, using emacs21. However, in the > same session, M-! echo $TZ, gives no output. I'm very confused; M-x shell > and M-! seem to be getting different environments. > > > You can correct it either by modifying the environment used by the > > program that launches emacs, or from emacs using: > > > > (setenv "TZ" "CEST") C-x C-e > > > > or inserting: (setenv "TZ" "CEST") > > in your ~/.emacs > > Because my time has been already correctly set, changing it like this > messes it up, and now the time is incorrect both in shell and in emacs M-! > date, although the time zone shows ok. Very strange. > > There is a difference between emacs and emacs21 that I'm not understanding. > Any comments would be greatly appreciated. > > Cheers, > Sebastian > > > _______________________________________________ > Help-gnu-emacs mailing list > Help-gnu-emacs@gnu.org > http://lists.gnu.org/mailman/listinfo/help-gnu-emacs