From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/36955 Path: main.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: `ask-server' does not work in the Far East Date: Thu, 19 Jul 2001 12:08:35 +0900 Organization: Emacsen advocacy group Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035172453 11323 80.91.224.250 (21 Oct 2002 03:54:13 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:54:13 +0000 (UTC) Return-Path: Return-Path: Original-Received: (qmail 1256 invoked from network); 20 Jul 2001 06:29:36 -0000 Original-Received: from quimby.gnus.org (195.204.10.139) by gnus.org with SMTP; 20 Jul 2001 06:29:36 -0000 Original-Received: (from news@localhost) by quimby.gnus.org (8.9.3/8.9.3) id FAA15652 for ding@gnus.org; Thu, 19 Jul 2001 05:08:47 +0200 (CEST) Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-NNTP-Posting-Host: 207.228.244.9 Original-X-Trace: quimby.gnus.org 995512127 2729 207.228.244.9 (19 Jul 2001 03:08:47 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 19 Jul 2001 03:08:47 GMT X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.104 Original-Lines: 121 Xref: main.gmane.org gmane.emacs.gnus.general:36955 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:36955 --=-=-= Hi, `ask-server' the default value of `gnus-check-new-newsgroups' is unfair to people who live in east of Greenwich. Sorry, it is a joke, but there is a real problem. I live in Japan, the value of timezone is +0900. Gnus keeps the last time that Gnus asked server for the new newsgroups in the variable `gnus-newsrc-last-checked-date'. The value is made by the function `current-time-string' which does not have a zone info. For example, if .newsrc.eld has the following line: (setq gnus-newsrc-last-checked-date '"Wed Jul 18 22:12:34 2001") Early in the next morning, Gnus will ask server for the new newsgroups using the following NNTP command: NEWGROUPS 010719 071234 The reason why the value is not "010718 221234" is: (format-time-string "%y%m%d %H%M%S" (date-to-time "Wed Jul 18 22:12:34 2001")) => "010719 071234" Because of this, I could not see the new newsgroups which were created at midnight. Thus the value of `gnus-newsrc-last-checked-date' should have a zone info. Furthermore, NEWGROUPS command should be expressed in UTC, because not all the servers are running in the same time zone with the clients. 2001-07-19 Katsumi Yamaoka * nntp.el (nntp-request-newgroups): Use UTC date for NEWGROUPS command. * gnus-start.el (gnus-find-new-newsgroups): Use `message-make-date' instead of `current-time-string'. (gnus-ask-server-for-new-groups): Ditto. (gnus-check-first-time-used): Ditto. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=patch-ask-server --- gnus-start.el~ Tue Jul 3 21:50:55 2001 +++ gnus-start.el Thu Jul 19 01:20:38 2001 @@ -1018,7 +1018,7 @@ (gnus-message 5 "Looking for new newsgroups...") (unless gnus-have-read-active-file (gnus-read-active-file)) - (setq gnus-newsrc-last-checked-date (current-time-string)) + (setq gnus-newsrc-last-checked-date (message-make-date)) (unless gnus-killed-hashtb (gnus-make-hashtable-from-killed)) ;; Go though every newsgroup in `gnus-active-hashtb' and compare @@ -1083,7 +1083,8 @@ (and regs (cdar regs)))))) (defun gnus-ask-server-for-new-groups () - (let* ((date (or gnus-newsrc-last-checked-date (current-time-string))) + (let* ((new-date (message-make-date)) + (date (or gnus-newsrc-last-checked-date new-date)) (methods (cons gnus-select-method (nconc (when (gnus-archive-server-wanted-p) @@ -1093,7 +1094,6 @@ gnus-check-new-newsgroups) gnus-secondary-select-methods)))) (groups 0) - (new-date (current-time-string)) group new-newsgroups got-new method hashtb gnus-override-subscribe-method) (unless gnus-killed-hashtb @@ -1169,7 +1169,7 @@ (unless (gnus-read-active-file-p) (let ((gnus-read-active-file t)) (gnus-read-active-file))) - (setq gnus-newsrc-last-checked-date (current-time-string)) + (setq gnus-newsrc-last-checked-date (message-make-date)) ;; Subscribe to the default newsgroups. (let ((groups (or gnus-default-subscribed-newsgroups gnus-backup-default-subscribed-newsgroups)) --- nntp.el~ Mon Jul 9 21:51:56 2001 +++ nntp.el Thu Jul 19 01:20:38 2001 @@ -817,11 +817,22 @@ (nntp-possibly-change-group nil server) (save-excursion (set-buffer nntp-server-buffer) - (prog1 - (nntp-send-command - "^\\.\r?\n" "NEWGROUPS" - (format-time-string "%y%m%d %H%M%S" (date-to-time date))) - (nntp-decode-text)))) + (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))) + (prog1 + (nntp-send-command + "^\\.\r?\n" "NEWGROUPS" + (format-time-string "%y%m%d %H%M%S" time) + "GMT") + (nntp-decode-text))))) (deffoo nntp-request-post (&optional server) (nntp-possibly-change-group nil server) --=-=-=--