]> git.eshelyaron.com Git - emacs.git/commitdiff
lisp/subr.el (display-delayed-warnings): Collapse identical adjacent messages.
authorJuanma Barranquero <lekktu@gmail.com>
Mon, 23 Jan 2012 01:10:50 +0000 (02:10 +0100)
committerJuanma Barranquero <lekktu@gmail.com>
Mon, 23 Jan 2012 01:10:50 +0000 (02:10 +0100)
lisp/ChangeLog
lisp/subr.el

index 8ada003d23dd25b13eeb1f64b2a237e077a9d388..ff2b4b5f226b4badcd021e010f4c73a5933c4401 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-23  Juanma Barranquero  <lekktu@gmail.com>
+
+       * subr.el (display-delayed-warnings):
+       Collapse identical adjacent messages.
+
 2012-01-22  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp.el (tramp-action-login): Set connection property "login-as".
index 14f9192405c34014e4c96c80fbc995c40251b605..da11b7e982a560f32da9cb1169283d27f6a3aee7 100644 (file)
@@ -1857,9 +1857,20 @@ FILE should be the name of a library, with no directory name."
 
 (defun display-delayed-warnings ()
   "Display delayed warnings from `delayed-warnings-list'.
+Collapse identical adjacent messages into one (plus count).
 This is the default value of `delayed-warnings-hook'."
-  (dolist (warning (nreverse delayed-warnings-list))
-    (apply 'display-warning warning))
+  (let ((count 1)
+        (warnings (nreverse delayed-warnings-list))
+        warning)
+    (while warnings
+      (setq warning (pop warnings))
+      (if (equal warning (car warnings))
+          (setq count (1+ count))
+        (when (> count 1)
+          (setcdr warning (cons (format "%s [%d times]" (cadr warning) count)
+                                (cddr warning)))
+          (setq count 1))
+        (apply 'display-warning warning))))
   (setq delayed-warnings-list nil))
 
 (defvar delayed-warnings-hook '(display-delayed-warnings)