GNU bug report logs - #28476
26.0.60; Gnus: broken timezone in citation line

Previous Next

Package: emacs;

Reported by: Mike Kupfer <mkupfer <at> alum.berkeley.edu>

Date: Sun, 17 Sep 2017 05:15:02 UTC

Severity: normal

Found in version 26.0.60

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28476 in the body.
You can then email your comments to 28476 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#28476; Package emacs. (Sun, 17 Sep 2017 05:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mike Kupfer <mkupfer <at> alum.berkeley.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 17 Sep 2017 05:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mike Kupfer <mkupfer <at> alum.berkeley.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.60; Gnus: broken timezone in citation line
Date: Sat, 16 Sep 2017 22:14:18 -0700
I have message-citation-line-format set to

  "On %e %B %Y %R %Z, %N wrote:\n"

When replying to a message whose date field is displayed as

  Date: Sat, 16 Sep 2017 17:18:30 -0700

the citation comes out as

  On 16 September 2017 17:18 +07, Mike Kupfer wrote:

I expect

  On 16 September 2017 17:18 -0700, Mike Kupfer wrote:

which is what Emacs 25.3 gives me.

The message I'm replying to is on an IMAP server, if that makes any
difference.

In GNU Emacs 26.0.60 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars)
 of 2017-09-16 built on alto
Repository revision: 1d599df5e0fbbc52e8592c0aff1d23e978c29b67
Windowing system distributor 'The X.Org Foundation', version 11.0.11604000
System Description:	Debian GNU/Linux 8.9 (jessie)

Recent messages:
Opening nndoc server on /media/kupfer/KBLUE/ToFile/upload-tofile-home...done
Opening nndoc server on /home/kupfer/Desktop/upload-action...done
Contacting host: [redacted]
Contacting host: [redacted]
Checking new news...done
nnimap read 0k from [redacted]
Processing kill file /home/kupfer/News/KILL...done
No more unseen articles
nnimap read 0k from [redacted]
Mark set [12 times]

Configured using:
 'configure --prefix=/usr/new'

Configured features:
XPM JPEG TIFF GIF PNG SOUND NOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB
TOOLKIT_SCROLL_BARS LUCID X11

Important settings:
  value of $LC_TIME: C
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix

Major mode: Message

Minor modes in effect:
  gnus-message-citation-mode: t
  mml-mode: t
  shell-dirtrack-mode: t
  delete-selection-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  auto-fill-function: message-do-auto-fill
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow mh-mime mh-identity mh-tool-bar mh-letter mh-show goto-addr
mh-xface mh-utils mh-comp mh-scan mh-gnus mh-e mh-compat mh-buffers
mh-loaddefs emacsbug cl-print help-fns radix-tree vc-hg nnir sort
gnus-cite mail-extr gnus-async gnus-bcklg gnus-kill gnus-dup gnus-ml
disp-table mm-archive url-http url-gw url-cache url-auth url-handlers
nnrss xml mm-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util url-parse url-vars nndoc
nndraft nnmh utf-7 rfc2104 cl-extra help-mode network-stream nsm
starttls gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg
gnus-art mm-uu mml2015 mm-view mml-smime smime dig mailcap nntp
gnus-cache gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap
nnmail mail-source tls gnutls utf7 netrc nnoo parse-time gnus-spec
gnus-int gnus-range gnus-win gnus nnheader mdk-mail smtpmail auth-source
cl-seq eieio eieio-core cl-macs eieio-loaddefs sendmail message subr-x
puny seq byte-opt gv bytecomp byte-compile cconv dired dired-loaddefs
format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev
mail-utils gmm-utils mailheader misearch multi-isearch crm thingatpt
cus-edit cus-start cus-load wid-edit elec-pair warnings server noutline
outline easy-mmode cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs shell pcomplete comint ansi-color
ring xcscope easymenu advice delsel vc cl-loaddefs cl-lib vc-dispatcher
timeclock mdk-hacks time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote inotify dynamic-setting font-render-setting x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 505215 21681)
 (symbols 48 244263 6)
 (miscs 40 586 680)
 (strings 32 198558 4337)
 (string-bytes 1 6115645)
 (vectors 16 33085)
 (vector-slots 8 887601 27067)
 (floats 8 270 670)
 (intervals 56 1582 28)
 (buffers 992 43)
 (heap 1024 75376 11221))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28476; Package emacs. (Sun, 17 Sep 2017 14:26:02 GMT) Full text and rfc822 format available.

