* Re: emacs-25 ed1b2de: Fix NNTP NEWGROUPS off-by-a-few-hours bug
[not found] ` <E1aJOIj-0006HW-Cu@vcs.savannah.gnu.org>
@ 2016-01-14 9:47 ` Katsumi Yamaoka
2016-01-14 10:15 ` Andreas Schwab
0 siblings, 1 reply; 4+ messages in thread
From: Katsumi Yamaoka @ 2016-01-14 9:47 UTC (permalink / raw)
To: emacs-devel; +Cc: Paul Eggert
Hi,
On Wed, 13 Jan 2016 16:29:37 +0000, Paul Eggert <eggert@cs.ucla.edu> wrote:
> branch: emacs-25
> commit ed1b2de50ae87d8b2f9882be7576fbe5097df65b
> Author: Paul Eggert <eggert@cs.ucla.edu>
> Commit: Paul Eggert <eggert@cs.ucla.edu>
> Fix NNTP NEWGROUPS off-by-a-few-hours bug
> * lisp/gnus/nntp.el (nntp-request-newgroups): Format string
> in Universal Time, since we’re telling the server “GMT”.
> ---
> lisp/gnus/nntp.el | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
> index 0e10dfd..0006ef9 100644
> --- a/lisp/gnus/nntp.el
> +++ b/lisp/gnus/nntp.el
> @@ -1130,7 +1130,7 @@ command whose response triggered the error."
> (prog1
> (nntp-send-command
> "^\\.\r?\n" "NEWGROUPS"
> - (format-time-string "%y%m%d %H%M%S" time)
> + (format-time-string "%y%m%d %H%M%S" time t)
> "GMT")
> (nntp-decode-text))))))
Is this really a fix? In Japan (i.e., +0900) this doesn't seem
to pass the correct GMT date to a server:
(defun nntp-request-newgroups-test (date)
(let* ((time (date-to-time date))
(ls (- (cadr time) (nth 8 (decode-time time)))))
(cond ((< ls 0)
(setcar time (1- (car time)))
(setcar (cdr time) (+ ls 65536)))
((>= ls 65536)
(setcar time (1+ (car time)))
(setcar (cdr time) (- ls 65536)))
(t
(setcar (cdr time) ls)))
(format-time-string "%y%m%d %H%M%S" time t)))
(let ((date (message-make-date)))
(list date
(nntp-request-newgroups-test date)))
=> ("Thu, 14 Jan 2016 18:44:10 +0900" "160114 004410")
If removing the last `t', it returns:
=> ("Thu, 14 Jan 2016 18:44:18 +0900" "160114 094418")
See also `gnus-ask-server-for-new-groups'.
Regards,
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: emacs-25 ed1b2de: Fix NNTP NEWGROUPS off-by-a-few-hours bug
2016-01-14 9:47 ` emacs-25 ed1b2de: Fix NNTP NEWGROUPS off-by-a-few-hours bug Katsumi Yamaoka
@ 2016-01-14 10:15 ` Andreas Schwab
2016-01-14 11:26 ` Katsumi Yamaoka
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2016-01-14 10:15 UTC (permalink / raw)
To: Katsumi Yamaoka; +Cc: Paul Eggert, emacs-devel
Katsumi Yamaoka <yamaoka@jpl.org> writes:
> Is this really a fix? In Japan (i.e., +0900) this doesn't seem
> to pass the correct GMT date to a server:
>
> (defun nntp-request-newgroups-test (date)
> (let* ((time (date-to-time date))
> (ls (- (cadr time) (nth 8 (decode-time time)))))
> (cond ((< ls 0)
> (setcar time (1- (car time)))
> (setcar (cdr time) (+ ls 65536)))
> ((>= ls 65536)
> (setcar time (1+ (car time)))
> (setcar (cdr time) (- ls 65536)))
> (t
> (setcar (cdr time) ls)))
> (format-time-string "%y%m%d %H%M%S" time t)))
>
> (let ((date (message-make-date)))
> (list date
> (nntp-request-newgroups-test date)))
> => ("Thu, 14 Jan 2016 18:44:10 +0900" "160114 004410")
>
> If removing the last `t', it returns:
>
> => ("Thu, 14 Jan 2016 18:44:18 +0900" "160114 094418")
The manual timezone adjustment needs to be removed as well.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: emacs-25 ed1b2de: Fix NNTP NEWGROUPS off-by-a-few-hours bug
2016-01-14 10:15 ` Andreas Schwab
@ 2016-01-14 11:26 ` Katsumi Yamaoka
2016-01-14 16:08 ` Paul Eggert
0 siblings, 1 reply; 4+ messages in thread
From: Katsumi Yamaoka @ 2016-01-14 11:26 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Paul Eggert, emacs-devel
On Thu, 14 Jan 2016 11:15:13 +0100, Andreas Schwab wrote:
> The manual timezone adjustment needs to be removed as well.
Ah, thanks. Committed.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: emacs-25 ed1b2de: Fix NNTP NEWGROUPS off-by-a-few-hours bug
2016-01-14 11:26 ` Katsumi Yamaoka
@ 2016-01-14 16:08 ` Paul Eggert
0 siblings, 0 replies; 4+ messages in thread
From: Paul Eggert @ 2016-01-14 16:08 UTC (permalink / raw)
To: Katsumi Yamaoka, Andreas Schwab; +Cc: emacs-devel
On 01/14/2016 03:26 AM, Katsumi Yamaoka wrote:
> Ah, thanks. Committed.
Thanks for fixing my thinko; I should have noticed the nearby timezone
mumbo jumbo.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-14 16:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20160113162937.24105.71354@vcs.savannah.gnu.org>
[not found] ` <E1aJOIj-0006HW-Cu@vcs.savannah.gnu.org>
2016-01-14 9:47 ` emacs-25 ed1b2de: Fix NNTP NEWGROUPS off-by-a-few-hours bug Katsumi Yamaoka
2016-01-14 10:15 ` Andreas Schwab
2016-01-14 11:26 ` Katsumi Yamaoka
2016-01-14 16:08 ` Paul Eggert
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).