gnus-newsgroup-unreads nil
nnoo-state-alist nil
gnus-current-select-method nil
+ nnmail-split-history nil
gnus-ephemeral-servers nil)
(gnus-shutdown 'gnus)
;; Kill the startup file.
(defun gnus-check-first-time-used ()
(catch 'ended
- (let ((files (list gnus-current-startup-file
- (concat gnus-current-startup-file ".el")
- (concat gnus-current-startup-file ".eld")
- gnus-startup-file
- (concat gnus-startup-file ".el")
- (concat gnus-startup-file ".eld"))))
- (while files
- (when (file-exists-p (pop files))
- (throw 'ended nil))))
+ ;; First check if any of the following files exist. If they do,
+ ;; it's not the first time the user has used Gnus.
+ (dolist (file (list gnus-current-startup-file
+ (concat gnus-current-startup-file ".el")
+ (concat gnus-current-startup-file ".eld")
+ gnus-startup-file
+ (concat gnus-startup-file ".el")
+ (concat gnus-startup-file ".eld")))
+ (when (file-exists-p file)
+ (throw 'ended nil)))
(gnus-message 6 "First time user; subscribing you to default groups")
(unless (gnus-read-active-file-p)
(let ((gnus-read-active-file t))
(gnus-read-active-file)))
(setq gnus-newsrc-last-checked-date (current-time-string))
- (let ((groups gnus-default-subscribed-newsgroups)
+ ;; Subscribe to the default newsgroups.
+ (let ((groups (or gnus-default-subscribed-newsgroups
+ gnus-backup-default-subscribed-newsgroups))
group)
- (if (eq groups t)
- nil
- (setq groups (or groups gnus-backup-default-subscribed-newsgroups))
+ (when (eq groups t)
+ ;; If t, we subscribe (or not) all groups as if they were new.
(mapatoms
(lambda (sym)
- (if (null (setq group (symbol-name sym)))
- ()
+ (when (setq group (symbol-name sym))
(let ((do-sub (gnus-matches-options-n group)))
(cond
((eq do-sub 'subscribe)
(t
(push group gnus-killed-list))))))
gnus-active-hashtb)
- (while groups
- (when (gnus-active (car groups))
+ (dolist (group groups)
+ ;; Only subscribe the default groups that are activated.
+ (when (gnus-active group)
(gnus-group-change-level
- (car groups) gnus-level-default-subscribed gnus-level-killed))
- (setq groups (cdr groups)))
+ group gnus-level-default-subscribed gnus-level-killed)))
(save-excursion
(set-buffer gnus-group-buffer)
(gnus-group-make-help-group))
(when gnus-novice-user
(gnus-message 7 "`A k' to list killed groups"))))))
-
(defun gnus-subscribe-group (group &optional previous method)
"Subcribe GROUP and put it after PREVIOUS."
(gnus-group-change-level
(condition-case ()
(inline (gnus-request-group group dont-check method))
;;(error nil)
- (quit nil))
+ (quit
+ (message "Quit activating %s" group)
+ nil))
(setq active (gnus-parse-active))
;; If there are no articles in the group, the GROUP
;; command may have responded with the `(0 . 0)'. We
(setq method (gnus-server-get-method nil method)))))
(not (gnus-secondary-method-p method)))
;; These groups are foreign. Check the level.
- (when (<= (gnus-info-level info) foreign-level)
- (setq active (gnus-activate-group group 'scan))
+ (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 gnus-plugged active)
(gnus-agent-save-group-info
(setq active (gnus-activate-group group))
(setq active (gnus-activate-group group 'scan))
(push method scanned-methods))
- (inline (gnus-close-group group))))))
+ (when active
+ (gnus-close-group group))))))
;; Get the number of unread articles in the group.
(cond
(let* ((mg (pop retrievegroups))
(method (or (car mg) gnus-select-method))
(groups (cdr mg)))
- (gnus-check-server method)
- ;; Request that the backend scan its incoming messages.
- (when (gnus-check-backend-function 'request-scan (car method))
- (gnus-request-scan nil method))
- (gnus-read-active-file-2 (mapcar (lambda (group)
- (gnus-group-real-name group))
- groups) method)
- (dolist (group groups)
- (cond
- ((setq active (gnus-active (gnus-info-group
- (setq info (gnus-get-info group)))))
- (inline (gnus-get-unread-articles-in-group info active t)))
- (t
- ;; 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))))))
+ (when (gnus-check-server method)
+ ;; Request that the backend scan its incoming messages.
+ (when (gnus-check-backend-function 'request-scan (car method))
+ (gnus-request-scan nil method))
+ (gnus-read-active-file-2 (mapcar (lambda (group)
+ (gnus-group-real-name group))
+ groups) method)
+ (dolist (group groups)
+ (cond
+ ((setq active (gnus-active (gnus-info-group
+ (setq info (gnus-get-info group)))))
+ (inline (gnus-get-unread-articles-in-group info active t)))
+ (t
+ ;; 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)))))))
(gnus-message 5 "Checking new news...done")))
(gnus-read-active-file-1 method force)
;; We catch C-g so that we can continue past servers
;; that do not respond.
- (quit nil)))))))
+ (quit
+ (message "Quit reading the active file")
+ nil)))))))
(defun gnus-read-active-file-1 (method force)
(let (where mesg)
(make-temp-name (concat gnus-current-startup-file "-slave-")))
(modes (ignore-errors
(file-modes (concat gnus-current-startup-file ".eld")))))
- (gnus-write-buffer slave-name)
+ (gnus-write-buffer-as-coding-system
+ gnus-startup-file-coding-system slave-name)
(when modes
(set-file-modes slave-name modes)))))