comparison lisp/gnus/gnus-start.el @ 111243:0989a3a741bd

gnus-start.el (gnus-find-new-newsgroups): Remove gnus-check-first-time-used. gnus.el: Remove gnus-backup-default-subscribed-newsgroups. gnus-group.el: Remove gnus-group-fetch-control.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sat, 30 Oct 2010 15:01:14 +0000
parents d66d04803828
children 0c7c9736f766
comparison
equal deleted inserted replaced
111242:4ec0d0a0569f 111243:0989a3a741bd
1098 ((= (or arg 1) 16) 1098 ((= (or arg 1) 16)
1099 (setq gnus-subscribe-newsgroup-method 1099 (setq gnus-subscribe-newsgroup-method
1100 'gnus-subscribe-zombies) 1100 'gnus-subscribe-zombies)
1101 t) 1101 t)
1102 (t gnus-check-new-newsgroups)))) 1102 (t gnus-check-new-newsgroups))))
1103 (unless (gnus-check-first-time-used) 1103 (if (or (consp check)
1104 (if (or (consp check) 1104 (eq check 'ask-server))
1105 (eq check 'ask-server)) 1105 ;; Ask the server for new groups.
1106 ;; Ask the server for new groups. 1106 (gnus-ask-server-for-new-groups)
1107 (gnus-ask-server-for-new-groups) 1107 ;; Go through the active hashtb and look for new groups.
1108 ;; Go through the active hashtb and look for new groups. 1108 (let ((groups 0)
1109 (let ((groups 0) 1109 group new-newsgroups)
1110 group new-newsgroups) 1110 (gnus-message 5 "Looking for new newsgroups...")
1111 (gnus-message 5 "Looking for new newsgroups...") 1111 (unless gnus-have-read-active-file
1112 (unless gnus-have-read-active-file 1112 (gnus-read-active-file))
1113 (gnus-read-active-file)) 1113 (setq gnus-newsrc-last-checked-date (message-make-date))
1114 (setq gnus-newsrc-last-checked-date (message-make-date)) 1114 (unless gnus-killed-hashtb
1115 (unless gnus-killed-hashtb 1115 (gnus-make-hashtable-from-killed))
1116 (gnus-make-hashtable-from-killed)) 1116 ;; Go though every newsgroup in `gnus-active-hashtb' and compare
1117 ;; Go though every newsgroup in `gnus-active-hashtb' and compare 1117 ;; with `gnus-newsrc-hashtb' and `gnus-killed-hashtb'.
1118 ;; with `gnus-newsrc-hashtb' and `gnus-killed-hashtb'. 1118 (mapatoms
1119 (mapatoms 1119 (lambda (sym)
1120 (lambda (sym) 1120 (if (or (null (setq group (symbol-name sym)))
1121 (if (or (null (setq group (symbol-name sym))) 1121 (not (boundp sym))
1122 (not (boundp sym)) 1122 (null (symbol-value sym))
1123 (null (symbol-value sym)) 1123 (gnus-gethash group gnus-killed-hashtb)
1124 (gnus-gethash group gnus-killed-hashtb) 1124 (gnus-gethash group gnus-newsrc-hashtb))
1125 (gnus-gethash group gnus-newsrc-hashtb)) 1125 ()
1126 () 1126 (let ((do-sub (gnus-matches-options-n group)))
1127 (let ((do-sub (gnus-matches-options-n group))) 1127 (cond
1128 (cond 1128 ((eq do-sub 'subscribe)
1129 ((eq do-sub 'subscribe) 1129 (setq groups (1+ groups))
1130 (setq groups (1+ groups)) 1130 (gnus-sethash group group gnus-killed-hashtb)
1131 (gnus-sethash group group gnus-killed-hashtb) 1131 (gnus-call-subscribe-functions
1132 (gnus-call-subscribe-functions 1132 gnus-subscribe-options-newsgroup-method group))
1133 gnus-subscribe-options-newsgroup-method group)) 1133 ((eq do-sub 'ignore)
1134 ((eq do-sub 'ignore) 1134 nil)
1135 nil) 1135 (t
1136 (t 1136 (setq groups (1+ groups))
1137 (setq groups (1+ groups)) 1137 (gnus-sethash group group gnus-killed-hashtb)
1138 (gnus-sethash group group gnus-killed-hashtb) 1138 (if gnus-subscribe-hierarchical-interactive
1139 (if gnus-subscribe-hierarchical-interactive 1139 (push group new-newsgroups)
1140 (push group new-newsgroups) 1140 (gnus-call-subscribe-functions
1141 (gnus-call-subscribe-functions 1141 gnus-subscribe-newsgroup-method group)))))))
1142 gnus-subscribe-newsgroup-method group))))))) 1142 gnus-active-hashtb)
1143 gnus-active-hashtb) 1143 (when new-newsgroups
1144 (when new-newsgroups 1144 (gnus-subscribe-hierarchical-interactive new-newsgroups))
1145 (gnus-subscribe-hierarchical-interactive new-newsgroups)) 1145 (if (> groups 0)
1146 (if (> groups 0) 1146 (gnus-message 5 "%d new newsgroup%s arrived."
1147 (gnus-message 5 "%d new newsgroup%s arrived." 1147 groups (if (> groups 1) "s have" " has"))
1148 groups (if (> groups 1) "s have" " has")) 1148 (gnus-message 5 "No new newsgroups."))))))
1149 (gnus-message 5 "No new newsgroups.")))))))
1150 1149
1151 (defun gnus-matches-options-n (group) 1150 (defun gnus-matches-options-n (group)
1152 ;; Returns `subscribe' if the group is to be unconditionally 1151 ;; Returns `subscribe' if the group is to be unconditionally
1153 ;; subscribed, `ignore' if it is to be ignored, and nil if there is 1152 ;; subscribed, `ignore' if it is to be ignored, and nil if there is
1154 ;; no match for the group. 1153 ;; no match for the group.
1243 groups (if (> groups 1) "s have" " has")) 1242 groups (if (> groups 1) "s have" " has"))
1244 (gnus-message 5 "No new newsgroups")) 1243 (gnus-message 5 "No new newsgroups"))
1245 (when got-new 1244 (when got-new
1246 (setq gnus-newsrc-last-checked-date new-date)) 1245 (setq gnus-newsrc-last-checked-date new-date))
1247 got-new)) 1246 got-new))
1248
1249 (defun gnus-check-first-time-used ()
1250 (catch 'ended
1251 ;; First check if any of the following files exist. If they do,
1252 ;; it's not the first time the user has used Gnus.
1253 (dolist (file (list (concat gnus-current-startup-file ".el")
1254 (concat gnus-current-startup-file ".eld")
1255 (concat gnus-startup-file ".el")
1256 (concat gnus-startup-file ".eld")))
1257 (when (file-exists-p file)
1258 (throw 'ended nil)))
1259 (gnus-message 6 "First time user; subscribing you to default groups")
1260 (unless (gnus-read-active-file-p)
1261 (let ((gnus-read-active-file t))
1262 (gnus-read-active-file)))
1263 (setq gnus-newsrc-last-checked-date (message-make-date))
1264 ;; Subscribe to the default newsgroups.
1265 (let ((groups (or gnus-default-subscribed-newsgroups
1266 gnus-backup-default-subscribed-newsgroups))
1267 group)
1268 (if (eq groups t)
1269 ;; If t, we subscribe (or not) all groups as if they were new.
1270 (mapatoms
1271 (lambda (sym)
1272 (when (setq group (symbol-name sym))
1273 (let ((do-sub (gnus-matches-options-n group)))
1274 (cond
1275 ((eq do-sub 'subscribe)
1276 (gnus-sethash group group gnus-killed-hashtb)
1277 (gnus-call-subscribe-functions
1278 gnus-subscribe-options-newsgroup-method group))
1279 ((eq do-sub 'ignore)
1280 nil)
1281 (t
1282 (push group gnus-killed-list))))))
1283 gnus-active-hashtb)
1284 (dolist (group groups)
1285 ;; Only subscribe the default groups that are activated.
1286 (when (gnus-active group)
1287 (gnus-group-change-level
1288 group gnus-level-default-subscribed gnus-level-killed)))
1289 (with-current-buffer gnus-group-buffer
1290 ;; Don't error if the group already exists. This happens when a
1291 ;; first-time user types 'F'. -- didier
1292 (gnus-group-make-help-group t))
1293 (when gnus-novice-user
1294 (gnus-message 7 "`A k' to list killed groups"))))))
1295 1247
1296 (defun gnus-subscribe-group (group &optional previous method) 1248 (defun gnus-subscribe-group (group &optional previous method)
1297 "Subscribe GROUP and put it after PREVIOUS." 1249 "Subscribe GROUP and put it after PREVIOUS."
1298 (gnus-group-change-level 1250 (gnus-group-change-level
1299 (if method 1251 (if method