From: yamaoka Date: Sat, 10 Jan 2004 09:43:07 +0000 (+0000) Subject: Synch to No Gnus 200401100427. X-Git-Tag: t-gnus-6_17_4-quimby-~1144 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85093239bc794cb948ebbf5a5bd910b3d1c95cec;p=elisp%2Fgnus.git- Synch to No Gnus 200401100427. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index abc709c..b0d0850 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,51 @@ +2004-01-10 Jesper Harder + + * gnus-start.el (gnus-subscribe-newsgroup, gnus-start-draft-setup) + (gnus-group-change-level, gnus-kill-newsgroup) + (gnus-check-bogus-newsgroups, gnus-get-unread-articles-in-group) + (gnus-get-unread-articles, gnus-make-articles-unread) + (gnus-make-ascending-articles-unread): Use accessor + macros (gnus-group-entry, gnus-group-unread, gnus-info-marks etc.) + to get group information for improved readability. + + * gnus-srvr.el (gnus-browse-unsubscribe-group): do. + + * gnus-soup.el (gnus-soup-group-brew): do. + + * gnus-msg.el (gnus-put-message): do. + + * gnus-move.el (gnus-group-move-group-to-server): do. + + * gnus-kill.el (gnus-batch-score): do. + + * gnus-group.el (gnus-group-prepare-flat, gnus-group-delete-group) + (gnus-group-update-group-line, gnus-group-insert-group-line-info) + (gnus-group-update-group, gnus-group-read-group) + (gnus-group-make-group, gnus-group-make-help-group) + (gnus-group-make-archive-group, gnus-group-make-directory-group) + (gnus-group-make-empty-virtual, gnus-group-sort-selected-flat) + (gnus-group-sort-by-unread, gnus-group-catchup) + (gnus-group-unsubscribe-group, gnus-group-kill-group) + (gnus-group-yank-group, gnus-group-set-info) + (gnus-group-list-groups): do. + + * gnus.el (gnus-generate-new-group-name): do. + + * gnus-delay.el (gnus-delay-send-queue): do. + + * nnvirtual.el (nnvirtual-catchup-group): do. + + * nnkiboze.el (nnkiboze-generate-group, nnkiboze-generate-group): + do. + + * gnus-topic.el (gnus-topic-find-groups, gnus-topic-clean-alist) + (gnus-group-prepare-topics, gnus-topic-check-topology): do. + + * gnus-sum.el (gnus-update-read-articles, gnus-select-newsgroup) + (gnus-mark-xrefs-as-read, gnus-compute-read-articles) + (gnus-summary-walk-group-buffer, gnus-summary-move-article) + (gnus-group-make-articles-read): do. + 2004-01-09 Jesper Harder * gnus-art.el (article-decode-mime-words, article-babel) diff --git a/lisp/gnus-delay.el b/lisp/gnus-delay.el index cc212fa..67f74ce 100644 --- a/lisp/gnus-delay.el +++ b/lisp/gnus-delay.el @@ -150,7 +150,7 @@ DELAY is a string, giving the length of the time. Possible values are: (message-send-hook (copy-sequence message-send-hook)) articles article deadline) - (when (gnus-gethash group gnus-newsrc-hashtb) + (when (gnus-group-entry group) (gnus-activate-group group) (add-hook 'message-send-hook '(lambda () diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index 64e4459..4c5e6a1 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -1195,7 +1195,7 @@ Also see the `gnus-group-use-permanent-levels' variable." (point-min) (point-max) 'gnus-group (gnus-intern-safe group gnus-active-hashtb)))) - (let ((newsrc (cdddr (gnus-gethash group gnus-newsrc-hashtb)))) + (let ((newsrc (cdddr (gnus-group-entry group)))) (while (and newsrc (not (gnus-goto-char (text-property-any @@ -1250,7 +1250,7 @@ if it is a string, only list groups matching REGEXP." group (gnus-info-group info) params (gnus-info-params info) newsrc (cdr newsrc) - unread (car (gnus-gethash group gnus-newsrc-hashtb))) + unread (gnus-group-unread group)) (when not-in-list (setq not-in-list (delete group not-in-list))) (when (gnus-group-prepare-logic @@ -1350,7 +1350,7 @@ if it is a string, only list groups matching REGEXP." "Update the current line in the group buffer." (let* ((buffer-read-only nil) (group (gnus-group-group-name)) - (entry (and group (gnus-gethash group gnus-newsrc-hashtb))) + (entry (and group (gnus-group-entry group))) gnus-group-indentation) (when group (and entry @@ -1367,7 +1367,7 @@ if it is a string, only list groups matching REGEXP." (defun gnus-group-insert-group-line-info (group) "Insert GROUP on the current line." - (let ((entry (gnus-gethash group gnus-newsrc-hashtb)) + (let ((entry (gnus-group-entry group)) (gnus-group-indentation (gnus-group-group-indentation)) active info) (if entry @@ -1547,7 +1547,7 @@ already." (loc (point-min)) found buffer-read-only) ;; Enter the current status into the dribble buffer. - (let ((entry (gnus-gethash group gnus-newsrc-hashtb))) + (let ((entry (gnus-group-entry group))) (when (and entry (not (gnus-ephemeral-group-p group))) (gnus-dribble-enter @@ -1572,7 +1572,7 @@ already." ;; go, and insert it there (or at the end of the buffer). (if gnus-goto-missing-group-function (funcall gnus-goto-missing-group-function group) - (let ((entry (cddr (gnus-gethash group gnus-newsrc-hashtb)))) + (let ((entry (cddr (gnus-group-entry group)))) (while (and entry (car entry) (not (gnus-goto-char @@ -1900,8 +1900,7 @@ group." (unless group (error "No group on current line")) (setq marked (gnus-info-marks - (nth 2 (setq entry (gnus-gethash - group gnus-newsrc-hashtb))))) + (nth 2 (setq entry (gnus-group-entry group))))) ;; This group might be a dead group. In that case we have to get ;; the number of unread articles from `gnus-active-hashtb'. (setq number @@ -2272,15 +2271,14 @@ ADDRESS." method)))) (nname (if method (gnus-group-prefixed-name name meth) name)) backend info) - (when (gnus-gethash nname gnus-newsrc-hashtb) + (when (gnus-group-entry nname) (error "Group %s already exists" nname)) ;; Subscribe to the new group. (gnus-group-change-level (setq info (list t nname gnus-level-default-subscribed nil nil meth)) gnus-level-default-subscribed gnus-level-killed (and (gnus-group-group-name) - (gnus-gethash (gnus-group-group-name) - gnus-newsrc-hashtb)) + (gnus-group-entry (gnus-group-group-name))) t) ;; Make it active. (gnus-set-active nname (cons 1 0)) @@ -2348,7 +2346,7 @@ be removed from the server, even when it's empty." (gnus-message 6 "Deleting group %s...done" group) (gnus-group-goto-group group) (gnus-group-kill-group 1 t) - (gnus-sethash group nil gnus-active-hashtb) + (gnus-set-active group nil) (if (boundp 'gnus-cache-active-hashtb) (when gnus-cache-active-hashtb (gnus-sethash group nil gnus-cache-active-hashtb) @@ -2522,7 +2520,7 @@ group already exists: (interactive) (let ((name (gnus-group-prefixed-name "gnus-help" '(nndoc "gnus-help"))) (file (nnheader-find-etc-directory "gnus-tut.txt" t))) - (if (gnus-gethash name gnus-newsrc-hashtb) + (if (gnus-group-entry name) (cond ((eq noerror nil) (error "Documentation group already exists")) ((eq noerror t) @@ -2680,7 +2678,7 @@ Given a prefix, create a full group." (interactive "P") (let ((group (gnus-group-prefixed-name (if all "ding.archives" "ding.recent") '(nndir "")))) - (when (gnus-gethash group gnus-newsrc-hashtb) + (when (gnus-group-entry group) (error "Archive group already exists")) (gnus-group-make-group (gnus-group-real-name group) @@ -2704,7 +2702,7 @@ mail messages or news articles in files that have numeric names." (let ((ext "") (i 0) group) - (while (or (not group) (gnus-gethash group gnus-newsrc-hashtb)) + (while (or (not group) (gnus-group-entry group)) (setq group (gnus-group-prefixed-name (expand-file-name ext dir) @@ -2774,7 +2772,7 @@ score file entries for articles to include in the group." (let* ((method (list 'nnvirtual "^$")) (pgroup (gnus-group-prefixed-name group method))) ;; Check whether it exists already. - (when (gnus-gethash pgroup gnus-newsrc-hashtb) + (when (gnus-group-entry pgroup) (error "Group %s already exists" pgroup)) ;; Subscribe the new group after the group on the current line. (gnus-subscribe-group pgroup (gnus-group-group-name) method) @@ -2946,7 +2944,7 @@ If REVERSE, sort in reverse order." (let (entries infos) ;; First find all the group entries for these groups. (while groups - (push (nthcdr 2 (gnus-gethash (pop groups) gnus-newsrc-hashtb)) + (push (nthcdr 2 (gnus-group-entry (pop groups))) entries)) ;; Then sort the infos. (setq infos @@ -3027,8 +3025,8 @@ sort in reverse order." (defun gnus-group-sort-by-unread (info1 info2) "Sort by number of unread articles." - (let ((n1 (car (gnus-gethash (gnus-info-group info1) gnus-newsrc-hashtb))) - (n2 (car (gnus-gethash (gnus-info-group info2) gnus-newsrc-hashtb)))) + (let ((n1 (gnus-group-unread (gnus-info-group info1))) + (n2 (gnus-group-unread (gnus-info-group info1)))) (< (or (and (numberp n1) n1) 0) (or (and (numberp n2) n2) 0)))) @@ -3168,9 +3166,9 @@ Cross references (Xref: header) of articles are ignored." If ALL is non-nil, all articles are marked as read. The return value is the number of articles that were marked as read, or nil if no action could be taken." - (let* ((entry (gnus-gethash group gnus-newsrc-hashtb)) + (let* ((entry (gnus-group-entry group)) (num (car entry)) - (marks (nth 3 (nth 2 entry))) + (marks (gnus-info-marks (nth 2 entry))) (unread (gnus-list-of-unread-articles group))) ;; Remove entries for this group. (nnmail-purge-split-history (gnus-group-real-name group)) @@ -3326,7 +3324,7 @@ group line." (gnus-read-active-file-p) nil 'gnus-group-history))) - (let ((newsrc (gnus-gethash group gnus-newsrc-hashtb))) + (let ((newsrc (gnus-group-entry group))) (cond ((string-match "^[ \t]*$" group) (error "Empty group name")) @@ -3350,7 +3348,7 @@ group line." gnus-level-zombie) gnus-level-killed) (when (gnus-group-group-name) - (gnus-gethash (gnus-group-group-name) gnus-newsrc-hashtb))) + (gnus-group-entry (gnus-group-group-name)))) (unless silent (gnus-group-update-group group))) (t (error "No such newsgroup: %s" group))) @@ -3418,7 +3416,7 @@ of groups killed." (setq level (gnus-group-group-level)) (gnus-delete-line) (when (and (not discard) - (setq entry (gnus-gethash group gnus-newsrc-hashtb))) + (setq entry (gnus-group-entry group))) (gnus-undo-register `(progn (gnus-group-goto-group ,(gnus-group-group-name)) @@ -3441,7 +3439,7 @@ of groups killed." (funcall gnus-group-change-level-function group gnus-level-killed 3)) (cond - ((setq entry (gnus-gethash group gnus-newsrc-hashtb)) + ((setq entry (gnus-group-entry group)) (push (cons (car entry) (nth 2 entry)) gnus-list-of-killed-groups) (setcdr (cdr entry) (cdddr entry))) @@ -3474,7 +3472,7 @@ yanked) a list of yanked groups is returned." (setq prev (gnus-group-group-name)) (gnus-group-change-level info (gnus-info-level (cdr info)) gnus-level-killed - (and prev (gnus-gethash prev gnus-newsrc-hashtb)) + (and prev (gnus-group-entry prev)) t) (gnus-group-insert-group-line-info group) (gnus-undo-register @@ -4063,9 +4061,8 @@ and the second element is the address." (defun gnus-group-set-info (info &optional method-only-group part) (when (or info part) - (let* ((entry (gnus-gethash - (or method-only-group (gnus-info-group info)) - gnus-newsrc-hashtb)) + (let* ((entry (gnus-group-entry + (or method-only-group (gnus-info-group info)))) (part-info info) (info (if method-only-group (nth 2 entry) info)) method) @@ -4103,10 +4100,9 @@ and the second element is the address." (gnus-group-make-group (gnus-info-group info)))) (gnus-message 6 "Note: New group created") (setq entry - (gnus-gethash (gnus-group-prefixed-name - (gnus-group-real-name (gnus-info-group info)) - (or (gnus-info-method info) gnus-select-method)) - gnus-newsrc-hashtb)))) + (gnus-group-entry (gnus-group-prefixed-name + (gnus-group-real-name (gnus-info-group info)) + (or (gnus-info-method info) gnus-select-method)))))) ;; Whether it was a new group or not, we now have the entry, so we ;; can do the update. (if entry diff --git a/lisp/gnus-kill.el b/lisp/gnus-kill.el index cf95f9f..2a5770f 100644 --- a/lisp/gnus-kill.el +++ b/lisp/gnus-kill.el @@ -690,7 +690,7 @@ Usage: emacs -batch -l ~/.emacs -l gnus -f gnus-batch-score" (mail-sources nil) (gnus-use-dribble-file nil) (gnus-batch-mode t) - info group newsrc entry + info group newsrc unread ;; Disable verbose message. gnus-novice-user gnus-large-newsgroup gnus-options-subscribe gnus-auto-subscribed-groups @@ -702,11 +702,11 @@ Usage: emacs -batch -l ~/.emacs -l gnus -f gnus-batch-score" (setq newsrc (cdr gnus-newsrc-alist)) (while (setq info (pop newsrc)) (setq group (gnus-info-group info) - entry (gnus-gethash group gnus-newsrc-hashtb)) + unread (gnus-group-unread group)) (when (and (<= (gnus-info-level info) gnus-level-subscribed) - (and (car entry) - (or (eq (car entry) t) - (not (zerop (car entry)))))) + (and unread + (or (eq unread t) + (not (zerop unread))))) (ignore-errors (gnus-summary-read-group group nil t nil t)) (when (eq (current-buffer) (get-buffer gnus-summary-buffer)) diff --git a/lisp/gnus-move.el b/lisp/gnus-move.el index 36839c8..3e06945 100644 --- a/lisp/gnus-move.el +++ b/lisp/gnus-move.el @@ -176,8 +176,7 @@ Update the .newsrc.eld file to reflect the change of nntp server." (new-name (gnus-group-prefixed-name (gnus-group-real-name group) to-server))) (gnus-info-set-group info new-name) - (gnus-sethash new-name (gnus-gethash group gnus-newsrc-hashtb) - gnus-newsrc-hashtb) + (gnus-sethash new-name (gnus-group-entry group) gnus-newsrc-hashtb) (gnus-sethash group nil gnus-newsrc-hashtb)))) (provide 'gnus-move) diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index 0430000..e5006ec 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -1604,7 +1604,7 @@ The current group name will be inserted at \"%s\".") (not (gnus-group-read-only-p group))) (setq group (read-string "Put in group: " nil (gnus-writable-groups)))) - (when (gnus-gethash group gnus-newsrc-hashtb) + (when (gnus-group-entry group) (error "No such group: %s" group)) (save-excursion (save-restriction diff --git a/lisp/gnus-soup.el b/lisp/gnus-soup.el index 2b9d305..32a2bdd 100644 --- a/lisp/gnus-soup.el +++ b/lisp/gnus-soup.el @@ -278,7 +278,7 @@ Note -- this function hasn't been implemented yet." If NOT-ALL, don't pack ticked articles." (let ((gnus-expert-user t) (gnus-large-newsgroup nil) - (entry (gnus-gethash group gnus-newsrc-hashtb))) + (entry (gnus-group-entry group))) (when (or (null entry) (eq (car entry) t) (and (car entry) diff --git a/lisp/gnus-srvr.el b/lisp/gnus-srvr.el index 17e385a..9bb79ce 100644 --- a/lisp/gnus-srvr.el +++ b/lisp/gnus-srvr.el @@ -933,8 +933,7 @@ buffer. gnus-browse-current-method))) gnus-level-default-subscribed (gnus-group-level group) (and (car (nth 1 gnus-newsrc-alist)) - (gnus-gethash (car (nth 1 gnus-newsrc-alist)) - gnus-newsrc-hashtb)) + (gnus-group-entry (car (nth 1 gnus-newsrc-alist)))) t) (delete-char 1) (insert ? )) diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el index 21bd7b4..3542e31 100644 --- a/lisp/gnus-start.el +++ b/lisp/gnus-start.el @@ -624,8 +624,7 @@ the first newsgroup." ;; We subscribe the group by changing its level to `subscribed'. (gnus-group-change-level newsgroup gnus-level-default-subscribed - gnus-level-killed (gnus-gethash (or next "dummy.group") - gnus-newsrc-hashtb)) + gnus-level-killed (gnus-group-entry (or next "dummy.group"))) (gnus-message 5 "Subscribe newsgroup: %s" newsgroup) (run-hook-with-args 'gnus-subscribe-newsgroup-hooks newsgroup) t)) @@ -813,7 +812,7 @@ prompt the user for the name of an NNTP server to use." (defun gnus-start-draft-setup () "Make sure the draft group exists." (gnus-request-create-group "drafts" '(nndraft "")) - (unless (gnus-gethash "nndraft:drafts" gnus-newsrc-hashtb) + (unless (gnus-group-entry "nndraft:drafts") (let ((gnus-level-default-subscribed 1)) (gnus-subscribe-group "nndraft:drafts" nil '(nndraft ""))) (gnus-group-set-parameter @@ -1318,16 +1317,16 @@ for new groups, and subscribe the new groups as zombies." (when (and (stringp entry) oldlevel (< oldlevel gnus-level-zombie)) - (setq entry (gnus-gethash entry gnus-newsrc-hashtb))) + (setq entry (gnus-group-entry entry))) (if (and (not oldlevel) (consp entry)) (setq oldlevel (gnus-info-level (nth 2 entry))) (setq oldlevel (or oldlevel gnus-level-killed))) (when (stringp previous) - (setq previous (gnus-gethash previous gnus-newsrc-hashtb))) + (setq previous (gnus-group-entry previous))) (if (and (>= oldlevel gnus-level-zombie) - (gnus-gethash group gnus-newsrc-hashtb)) + (gnus-group-entry group)) ;; We are trying to subscribe a group that is already ;; subscribed. () ; Do nothing. @@ -1351,8 +1350,7 @@ for new groups, and subscribe the new groups as zombies." entry) (gnus-sethash (car (nth 2 entry)) nil gnus-newsrc-hashtb) (when (nth 3 entry) - (setcdr (gnus-gethash (car (nth 3 entry)) - gnus-newsrc-hashtb) + (setcdr (gnus-group-entry (car (nth 3 entry))) (cdr entry))) (setcdr (cdr entry) (cdddr entry))))) @@ -1412,7 +1410,7 @@ for new groups, and subscribe the new groups as zombies." (gnus-sethash group (cons num previous) gnus-newsrc-hashtb)) (when (cdr entry) - (setcdr (gnus-gethash (caadr entry) gnus-newsrc-hashtb) entry)) + (setcdr (gnus-group-entry (caadr entry)) entry)) (gnus-dribble-enter (format "(gnus-group-set-info '%S)" info))))) @@ -1423,7 +1421,7 @@ for new groups, and subscribe the new groups as zombies." (defun gnus-kill-newsgroup (newsgroup) "Obsolete function. Kills a newsgroup." (gnus-group-change-level - (gnus-gethash newsgroup gnus-newsrc-hashtb) gnus-level-killed)) + (gnus-group-entry newsgroup) gnus-level-killed)) (defun gnus-check-bogus-newsgroups (&optional confirm) "Remove bogus newsgroups. @@ -1451,14 +1449,14 @@ newsgroup." (lambda (group) ;; Remove all bogus subscribed groups by first killing them, and ;; then removing them from the list of killed groups. - (when (setq entry (gnus-gethash group gnus-newsrc-hashtb)) + (when (setq entry (gnus-group-entry group)) (gnus-group-change-level entry gnus-level-killed) (setq gnus-killed-list (delete group gnus-killed-list)))) bogus '("group" "groups" "remove")) (while (setq group (pop bogus)) ;; Remove all bogus subscribed groups by first killing them, and ;; then removing them from the list of killed groups. - (when (setq entry (gnus-gethash group gnus-newsrc-hashtb)) + (when (setq entry (gnus-group-entry group)) (gnus-group-change-level entry gnus-level-killed) (setq gnus-killed-list (delete group gnus-killed-list))))) ;; Then we remove all bogus groups from the list of killed and @@ -1624,8 +1622,8 @@ newsgroup." (setq num (max 0 (- (cdr active) num))))) ;; Set the number of unread articles. (when (and info - (gnus-gethash (gnus-info-group info) gnus-newsrc-hashtb)) - (setcar (gnus-gethash (gnus-info-group info) gnus-newsrc-hashtb) num)) + (gnus-group-entry (gnus-info-group info))) + (setcar (gnus-group-entry (gnus-info-group info)) num)) num))) ;; Go though `gnus-newsrc-alist' and compare with `gnus-active-hashtb' @@ -1741,7 +1739,7 @@ newsgroup." ;; The group couldn't be reached, so we nix out the number of ;; unread articles and stuff. (gnus-set-active group nil) - (let ((tmp (gnus-gethash group gnus-newsrc-hashtb))) + (let ((tmp (gnus-group-entry group))) (when tmp (setcar tmp t)))))) @@ -1766,7 +1764,7 @@ newsgroup." ;; The group couldn't be reached, so we nix out the number of ;; unread articles and stuff. (gnus-set-active group nil) - (setcar (gnus-gethash group gnus-newsrc-hashtb) t))))))) + (setcar (gnus-group-entry group) t))))))) (gnus-message 6 "Checking new news...done"))) @@ -1818,9 +1816,9 @@ newsgroup." (defun gnus-make-articles-unread (group articles) "Mark ARTICLES in GROUP as unread." - (let* ((info (nth 2 (or (gnus-gethash group gnus-newsrc-hashtb) - (gnus-gethash (gnus-group-real-name group) - gnus-newsrc-hashtb)))) + (let* ((info (nth 2 (or (gnus-group-entry group) + (gnus-group-entry + (gnus-group-real-name group))))) (ranges (gnus-info-read info)) news article) (while articles @@ -1840,9 +1838,8 @@ newsgroup." (defun gnus-make-ascending-articles-unread (group articles) "Mark ascending ARTICLES in GROUP as unread." - (let* ((entry (or (gnus-gethash group gnus-newsrc-hashtb) - (gnus-gethash (gnus-group-real-name group) - gnus-newsrc-hashtb))) + (let* ((entry (or (gnus-group-entry group) + (gnus-group-entry (gnus-group-real-name group)))) (info (nth 2 entry)) (ranges (gnus-info-read info)) (r ranges) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 2514f32..0d538b6 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -5004,7 +5004,7 @@ or a straight list of headers." "Select newsgroup GROUP. If READ-ALL is non-nil, all articles in the group are selected. If SELECT-ARTICLES, only select those articles from GROUP." - (let* ((entry (gnus-gethash group gnus-newsrc-hashtb)) + (let* ((entry (gnus-group-entry group)) ;;!!! Dirty hack; should be removed. (gnus-summary-ignore-duplicates (if (eq (car (gnus-find-method-for-group group)) 'nnvirtual) @@ -5598,7 +5598,7 @@ The resulting hash table is returned, or nil if no Xrefs were found." (defun gnus-mark-xrefs-as-read (from-newsgroup headers unreads) "Look through all the headers and mark the Xrefs as read." (let ((virtual (gnus-virtual-group-p from-newsgroup)) - name entry info xref-hashtb idlist method nth4) + name info xref-hashtb idlist method nth4) (save-excursion (set-buffer gnus-group-buffer) (when (setq xref-hashtb @@ -5609,8 +5609,7 @@ The resulting hash table is returned, or nil if no Xrefs were found." (setq idlist (symbol-value group)) ;; Dead groups are not updated. (and (prog1 - (setq entry (gnus-gethash name gnus-newsrc-hashtb) - info (nth 2 entry)) + (setq info (gnus-get-info name)) (when (stringp (setq nth4 (gnus-info-method info))) (setq nth4 (gnus-server-to-method nth4)))) ;; Only do the xrefs if the group has the same @@ -5632,7 +5631,7 @@ The resulting hash table is returned, or nil if no Xrefs were found." xref-hashtb))))) (defun gnus-compute-read-articles (group articles) - (let* ((entry (gnus-gethash group gnus-newsrc-hashtb)) + (let* ((entry (gnus-group-entry group)) (info (nth 2 entry)) (active (gnus-active group)) ninfo) @@ -5669,14 +5668,13 @@ The resulting hash table is returned, or nil if no Xrefs were found." (defun gnus-group-make-articles-read (group articles) "Update the info of GROUP to say that ARTICLES are read." (let* ((num 0) - (entry (gnus-gethash group gnus-newsrc-hashtb)) + (entry (gnus-group-entry group)) (info (nth 2 entry)) (active (gnus-active group)) range) (when entry (setq range (gnus-compute-read-articles group articles)) - (save-excursion - (set-buffer gnus-group-buffer) + (with-current-buffer gnus-group-buffer (gnus-undo-register `(progn (gnus-info-set-marks ',info ',(gnus-info-marks info) t) @@ -7147,7 +7145,7 @@ If BACKWARD, the previous article is selected instead of the next." (not (gnus-ephemeral-group-p gnus-newsgroup-name))) (format " (Type %s for %s [%s])" (single-key-description cmd) group - (car (gnus-gethash group gnus-newsrc-hashtb))) + (gnus-group-unread group)) (format " (Type %s to exit %s)" (single-key-description cmd) gnus-newsgroup-name)))) @@ -9072,9 +9070,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'." (t (let* ((pto-group (gnus-group-prefixed-name (car art-group) to-method)) - (entry - (gnus-gethash pto-group gnus-newsrc-hashtb)) - (info (nth 2 entry)) + (info (gnus-get-info pto-group)) (to-group (gnus-info-group info)) to-marks) ;; Update the group that has been moved to. @@ -11379,11 +11375,10 @@ If REVERSE, save parts that do not match TYPE." (defun gnus-update-read-articles (group unread &optional compute) "Update the list of read articles in GROUP. UNREAD is a sorted list." - (let* ((active (or gnus-newsgroup-active (gnus-active group))) - (entry (gnus-gethash group gnus-newsrc-hashtb)) - (info (nth 2 entry)) - (prev 1) - read) + (let ((active (or gnus-newsgroup-active (gnus-active group))) + (info (gnus-get-info group)) + (prev 1) + read) (if (or (not info) (not active)) ;; There is no info on this group if it was, in fact, ;; killed. Gnus stores no information on killed groups, so diff --git a/lisp/gnus-topic.el b/lisp/gnus-topic.el index 87a06c7..cab9bb3 100644 --- a/lisp/gnus-topic.el +++ b/lisp/gnus-topic.el @@ -209,7 +209,7 @@ If RECURSIVE is t, return groups in its subtopics too." ;; We go through the newsrc to look for matches. (while groups (when (setq group (pop groups)) - (setq entry (gnus-gethash group gnus-newsrc-hashtb) + (setq entry (gnus-group-entry group) info (nth 2 entry) params (gnus-info-params info) active (gnus-active group) @@ -464,7 +464,7 @@ If LOWEST is non-nil, list all newsgroups of level LOWEST or higher." (gnus-make-hashtable-from-killed)) (gnus-group-prepare-flat-list-dead (gnus-remove-if (lambda (group) - (or (gnus-gethash group gnus-newsrc-hashtb) + (or (gnus-group-entry group) (gnus-gethash group gnus-killed-hashtb))) not-in-list) gnus-level-killed ?K regexp))) @@ -857,7 +857,7 @@ articles in the topic and its subtopics." (while (setq topic (pop alist)) (while (cdr topic) (if (and (cadr topic) - (gnus-gethash (cadr topic) gnus-newsrc-hashtb)) + (gnus-group-entry (cadr topic))) (setq topic (cdr topic)) (setcdr topic (cddr topic))))))) @@ -887,7 +887,7 @@ articles in the topic and its subtopics." (let ((topic-name (pop topic)) group filtered-topic) (while (setq group (pop topic)) - (when (and (or (gnus-gethash group gnus-active-hashtb) + (when (and (or (gnus-active group) (gnus-info-method (gnus-get-info group))) (not (gnus-gethash group gnus-killed-hashtb))) (push group filtered-topic))) diff --git a/lisp/gnus.el b/lisp/gnus.el index 94f5eb4..457c867 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -3301,7 +3301,7 @@ that that variable is buffer-local to the summary buffers." (defun gnus-generate-new-group-name (leaf) (let ((name leaf) (num 0)) - (while (gnus-gethash name gnus-newsrc-hashtb) + (while (gnus-group-entry name) (setq name (concat leaf "<" (int-to-string (setq num (1+ num))) ">"))) name)) diff --git a/lisp/nnkiboze.el b/lisp/nnkiboze.el index d522c55..6ab99dd 100644 --- a/lisp/nnkiboze.el +++ b/lisp/nnkiboze.el @@ -227,7 +227,7 @@ Finds out what articles are to be part of the nnkiboze groups." "." gnus-score-file-suffix)))))) (defun nnkiboze-generate-group (group &optional inhibit-list-groups) - (let* ((info (nth 2 (gnus-gethash group gnus-newsrc-hashtb))) + (let* ((info (gnus-get-info group)) (newsrc-file (concat nnkiboze-directory (nnheader-translate-file-chars (concat group ".newsrc")))) @@ -269,8 +269,7 @@ Finds out what articles are to be part of the nnkiboze groups." (numberp (car (symbol-value group))) ; It is active (or (> nnkiboze-level 7) (and (setq glevel - (nth 1 (nth 2 (gnus-gethash - gname gnus-newsrc-hashtb)))) + (gnus-info-level (gnus-get-info gname))) (>= nnkiboze-level glevel))) (not (string-match "^nnkiboze:" gname)) ; Exclude kibozes (push (cons gname (1- (car (symbol-value group)))) @@ -282,8 +281,7 @@ Finds out what articles are to be part of the nnkiboze groups." ;; number that has been kibozed in GROUP in this kiboze group. (setq newsrc nnkiboze-newsrc) (while newsrc - (if (not (setq active (gnus-gethash - (caar newsrc) gnus-active-hashtb))) + (if (not (setq active (gnus-active (caar newsrc)))) ;; This group isn't active after all, so we remove it from ;; the list of component groups. (setq nnkiboze-newsrc (delq (car newsrc) nnkiboze-newsrc)) @@ -294,8 +292,7 @@ Finds out what articles are to be part of the nnkiboze groups." (gnus-message 3 "nnkiboze: Checking %s..." (caar newsrc)) (setq ginfo (gnus-get-info (gnus-group-group-name)) orig-info (gnus-copy-sequence ginfo) - num-unread (car (gnus-gethash (caar newsrc) - gnus-newsrc-hashtb))) + num-unread (gnus-group-unread (caar newsrc))) (unwind-protect (progn ;; We set all list of article marks to nil. Since we operate @@ -338,8 +335,7 @@ Finds out what articles are to be part of the nnkiboze groups." ;; Restore the proper info. (when ginfo (setcdr ginfo (cdr orig-info))) - (setcar (gnus-gethash (caar newsrc) gnus-newsrc-hashtb) - num-unread))) + (setcar (gnus-group-entry (caar newsrc)) num-unread))) (setcdr (car newsrc) (cdr active)) (gnus-message 3 "nnkiboze: Checking %s...done" (caar newsrc)) (setq newsrc (cdr newsrc))))) diff --git a/lisp/nnvirtual.el b/lisp/nnvirtual.el index b008931..fc9f374 100644 --- a/lisp/nnvirtual.el +++ b/lisp/nnvirtual.el @@ -341,7 +341,7 @@ component group will show up when you enter the virtual group.") ;; Make sure all groups are activated. (mapcar (lambda (g) - (when (not (numberp (car (gnus-gethash g gnus-newsrc-hashtb)))) + (when (not (numberp (gnus-group-unread g))) (gnus-activate-group g))) nnvirtual-component-groups) (save-excursion