From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/61619 Path: news.gmane.org!not-for-mail From: Mark Plaksin Newsgroups: gmane.emacs.gnus.general,gmane.emacs.w3m Subject: Re: [emacs-w3m:08474] Re: nnrss should borrow nnshibmun's RSS date processor...or something Date: Mon, 02 Jan 2006 09:28:03 -0500 Message-ID: <8764p2g0wc.fsf@stone.tss.usg.edu> References: <87y82dokdt.fsf@stone.tss.usg.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1136212729 30244 80.91.229.2 (2 Jan 2006 14:38:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 2 Jan 2006 14:38:49 +0000 (UTC) Cc: emacs-w3m@namazu.org Original-X-From: ding-owner+m10151@lists.math.uh.edu Mon Jan 02 15:38:48 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EtQpc-0007jH-7l for ding-account@gmane.org; Mon, 02 Jan 2006 15:38:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1EtQpV-0006r9-00; Mon, 02 Jan 2006 08:38:33 -0600 Original-Received: from nas02.math.uh.edu ([129.7.128.40]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1EtQfr-0006r4-00 for ding@lists.math.uh.edu; Mon, 02 Jan 2006 08:28:35 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas02.math.uh.edu with esmtp (Exim 4.52) id 1EtQfk-0001T8-Tk for ding@lists.math.uh.edu; Mon, 02 Jan 2006 08:28:34 -0600 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1EtQfj-00047a-00 for ; Mon, 02 Jan 2006 15:28:27 +0100 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1EtQfX-0005RR-0O for ding@gnus.org; Mon, 02 Jan 2006 15:28:15 +0100 Original-Received: from stone.tss.usg.edu ([168.24.82.77]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Jan 2006 15:28:14 +0100 Original-Received: from happy by stone.tss.usg.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Jan 2006 15:28:14 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Lines: 99 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: stone.tss.usg.edu User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0 (gnu/linux) Cancel-Lock: sha1:xdswenZkFkmME7mK0M5JN5z3AhU= X-Spam-Score: -2.5 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:61619 gmane.emacs.w3m:5845 Archived-At: --=-=-= Katsumi Yamaoka writes: >>>>>> In [emacs-w3m : No.08473] Mark Plaksin wrote: > >> Some RSS feeds provide the date in ISO 8601 date format. sb-rss.el from >> nnshimbun converts from ISO 8601 to a format that Gnus can handle. nnrss >> does no conversion so Gnus ends up saying the date is the start of the Unix >> epoch. > > Gnus will be able to handle ISO 8601 date if we replace every > `parse-time-string' that Gnus uses with `date-to-time' which > uses timezone.el. However, it is effective only in Emacs 22, > because timezone.el distributed with Emacs 21 doesn't understand > ISO 8601 date. For instance: > > (timezone-parse-date "2005-12-22T13:14:03+09:00") > ;; Emacs 22.0.50 > => ["2005" "12" "22" "13:14:03" nil] > ;; Emacs 21.4 > => ["0" "0" "0" "0" nil] The relevant timezone.el differences between 21.4 and 22.0.50 are very small--just three regexps in timezone-parse-date. Perhaps Gnus should switch to date-to-time, include the newer timezone-parse-date and invoke it when running in Emacs < 22. Here's one way to include the newer timezone-parse-date but it looks ugly and the Elisp docs say "In general, well-designed Lisp programs should not use this feature [eval-after-load]." (if (< emacs-major-version 22) (eval-after-load "timezone" '(defun timezone-parse-date (date) ... ;; include definition from Emacs 22 ))) Is there a better way or a better plan? >> It would be nice if the conversion function from sb-rss.el were put into >> some library that nnrss could easily call. It's not clear to me where the >> best place for that would be. > > I think it should be done in nnrss.el since parse-time.el and > time-date.el belong to Emacs, not Gnus. If Gnus switches to date-to-time, then no change will be needed in nnrss, yes? >> For the moment, I hacked my copy of nnrss.el to call an un-shimbuned >> version of shimbun-rss-process-date. > > It seems to have to be used before using `message-make-date' in > the `nnrss-check-group' function. Could you present it? I copied shimbun-rss-process-date, changed the first line from this: (luna-define-method shimbun-rss-process-date ((shimbun shimbun-rss) date) to this: (defun map-shimbun-rss-date (date) and then patched nnrss.el with the attached patch. > BTW, why do you prefer RFC822 date rather than ISO 8601 date? > If it is for the bugfix, we should apply it to both the Gnus > trunk and the v5-10 branch. I don't know enough to prefer either format :) I was just trying to find a way to make nnrss show the correct date all the time. Making nnrss able to do this in both the trunk and v5-10 sounds good to me though I only use trunk. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=p Content-Description: nnrss.el patch --- nnrss.el.orig 2005-12-21 12:43:03.000000000 -0500 +++ nnrss.el 2005-12-21 22:44:04.000000000 -0500 @@ -599,9 +601,10 @@ (setq author (or (nnrss-node-text rss-ns 'author item) (nnrss-node-text dc-ns 'creator item) (nnrss-node-text dc-ns 'contributor item))) - (setq date (or (nnrss-node-text dc-ns 'date item) - (nnrss-node-text rss-ns 'pubDate item) - (message-make-date))) + (setq date (map-shimbun-rss-date + (or (nnrss-node-text dc-ns 'date item) + (nnrss-node-text rss-ns 'pubDate item) + (message-make-date)))) (setq comments (nnrss-node-text rss-ns 'comments item)) (when (setq enclosure (cadr (assq (intern (concat rss-ns "enclosure")) item))) (let ((url (cdr (assq 'url enclosure))) --=-=-=--