Message #8 received at 28476 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mike Kupfer <mkupfer <at> alum.berkeley.edu>
Cc: 28476 <at> debbugs.gnu.org
Subject: Re: bug#28476: 26.0.60; Gnus: broken timezone in citation line
Date: Sun, 17 Sep 2017 17:25:27 +0300
> From: Mike Kupfer <mkupfer <at> alum.berkeley.edu>
> Date: Sat, 16 Sep 2017 22:14:18 -0700
> 
> I have message-citation-line-format set to
> 
>   "On %e %B %Y %R %Z, %N wrote:\n"
> 
> When replying to a message whose date field is displayed as
> 
>   Date: Sat, 16 Sep 2017 17:18:30 -0700
> 
> the citation comes out as
> 
>   On 16 September 2017 17:18 +07, Mike Kupfer wrote:
> 
> I expect
> 
>   On 16 September 2017 17:18 -0700, Mike Kupfer wrote:
> 
> which is what Emacs 25.3 gives me.

I think you should use %z, not %Z.  %Z gives the time-zone _name_, a
string, whereas %z gives its numeric form.  FWIW, I get the time-zone
name from %Z in both Emacs 25.3 and the current emacs-26 branch.  Not
sure why you get different results in 25.3.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28476; Package emacs. (Sun, 17 Sep 2017 15:30:02 GMT) Full text and rfc822 format available.

Message #11 received at 28476 <at> debbugs.gnu.org (full text, mbox):

From: Mike Kupfer <mkupfer <at> alum.berkeley.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 28476 <at> debbugs.gnu.org
Subject: Re: bug#28476: 26.0.60; Gnus: broken timezone in citation line
Date: Sun, 17 Sep 2017 08:29:46 -0700
Eli Zaretskii wrote:

> > From: Mike Kupfer <mkupfer <at> alum.berkeley.edu>

> > I have message-citation-line-format set to
> > 
> >   "On %e %B %Y %R %Z, %N wrote:\n"
[...]
> I think you should use %z, not %Z.  %Z gives the time-zone _name_, a
> string, whereas %z gives its numeric form.  FWIW, I get the time-zone
> name from %Z in both Emacs 25.3 and the current emacs-26 branch.  Not
> sure why you get different results in 25.3.

How are you testing this?  The docstring for
message-citation-line-format says that %z and %Z are special-cased, with
both producing the time zone in numeric form.

Maybe there was a deliberate change in Gnus to distinguish %z from %Z
for Emacs 26?  If so, there are still 2 issues: the documentation is
wrong, and I'd expect %Z to produce "PDT", not "+07".

(format-time-string "%Z")
=> "PDT"

mike




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28476; Package emacs. (Sun, 17 Sep 2017 16:00:02 GMT) Full text and rfc822 format available.

Message #14 received at 28476 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Mike Kupfer <mkupfer <at> alum.berkeley.edu>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 28476 <at> debbugs.gnu.org
Subject: Re: bug#28476: 26.0.60; Gnus: broken timezone in citation line
Date: Sun, 17 Sep 2017 17:59:47 +0200
On Sep 17 2017, Mike Kupfer <mkupfer <at> alum.berkeley.edu> wrote:

> Eli Zaretskii wrote:
>
>> > From: Mike Kupfer <mkupfer <at> alum.berkeley.edu>
>
>> > I have message-citation-line-format set to
>> > 
>> >   "On %e %B %Y %R %Z, %N wrote:\n"
> [...]
>> I think you should use %z, not %Z.  %Z gives the time-zone _name_, a
>> string, whereas %z gives its numeric form.  FWIW, I get the time-zone
>> name from %Z in both Emacs 25.3 and the current emacs-26 branch.  Not
>> sure why you get different results in 25.3.
>
> How are you testing this?  The docstring for
> message-citation-line-format says that %z and %Z are special-cased, with
> both producing the time zone in numeric form.

