T-gnus 6.14.6; synch up with Gnus v5.8.8.
[elisp/gnus.git-] / lisp / gnus-start.el
index 30937a7..a536302 100644 (file)
@@ -641,6 +641,7 @@ the first newsgroup."
        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.
@@ -698,7 +699,7 @@ prompt the user for the name of an NNTP server to use."
     (when gnus-simple-splash
       (setq gnus-simple-splash nil)
       (cond
-       (gnus-xemacs
+       ((featurep 'xemacs)
        (gnus-xmas-splash))
        ((and (eq window-system 'x)
             (= (frame-height) (1+ (window-height))))
@@ -1133,29 +1134,30 @@ for new groups, and subscribe the new groups as zombies."
 
 (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)
@@ -1166,18 +1168,17 @@ for new groups, and subscribe the new groups as zombies."
                (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
@@ -1406,7 +1407,9 @@ newsgroup."
         (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
@@ -1759,7 +1762,9 @@ newsgroup."
              (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)
@@ -2066,26 +2071,32 @@ The backup file \".newsrc.eld_\" will be created before re-reading."
 
 (defun gnus-product-read-variable-file-1 (file checking-methods coding
                                               &rest variables)
-  (let (gnus-product-file-version method file-ver)
-    (if (or (condition-case err
-               (let ((coding-system-for-read coding)
-                     (input-coding-system coding))
-                 (load (expand-file-name file gnus-product-directory) t t t)
-                 nil)
-             (error (message "%s" err)))
-           (and (assq 'emacs-version checking-methods)
-                (not (string= emacs-version
-                              (cdr (assq 'emacs-version
-                                         gnus-product-file-version)))))
-           (and (setq method (assq 'product-version checking-methods))
-                (or (not (setq file-ver
-                               (cdr (assq 'product-version
-                                          gnus-product-file-version))))
-                    (< (product-version-compare file-ver (cadr method)) 0))))
-       (while variables
-         (set (car variables) nil)
-         (gnus-product-variable-touch (car variables))
-         (setq variables (cdr variables))))))
+  (let (error gnus-product-file-version method file-ver)
+    (when (or
+          (condition-case err
+              (let ((coding-system-for-read coding)
+                    (input-coding-system coding))
+                (load (expand-file-name file gnus-product-directory) t nil t)
+                nil)
+            (error
+             (message "%s" err)
+             (setq error t)))
+          (and (assq 'emacs-version checking-methods)
+               (not (string= emacs-version
+                             (cdr (assq 'emacs-version
+                                        gnus-product-file-version)))))
+          (and (setq method (assq 'product-version checking-methods))
+               (or (not (setq file-ver
+                              (cdr (assq 'product-version
+                                         gnus-product-file-version))))
+                   (< (product-version-compare file-ver (cadr method)) 0))))
+      (unless error
+       (message "\"%s\" seems to have mismatched contents, updating..."
+                file))
+      (while variables
+       (set (car variables) nil)
+       (gnus-product-variable-touch (car variables))
+       (setq variables (cdr variables))))))
 
 ;; Parse the old-style quick startup file
 (defun gnus-read-old-newsrc-el-file (file)
@@ -2762,7 +2773,7 @@ The backup file \".newsrc.eld_\" will be created before re-reading."
              (let ((str (buffer-substring
                          (point) (progn (end-of-line) (point))))
                    (coding
-                    (and (or gnus-xemacs
+                    (and (or (featurep 'xemacs)
                              (and (boundp 'enable-multibyte-characters)
                                   enable-multibyte-characters))
                          (fboundp 'gnus-mule-get-coding-system)