2003-12-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
+ * gnus-start.el (gnus-get-unread-articles): Inline gnus-server-get-method.
+ (gnus-get-unread-articles): Cache methods.
+ (gnus-get-unread-articles-in-group): Indent.
+
* gnus.el (gnus-version-number): Bump.
(gnus-secondary-method-p): Extend servers to methods before comparing.
+ (gnus-secondary-method-p): Revert.
2003-12-30 Lars Magne Ingebrigtsen <lars@ingebrigtsen.no>
;; If the agent is enabled, we may have to alter the active info.
(when (and gnus-agent info)
(gnus-agent-possibly-alter-active
- (gnus-info-group info) active))
+ (gnus-info-group info) active))
;; Modify the list of read articles according to what articles
;; are available; then tally the unread articles and add the
gnus-activate-foreign-newsgroups)
(t 0))
level))
- scanned-methods info group active method retrieve-groups)
+ (methods-cache nil)
+ (type-cache nil)
+ scanned-methods info group active method retrieve-groups cmethod
+ method-type)
(gnus-message 6 "Checking new news...")
(while newsrc
;; nil for non-foreign groups that the user has requested not be checked
;; t for unchecked foreign groups or bogus groups, or groups that can't
;; be checked, for one reason or other.
- (if (and (setq method (gnus-info-method info))
- (not (inline
- (gnus-server-equal
- gnus-select-method
- (setq method (gnus-server-get-method nil method)))))
- (not (gnus-secondary-method-p method)))
+ (when (setq method (gnus-info-method info))
+ (if (setq cmethod (assoc method methods-cache))
+ (setq method (cdr cmethod))
+ (setq cmethod (inline (gnus-server-get-method nil method)))
+ (push (cons method cmethod) methods-cache)
+ (setq method cmethod)))
+ (when (and method
+ (not (setq method-type (cdr (assoc method type-cache)))))
+ (setq method-type
+ (cond
+ ((gnus-secondary-method-p method)
+ 'secondary)
+ ((inline (gnus-server-equal gnus-select-method method))
+ 'primary)
+ (t
+ 'foreign)))
+ (push (cons method method-type) type-cache))
+ (if (and method
+ (eq method-type 'foreign))
;; These groups are foreign. Check the level.
(when (and (<= (gnus-info-level info) foreign-level)
(setq active (gnus-activate-group group 'scan)))
(defsubst gnus-secondary-method-p (method)
"Return whether METHOD is a secondary select method."
(let ((methods gnus-secondary-select-methods)
- (gmethod (gnus-server-get-method nil method)))
+ (gmethod (inline (gnus-server-get-method nil method))))
(while (and methods
(not (gnus-method-equal
- (gnus-server-get-method nil (car methods))
- (gnus-server-get-method nil gmethod))))
+ (inline (gnus-server-get-method nil (car methods)))
+ gmethod)))
(setq methods (cdr methods)))
methods))