* bug#28476: 26.0.60; Gnus: broken timezone in citation line
@ 2017-09-17 5:14 Mike Kupfer
2017-09-17 14:25 ` Eli Zaretskii
2017-09-18 3:56 ` Paul Eggert
0 siblings, 2 replies; 7+ messages in thread
From: Mike Kupfer @ 2017-09-17 5:14 UTC (permalink / raw)
To: 28476
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))
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#28476: 26.0.60; Gnus: broken timezone in citation line
2017-09-17 5:14 bug#28476: 26.0.60; Gnus: broken timezone in citation line Mike Kupfer
@ 2017-09-17 14:25 ` Eli Zaretskii
2017-09-17 15:29 ` Mike Kupfer
2017-09-18 3:56 ` Paul Eggert
1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2017-09-17 14:25 UTC (permalink / raw)
To: Mike Kupfer; +Cc: 28476
> From: Mike Kupfer <mkupfer@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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#28476: 26.0.60; Gnus: broken timezone in citation line
2017-09-17 14:25 ` Eli Zaretskii
@ 2017-09-17 15:29 ` Mike Kupfer
2017-09-17 15:59 ` Andreas Schwab
2017-09-17 16:12 ` Eli Zaretskii
0 siblings, 2 replies; 7+ messages in thread
From: Mike Kupfer @ 2017-09-17 15:29 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 28476
Eli Zaretskii wrote:
> > From: Mike Kupfer <mkupfer@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
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#28476: 26.0.60; Gnus: broken timezone in citation line
2017-09-17 15:29 ` Mike Kupfer
@ 2017-09-17 15:59 ` Andreas Schwab
2017-09-17 16:12 ` Eli Zaretskii
1 sibling, 0 replies; 7+ messages in thread
From: Andreas Schwab @ 2017-09-17 15:59 UTC (permalink / raw)
To: Mike Kupfer; +Cc: 28476
On Sep 17 2017, Mike Kupfer <mkupfer@alum.berkeley.edu> wrote:
> Eli Zaretskii wrote:
>
>> > From: Mike Kupfer <mkupfer@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@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#28476: 26.0.60; Gnus: broken timezone in citation line
2017-09-17 15:29 ` Mike Kupfer
2017-09-17 15:59 ` Andreas Schwab
@ 2017-09-17 16:12 ` Eli Zaretskii
1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2017-09-17 16:12 UTC (permalink / raw)
To: Mike Kupfer; +Cc: 28476
> From: Mike Kupfer <mkupfer@alum.berkeley.edu>
> cc: 28476@debbugs.gnu.org
> Date: Sun, 17 Sep 2017 08:29:46 -0700
>
> Eli Zaretskii wrote:
>
> > > From: Mike Kupfer <mkupfer@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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#28476: 26.0.60; Gnus: broken timezone in citation line
2017-09-17 5:14 bug#28476: 26.0.60; Gnus: broken timezone in citation line Mike Kupfer
2017-09-17 14:25 ` Eli Zaretskii
@ 2017-09-18 3:56 ` Paul Eggert
2017-09-18 15:37 ` Mike Kupfer
1 sibling, 1 reply; 7+ messages in thread
From: Paul Eggert @ 2017-09-18 3:56 UTC (permalink / raw)
To: Mike Kupfer; +Cc: 28476
[-- Attachment #1: Type: text/plain, Size: 1193 bytes --]
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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-message-citation-line-format-Z-is-now-tz-name.patch --]
[-- Type: text/x-patch; name="0001-message-citation-line-format-Z-is-now-tz-name.patch", Size: 1519 bytes --]
From 679e05eeb97eae5a32fc67f4673b019c873ebcca Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 17 Sep 2017 17:46:18 -0700
Subject: [PATCH 1/2] message-citation-line-format %Z is now tz name
* etc/NEWS:
* lisp/gnus/message.el (message-citation-line-format):
Fix doc to match new behavior (Bug#28476).
---
etc/NEWS | 6 ++++++
lisp/gnus/message.el | 1 -
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/etc/NEWS b/etc/NEWS
index a042ce9..5aa57a7 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -701,6 +701,12 @@ method is an NNTP select method.
*** A new command for sorting articles by readedness marks has been
added: 'C-c C-s C-m C-m'.
++++
+
+*** In message-citation-line-format the %Z format is now the time zone name
+instead of the numeric form. The %z format continues to be the
+numeric form. The new behavior is compatible with format-time-string.
+
** Ibuffer
---
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 690dd28..a9e66ce 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -991,7 +991,6 @@ message-citation-line-format
%F The first name if present, e.g.: \"John\", else fall
back to the mail address.
%L The last name if present, e.g.: \"Doe\".
- %Z, %z The time zone in the numeric form, e.g.:\"+0000\".
All other format specifiers are passed to `format-time-string'
which is called using the date from the article your replying to, but
--
2.7.4
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Fix-format-time-string-Z-bug-with-negative-tz.patch --]
[-- Type: text/x-patch; name="0002-Fix-format-time-string-Z-bug-with-negative-tz.patch", Size: 1760 bytes --]
From 74fbe646c7d735343628979f6e9bb4543f01fe52 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 17 Sep 2017 20:38:12 -0700
Subject: [PATCH 2/2] Fix format-time-string %Z bug with negative tz
* src/editfns.c (tzlookup): Fix sign error in %Z when a purely
numeric zone is negative (Bug#28746).
* test/src/editfns-tests.el (format-time-string-with-zone):
Add test for this bug.
---
src/editfns.c | 3 ++-
test/src/editfns-tests.el | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/editfns.c b/src/editfns.c
index b03eb94..2f8b075 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -187,7 +187,8 @@ tzlookup (Lisp_Object zone, bool settz)
if (sec != 0)
prec += 2, numzone = 100 * numzone + sec;
}
- sprintf (tzbuf, tzbuf_format, prec, numzone,
+ sprintf (tzbuf, tzbuf_format, prec,
+ XINT (zone) < 0 ? -numzone : numzone,
&"-"[XINT (zone) < 0], hour, min, sec);
zone_string = tzbuf;
}
diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el
index 1c3fde8..f910afa 100644
--- a/test/src/editfns-tests.el
+++ b/test/src/editfns-tests.el
@@ -166,6 +166,10 @@ transpose-test-get-byte-positions
(should (string-equal
(format-time-string format look '(-28800 "PST"))
"1972-06-30 15:59:59.999 -0800 (PST)"))
+ ;; Negative UTC offset, as a Lisp integer.
+ (should (string-equal
+ (format-time-string format look -28800)
+ "1972-06-30 15:59:59.999 -0800 (-08)"))
;; Positive UTC offset that is not an hour multiple, as a string.
(should (string-equal
(format-time-string format look "IST-5:30")
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* bug#28476: 26.0.60; Gnus: broken timezone in citation line
2017-09-18 3:56 ` Paul Eggert
@ 2017-09-18 15:37 ` Mike Kupfer
0 siblings, 0 replies; 7+ messages in thread
From: Mike Kupfer @ 2017-09-18 15:37 UTC (permalink / raw)
To: Paul Eggert; +Cc: 28476
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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-09-18 15:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-17 5:14 bug#28476: 26.0.60; Gnus: broken timezone in citation line Mike Kupfer
2017-09-17 14:25 ` Eli Zaretskii
2017-09-17 15:29 ` Mike Kupfer
2017-09-17 15:59 ` Andreas Schwab
2017-09-17 16:12 ` Eli Zaretskii
2017-09-18 3:56 ` Paul Eggert
2017-09-18 15:37 ` Mike Kupfer
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).