Synch to No Gnus 200411040624.
[elisp/gnus.git-] / lisp / gnus-start.el
index e940a43..e217f8c 100644 (file)
@@ -305,6 +305,7 @@ claim them."
 (defcustom gnus-subscribe-newsgroup-hooks nil
   "*Hooks run after you subscribe to a new group.
 The hooks will be called with new group's name as argument."
+  :version "21.4"
   :group 'gnus-group-new
   :type 'hook)
 
@@ -411,6 +412,7 @@ This hook is called as the first thing when Gnus is started."
 
 (defcustom gnus-get-top-new-news-hook nil
   "A hook run just before Gnus checks for new news globally."
+  :version "21.4"
   :group 'gnus-group-new
   :type 'hook)
 
@@ -3287,21 +3289,39 @@ Would otherwise be an alias for `display-time-event-handler'." nil))))
 
 (defun gnus-check-reasonable-setup ()
   ;; Check whether nnml and nnfolder share a directory.
-  (let ((actives nil))
+  (let ((display-warn
+        (if (fboundp 'display-warning)
+            'display-warning
+          (lambda (type message)
+            (if noninteractive
+                (message "Warning (%s): %s" type message)
+              (let (window)
+                (with-current-buffer (get-buffer-create "*Warnings*")
+                  (goto-char (point-max))
+                  (unless (bolp)
+                    (insert "\n"))
+                  (insert (format "Warning (%s): %s\n" type message))
+                  (setq window (display-buffer (current-buffer)))
+                  (set-window-start
+                   window
+                   (prog2
+                       (forward-line (- 1 (window-height window)))
+                       (point)
+                     (goto-char (point-max))))))))))
+       method active actives match)
     (dolist (server gnus-server-alist)
-      (let* ((method (gnus-server-to-method server))
-            (active (intern (format "%s-active-file" (car method))))
-            match)
-       (when (and (member (car method) '(nnml nnfolder))
-                  (gnus-server-opened method)
-                  (boundp active))
-         (when (setq match (assoc (symbol-value active) actives))
-           (display-warning
-            :warning (format "%s and %s share the same active file %s"
-                             (car method)
-                             (cadr match)
-                             (car match))))
-         (push (list (symbol-value active) method) actives))))))
+      (setq method (gnus-server-to-method server)
+           active (intern (format "%s-active-file" (car method))))
+      (when (and (member (car method) '(nnml nnfolder))
+                (gnus-server-opened method)
+                (boundp active))
+       (when (setq match (assoc (symbol-value active) actives))
+         (funcall display-warn 'gnus-server
+                  (format "%s and %s share the same active file %s"
+                          (car method)
+                          (cadr match)
+                          (car match))))
+       (push (list (symbol-value active) method) actives)))))
 
 (provide 'gnus-start)