From 9d3ce6d1b0c3e886c92f0c2f17b640e1b1a893e6 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Tue, 1 May 2001 17:09:48 +0000 Subject: [PATCH] * nnultimate.el (nnultimate-topic-article-to-article): Use the group. --- lisp/ChangeLog | 21 +++++++++++++++++++++ lisp/gnus-srvr.el | 2 +- lisp/gnus-sum.el | 41 +++++++++++++++++++++++++++++------------ lisp/nnultimate.el | 37 ++++++++++++++++++++++++++++--------- 4 files changed, 79 insertions(+), 22 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bd71c9214..717e32749 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,24 @@ +2001-05-01 19:06:21 Lars Magne Ingebrigtsen + + * nnultimate.el (nnultimate-topic-article-to-article): Use the + group. + +2001-04-24 19:50:14 Lars Magne Ingebrigtsen + + * gnus-srvr.el (gnus-server-insert-server-line): Add a space. + +2001-04-15 14:55:03 Lars Magne Ingebrigtsen + + * nnultimate.el (nnultimate-retrieve-headers): Return all + available headers. + + * gnus-sum.el (gnus-read-all-available-headers): New variable. + (gnus-get-newsgroup-headers-xover): Use it. + +2001-04-14 15:47:26 Lars Magne Ingebrigtsen + + * nnultimate.el (nnultimate-retrieve-headers): Clean up. + 2001-04-30 17:00:00 ShengHuo ZHU * nntp.el (nntp-retrieve-groups): Use throw instead of error. diff --git a/lisp/gnus-srvr.el b/lisp/gnus-srvr.el index 9d5648f1a..729899ab4 100644 --- a/lisp/gnus-srvr.el +++ b/lisp/gnus-srvr.el @@ -189,7 +189,7 @@ The following commands are available: (gnus-tmp-agent (if (and gnus-agent (member method gnus-agent-covered-methods)) - "(agent)" + " (agent)" ""))) (beginning-of-line) (gnus-add-text-properties diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 5263405bf..7d8f6f57e 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -956,6 +956,13 @@ when prompting the user for which type of files to save." :group 'gnus-summary :type 'regexp) +(defcustom gnus-read-all-available-headers nil + "Whether Gnus should parse all headers made available to it. +This is mostly relevant for slow backends where the user may +wish to widen the summary buffer to include all headers +that were fetched. Say, for nnultimate groups." + :group 'gnus-summary + :type '(choice boolean regexp)) ;;; Internal variables @@ -5094,6 +5101,13 @@ Return a list of headers that match SEQUENCE (see (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets) (cur nntp-server-buffer) (dependencies (or dependencies gnus-newsgroup-dependencies)) + (allp (cond + ((eq gnus-read-all-available-headers t) + t) + ((stringp gnus-read-all-available-headers) + (string-match gnus-read-all-available-headers group)) + (t + nil))) number headers header) (save-excursion (set-buffer nntp-server-buffer) @@ -5103,19 +5117,22 @@ Return a list of headers that match SEQUENCE (see (goto-char (point-min)) (while (not (eobp)) (condition-case () - (while (and sequence (not (eobp))) + (while (and (or sequence allp) + (not (eobp))) (setq number (read cur)) - (while (and sequence - (< (car sequence) number)) - (setq sequence (cdr sequence))) - (and sequence - (eq number (car sequence)) - (progn - (setq sequence (cdr sequence)) - (setq header (inline - (gnus-nov-parse-line - number dependencies force-new)))) - (push header headers)) + (when (not allp) + (while (and sequence + (< (car sequence) number)) + (setq sequence (cdr sequence)))) + (when (and (or allp + (and sequence + (eq number (car sequence)))) + (progn + (setq sequence (cdr sequence)) + (setq header (inline + (gnus-nov-parse-line + number dependencies force-new))))) + (push header headers)) (forward-line 1)) (error (gnus-error 4 "Strange nov line (%d)" diff --git a/lisp/nnultimate.el b/lisp/nnultimate.el index 0567ecc70..250ca3178 100644 --- a/lisp/nnultimate.el +++ b/lisp/nnultimate.el @@ -85,6 +85,8 @@ (setq map mapping) (while (and (setq article (car articles)) map) + ;; Skip past the articles in the map until we reach the + ;; article we're looking for. (while (and map (or (> article (caar map)) (< (cadar map) (caar map)))) @@ -138,14 +140,21 @@ (setq contents (cdr (nth 2 (car (nth 2 table))))) (setq total-contents (nconc total-contents contents)) (incf current-page)) - ;;(setq total-contents (nreverse total-contents)) - (dolist (art (cdr elem)) - (if (not (nth (1- (cdr art)) total-contents)) - () ;(debug) - (push (list (car art) - (nth (1- (cdr art)) total-contents) - subject) - nnultimate-articles))))) + (when t + (let ((i 0)) + (dolist (co total-contents) + (push (list (or (nnultimate-topic-article-to-article + group (car elem) (incf i)) + 1) + co subject) + nnultimate-articles)))) + (when nil + (dolist (art (cdr elem)) + (when (nth (1- (cdr art)) total-contents) + (push (list (car art) + (nth (1- (cdr art)) total-contents) + subject) + nnultimate-articles)))))) (setq nnultimate-articles (sort nnultimate-articles 'car-less-than-car)) ;; Now we have all the articles, conveniently in an alist @@ -190,7 +199,7 @@ from (or date "") (concat "<" (number-to-string sid) "%" (number-to-string article) - "@ultimate>") + "@ultimate." server ">") "" 0 (/ (length (mapconcat 'identity @@ -209,6 +218,16 @@ (nnheader-insert-nov (cdr header)))))) 'nov))) +(defun nnultimate-topic-article-to-article (group topic article) + (catch 'found + (dolist (elem (nth 5 (assoc group nnultimate-groups))) + (when (and (= topic (nth 2 elem)) + (>= article (nth 3 elem)) + (< article (+ (- (nth 1 elem) (nth 0 elem)) 1 + (nth 3 elem)))) + (throw 'found + (+ (nth 0 elem) (- article (nth 3 elem)))))))) + (deffoo nnultimate-request-group (group &optional server dont-check) (nnultimate-possibly-change-server nil server) (when (not nnultimate-groups) -- 2.25.1