--- ../lisp.cvs_ref/gnus-group.el Mon Mar 1 20:12:29 2004 +++ gnus-group.el Mon Mar 22 19:17:51 2004 @@ -2357,6 +2357,8 @@ ;; ... and then yanking it. Magic! (gnus-group-yank-group) (gnus-set-active new-name (gnus-active group)) + (gnus-cache-rename-group group new-name) + (gnus-agent-rename-group group new-name) (gnus-message 6 "Renaming group %s to %s...done" group new-name) new-name) (setq gnus-killed-list (delete group gnus-killed-list)) @@ -3504,7 +3506,7 @@ ;; First we make sure that we have really read the active file. (unless (gnus-read-active-file-p) (let ((gnus-read-active-file t) - (gnus-agent nil)) ; Trick the agent into ignoring the active file. + (gnus-agent gnus-plugged)); If we're actually plugged, store the active file in the agent. (gnus-read-active-file))) ;; Find all groups and sort them. (let ((groups @@ -3583,12 +3585,15 @@ (gnus-group-list-groups (and (numberp arg) (max (car gnus-group-list-mode) arg))))) +(autoload 'kjg "gnus-start") + (defun gnus-group-get-new-news-this-group (&optional n dont-scan) "Check for newly arrived news in the current group (and the N-1 next groups). The difference between N and the number of newsgroup checked is returned. If N is negative, this group and the N-1 previous groups will be checked." (interactive "P") - (let* ((groups (gnus-group-process-prefix n)) + (kjg "(gnus-group-get-new-news-this-group %s %s)" n dont-scan) + (let* ((groups (kjg "groups = %s" (gnus-group-process-prefix n))) (ret (if (numberp n) (- n (length groups)) 0)) (beg (unless n (point))) --- ../lisp.cvs_ref/gnus-int.el Tue Mar 9 02:07:19 2004 +++ gnus-int.el Mon Mar 22 19:17:51 2004 @@ -331,16 +331,24 @@ (funcall (gnus-get-function gnus-command-method 'request-regenerate) (nth 1 gnus-command-method))) +(autoload 'kjg "gnus-start") + (defun gnus-request-group (group &optional dont-check gnus-command-method) "Request GROUP. If DONT-CHECK, no information is required." + (kjg "(gnus-request-group %s %s %s)" group dont-check gnus-command-method) (let ((gnus-command-method - (or gnus-command-method (inline (gnus-find-method-for-group group))))) + (or gnus-command-method (inline (kjg "(gnus-find-method-for-group %s) => %s" group (gnus-find-method-for-group group)))))) (when (stringp gnus-command-method) - (setq gnus-command-method - (inline (gnus-server-to-method gnus-command-method)))) - (funcall (inline (gnus-get-function gnus-command-method 'request-group)) + (kjg "gnus-command-method = %s" (setq gnus-command-method + (inline (gnus-server-to-method gnus-command-method))))) + (kjg "(funcall %s %s %s %s) => %s" + (gnus-get-function gnus-command-method 'request-group) + (kjg "(gnus-group-real-name %s) => %s" group (gnus-group-real-name group)) + (nth 1 gnus-command-method) + dont-check + (funcall (inline (gnus-get-function gnus-command-method 'request-group)) (gnus-group-real-name group) (nth 1 gnus-command-method) - dont-check))) + dont-check)))) (defun gnus-list-active-group (group) "Request active information on GROUP." --- ../lisp.cvs_ref/gnus-start.el Sun Mar 14 02:02:02 2004 +++ gnus-start.el Mon Mar 22 18:24:18 2004 @@ -1481,9 +1481,10 @@ (defun gnus-activate-group (group &optional scan dont-check method) ;; Check whether a group has been activated or not. ;; If SCAN, request a scan of that group as well. - (let ((method (or method (inline (gnus-find-method-for-group group)))) + (kjg "(gnus-activate-group %s %s %s %s)" group scan dont-check method) + (let ((method (kjg "method = %s" (or method (inline (gnus-find-method-for-group group))))) active) - (and (inline (gnus-check-server method)) + (and (kjg "(gnus-check-server %s) => %s" method (inline (gnus-check-server method))) ;; We escape all bugs and quit here to make it possible to ;; continue if a group is so out-there that it reports bugs ;; and stuff. @@ -1501,7 +1502,7 @@ (message "Quit activating %s" group) nil))) (unless dont-check - (setq active (gnus-parse-active)) + (setq active (kjg "(gnus-parse-active) = %s" (gnus-parse-active))) ;; If there are no articles in the group, the GROUP ;; command may have responded with the `(0 . 0)'. We ;; ignore this if we already have an active entry @@ -1522,7 +1523,7 @@ (gnus-set-active group active) ;; Return the new active info. - active))))) + (kjg "active = %s" active)))))) (defun gnus-get-unread-articles-in-group (info active &optional update) (when active @@ -1619,6 +1620,12 @@ (setcar (gnus-group-entry (gnus-info-group info)) num)) num))) +(defun kjg (format &rest values) + (save-excursion + (set-buffer (get-buffer-create "kjg")) + (insert (apply #'format format values) "\n")) + (car (last values))) + ;; Go though `gnus-newsrc-alist' and compare with `gnus-active-hashtb' ;; and compute how many unread articles there are in each group. (defun gnus-get-unread-articles (&optional level) @@ -1673,53 +1680,52 @@ (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))) - ;; Let the Gnus agent save the active file. - (when (and gnus-agent active (gnus-online method)) - (gnus-agent-save-group-info - method (gnus-group-real-name group) active)) - (unless (inline (gnus-virtual-group-p group)) - (inline (gnus-close-group group))) - (when (fboundp (intern (concat (symbol-name (car method)) - "-request-update-info"))) - (inline (gnus-request-update-info info method)))) - ;; These groups are native or secondary. - (cond - ;; We don't want these groups. - ((> (gnus-info-level info) level) - (setq active 'ignore)) - ;; Activate groups. - ((not gnus-read-active-file) - (if (gnus-check-backend-function 'retrieve-groups group) - ;; if server support gnus-retrieve-groups we push - ;; the group onto retrievegroups for later checking - (if (assoc method retrieve-groups) - (setcdr (assoc method retrieve-groups) - (cons group (cdr (assoc method retrieve-groups)))) - (push (list method group) retrieve-groups)) - ;; hack: `nnmail-get-new-mail' changes the mail-source depending - ;; on the group, so we must perform a scan for every group - ;; if the users has any directory mail sources. - ;; hack: if `nnmail-scan-directory-mail-source-once' is non-nil, - ;; for it scan all spool files even when the groups are - ;; not required. - (if (and - (or nnmail-scan-directory-mail-source-once - (null (assq 'directory - (or mail-sources - (if (listp nnmail-spool-file) - nnmail-spool-file - (list nnmail-spool-file)))))) - (member method scanned-methods)) - (setq active (gnus-activate-group group)) - (setq active (gnus-activate-group group 'scan)) - (push method scanned-methods)) - (when active - (gnus-close-group group)))))) + + (cond ((kjg "(eq method-type 'foreign) = %s" (eq method-type 'foreign)) + ;; These groups are foreign. Check the level. + (when (and (kjg "(<= (gnus-info-level info) foreign-level) = %s" (<= (gnus-info-level info) foreign-level)) + (kjg "(setq active (gnus-activate-group group 'scan)) = %s" (setq active (gnus-activate-group group 'scan)))) + ;; Let the Gnus agent save the active file. + (when (and gnus-agent active (gnus-online method)) + (gnus-agent-save-group-info + method (gnus-group-real-name group) active)) + (unless (inline (gnus-virtual-group-p group)) + (inline (gnus-close-group group))) + (when (fboundp (intern (concat (symbol-name (car method)) + "-request-update-info"))) + (inline (gnus-request-update-info info method))))) + ;; These groups are native or secondary. + ((kjg "(> (gnus-info-level info) level) = %s" (> (gnus-info-level info) level)) + ;; We don't want these groups. + (setq active 'ignore)) + ;; Activate groups. + ((kjg "(not gnus-read-active-file) = %s" (not gnus-read-active-file)) + (if (gnus-check-backend-function 'retrieve-groups group) + ;; if server support gnus-retrieve-groups we push + ;; the group onto retrievegroups for later checking + (if (assoc method retrieve-groups) + (setcdr (assoc method retrieve-groups) + (cons group (cdr (assoc method retrieve-groups)))) + (push (list method group) retrieve-groups)) + ;; hack: `nnmail-get-new-mail' changes the mail-source depending + ;; on the group, so we must perform a scan for every group + ;; if the users has any directory mail sources. + ;; hack: if `nnmail-scan-directory-mail-source-once' is non-nil, + ;; for it scan all spool files even when the groups are + ;; not required. + (if (and + (or nnmail-scan-directory-mail-source-once + (null (assq 'directory + (or mail-sources + (if (listp nnmail-spool-file) + nnmail-spool-file + (list nnmail-spool-file)))))) + (member method scanned-methods)) + (setq active (gnus-activate-group group)) + (setq active (gnus-activate-group group 'scan)) + (push method scanned-methods)) + (when active + (gnus-close-group group))))) ;; Get the number of unread articles in the group. (cond @@ -1936,10 +1942,13 @@ ;; Get the active file(s) from the backend(s). (defun gnus-read-active-file (&optional force not-native) + (kjg "(gnus-read-active-file %s %s)" force not-native) (gnus-group-set-mode-line) (let ((methods (mapcar - (lambda (m) (if (stringp m) (gnus-server-get-method nil m) m)) + (lambda (m) (kjg "m = %s; method = %s" + m + (if (stringp m) (gnus-server-get-method nil m) m))) (append (if (and (not not-native) (gnus-check-server gnus-select-method)) @@ -1970,38 +1979,45 @@ nil)))))))) (defun gnus-read-active-file-1 (method force) + (kjg "(gnus-read-active-file-1 %s %s)" method force) (let (where mesg) (setq where (nth 1 method) mesg (format "Reading active file%s via %s..." (if (and where (not (zerop (length where)))) (concat " from " where) "") (car method))) + (kjg mesg) (gnus-message 5 mesg) - (when (gnus-check-server method) + (when (kjg "(gnus-check-server method) = %s" (gnus-check-server method)) ;; Request that the backend scan its incoming messages. - (when (gnus-check-backend-function 'request-scan (car method)) + (when (kjg "(gnus-check-backend-function 'request-scan (car method)) = %s" + (gnus-check-backend-function 'request-scan (car method))) (gnus-request-scan nil method)) (cond ((and (eq gnus-read-active-file 'some) - (gnus-check-backend-function 'retrieve-groups (car method)) + (kjg "(gnus-check-backend-function 'retrieve-groups (car method)) = %s" + (gnus-check-backend-function 'retrieve-groups (car method))) (not force)) (let ((newsrc (cdr gnus-newsrc-alist)) - (gmethod (gnus-server-get-method nil method)) + (gmethod (kjg "gmethod = %s" (gnus-server-get-method nil method))) groups info) (while (setq info (pop newsrc)) (when (inline - (gnus-server-equal - (inline - (gnus-find-method-for-group - (gnus-info-group info) info)) - gmethod)) - (push (gnus-group-real-name (gnus-info-group info)) + (kjg "gnus-server-equal = %s" + (gnus-server-equal + (inline + (kjg "(gnus-find-method-for-group %s info) = %s" + (gnus-info-group info) + (gnus-find-method-for-group + (gnus-info-group info) info))) + gmethod))) + (push (kjg "Pushing %s onto groups" (gnus-group-real-name (gnus-info-group info))) groups))) (gnus-read-active-file-2 groups method))) ((null method) t) (t - (if (not (gnus-request-list method)) + (if (not (kjg "(gnus-request-list method) = %s" (gnus-request-list method))) (unless (equal method gnus-message-archive-method) (gnus-error 1 "Cannot read active file from %s server" (car method))) --- ../lisp.cvs_ref/gnus-topic.el Thu Feb 12 07:24:52 2004 +++ gnus-topic.el Mon Mar 22 19:17:50 2004 @@ -1453,12 +1453,15 @@ (call-interactively 'gnus-group-unmark-group) (gnus-topic-mark-topic topic t non-recursive))) +(autoload 'kjg "gnus-start") + (defun gnus-topic-get-new-news-this-topic (&optional n) "Check for new news in the current topic." (interactive "P") + (kjg "(gnus-topic-get-new-news-this-topic)") (if (not (gnus-group-topic-p)) (gnus-group-get-new-news-this-group n) - (let* ((topic (gnus-group-topic-name)) + (let* ((topic (kjg "topic = %s" (gnus-group-topic-name))) (data (cadr (gnus-topic-find-topology topic)))) (save-excursion (gnus-topic-mark-topic topic nil (and n t))