That was broken by commit 7d835d8e79.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28476; Package emacs. (Sun, 17 Sep 2017 16:13:02 GMT) Full text and rfc822 format available.

Message #17 received at 28476 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mike Kupfer <mkupfer <at> alum.berkeley.edu>
Cc: 28476 <at> debbugs.gnu.org
Subject: Re: bug#28476: 26.0.60; Gnus: broken timezone in citation line
Date: Sun, 17 Sep 2017 19:12:01 +0300
> From: Mike Kupfer <mkupfer <at> alum.berkeley.edu>
> cc: 28476 <at> debbugs.gnu.org
> Date: Sun, 17 Sep 2017 08:29:46 -0700
> 
> Eli Zaretskii wrote:
> 
> > > From: Mike Kupfer <mkupfer <at> alum.berkeley.edu>
> 
> > > I have message-citation-line-format set to
> > > 
> > >   "On %e %B %Y %R %Z, %N wrote:\n"
> [...]
> > I think you should use %z, not %Z.  %Z gives the time-zone _name_, a
> > string, whereas %z gives its numeric form.  FWIW, I get the time-zone
> > name from %Z in both Emacs 25.3 and the current emacs-26 branch.  Not
> > sure why you get different results in 25.3.
> 
> How are you testing this?  The docstring for
> message-citation-line-format says that %z and %Z are special-cased, with
> both producing the time zone in numeric form.

Sorry, I assumed without checking that the format was handed to
format-time-string.

Anyway, I think Andreas found the reason.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28476; Package emacs. (Mon, 18 Sep 2017 03:59:02 GMT) Full text and rfc822 format available.

Message #20 received at 28476 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Mike Kupfer <mkupfer <at> alum.berkeley.edu>
Cc: 28476 <at> debbugs.gnu.org
Subject: 26.0.60; Gnus: broken timezone in citation line
Date: Sun, 17 Sep 2017 20:56:05 -0700
[Message part 1 (text/plain, inline)]
Thanks for the bug report.

I see two issues here. First, the change in message-citation-line-format's 
treatment of %Z was deliberate. The new treatment (unlike the old one) is 
consistent with format-time-string and this consistency simplifies the 
documentation and code. If backward-compatibility is a significant hassle we can 
re-complicate Emacs, but I'm hoping that users can change %Z to %z in their 
settings and move on. In the meantime I installed the first attached patch into 
the emacs-26 branch so that the documentation matches the new behavior. (Sorry, 
I missed that part of the documentation before.)

Second, (format-time-string "%Z" nil -25200) returns "+07" where it should 
return "-07" since -25200 denotes 7 hours west of UTC. This is due to a blunder 
in my commit fdb1ba144ca61185e6457f092f38f59dd9bbe6a0 dated 2016-04-12 09:19:11 
-0700: the %Z code gets the sign wrong on purely-numeric time zones west of 
Greenwich. To fix this bug I installed the second attached patch into the 
emacs-26 branch. This fix should cause your example to come out as:

  On 16 September 2017 17:18 -07, Mike Kupfer wrote:

which at least gets the sign right.
[0001-message-citation-line-format-Z-is-now-tz-name.patch (text/x-patch, attachment)]
[0002-Fix-format-time-string-Z-bug-with-negative-tz.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28476; Package emacs. (Mon, 18 Sep 2017 15:38:01 GMT) Full text and rfc822 format available.

Message #23 received at 28476 <at> debbugs.gnu.org (full text, mbox):

From: Mike Kupfer <mkupfer <at> alum.berkeley.edu>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 28476 <at> debbugs.gnu.org
Subject: Re: 26.0.60; Gnus: broken timezone in citation line
Date: Mon, 18 Sep 2017 08:37:12 -0700
Hi Paul, thanks for your response.  I'm fine with this sort of
consistency/simplification change.  The doc changes look good to me.

And after thinking about it some more, I realized that Emacs doesn't
really have enough context to ensure that "PDT" is correct in my
example, so I'm good with "-07" as the name.

Feel free to close this bug.

regards,
mike




bug closed, send any further explanations to 28476 <at> debbugs.gnu.org and Mike Kupfer <mkupfer <at> alum.berkeley.edu> Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Mon, 18 Sep 2017 15:59:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 17 Oct 2017 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 244 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.