Give a final warning after startup.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 26 Sep 2010 17:36:20 +0000 (19:36 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 26 Sep 2010 17:36:20 +0000 (19:36 +0200)
lisp/ChangeLog
lisp/gnus-util.el
lisp/gnus.el

index 629f4c4..82a2dbe 100644 (file)
@@ -1,5 +1,11 @@
 2010-09-26  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus.el (gnus): Give a final warning after startup.
+
+       * gnus-util.el (gnus-action-message-log): New variable.
+       (gnus-message): Use it.
+       (gnus-final-warning): New function.
+
        * nnimap.el (nnimap-open-connection): Record the greeting.
        (nnimap): Add greeting.
 
index ead48f4..5ebccc0 100644 (file)
@@ -601,6 +601,8 @@ but also to the ones displayed in the echo area."
                 (t
                  (apply 'message ,format-string ,args))))))))
 
+(defvar gnus-action-message-log nil)
+
 (defun gnus-message-with-timestamp (format-string &rest args)
   "Display message with timestamp.  Arguments are the same as `message'.
 The `gnus-add-timestamp-to-message' variable controls how to add
@@ -615,14 +617,26 @@ Guideline for numbers:
 that take a long time, 7 - not very important messages on stuff, 9 - messages
 inside loops."
   (if (<= level gnus-verbose)
-      (if gnus-add-timestamp-to-message
-         (apply 'gnus-message-with-timestamp args)
-       (apply 'message args))
+      (let ((message
+            (if gnus-add-timestamp-to-message
+                (apply 'gnus-message-with-timestamp args)
+              (apply 'message args))))
+       (when (and (consp gnus-action-message-log)
+                  (<= level 3))
+         (push message gnus-action-message-log))
+       message)
     ;; We have to do this format thingy here even if the result isn't
     ;; shown - the return value has to be the same as the return value
     ;; from `message'.
     (apply 'format args)))
 
+(defun gnus-final-warning ()
+  (when (and (consp gnus-action-message-log)
+            (setq gnus-action-message-log
+                  (delete nil gnus-action-message-log)))
+    (message "Warning: %s"
+            (mapconcat #'identity gnus-action-message-log "; "))))
+
 (defun gnus-error (level &rest args)
   "Beep an error if LEVEL is equal to or less than `gnus-verbose'.
 ARGS are passed to `message'."
index d823ec0..dafaafc 100644 (file)
@@ -4365,7 +4365,9 @@ prompt the user for the name of an NNTP server to use."
   (unless (byte-code-function-p (symbol-function 'gnus))
     (message "You should byte-compile Gnus")
     (sit-for 2))
-  (gnus-1 arg dont-connect slave))
+  (let ((gnus-action-message-log (list nil)))
+    (gnus-1 arg dont-connect slave)
+    (gnus-final-warning)))
 
 ;; Allow redefinition of Gnus functions.