aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2012-01-23 02:10:50 +0100
committerJuanma Barranquero2012-01-23 02:10:50 +0100
commitd1a5c3b45081c237658c6f6b74bbd6bc986acb60 (patch)
treebed862c67fda5e5450fbfcc1be0945d826145054
parenta5509865d7a0dd40bfb6217693ca2684a517d6d0 (diff)
downloademacs-d1a5c3b45081c237658c6f6b74bbd6bc986acb60.tar.gz
emacs-d1a5c3b45081c237658c6f6b74bbd6bc986acb60.zip
lisp/subr.el (display-delayed-warnings): Collapse identical adjacent messages.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/subr.el15
2 files changed, 18 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8ada003d23d..ff2b4b5f226 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-01-23 Juanma Barranquero <lekktu@gmail.com>
2
3 * subr.el (display-delayed-warnings):
4 Collapse identical adjacent messages.
5
12012-01-22 Michael Albinus <michael.albinus@gmx.de> 62012-01-22 Michael Albinus <michael.albinus@gmx.de>
2 7
3 * net/tramp.el (tramp-action-login): Set connection property "login-as". 8 * net/tramp.el (tramp-action-login): Set connection property "login-as".
diff --git a/lisp/subr.el b/lisp/subr.el
index 14f9192405c..da11b7e982a 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1857,9 +1857,20 @@ FILE should be the name of a library, with no directory name."
1857 1857
1858(defun display-delayed-warnings () 1858(defun display-delayed-warnings ()
1859 "Display delayed warnings from `delayed-warnings-list'. 1859 "Display delayed warnings from `delayed-warnings-list'.
1860Collapse identical adjacent messages into one (plus count).
1860This is the default value of `delayed-warnings-hook'." 1861This is the default value of `delayed-warnings-hook'."
1861 (dolist (warning (nreverse delayed-warnings-list)) 1862 (let ((count 1)
1862 (apply 'display-warning warning)) 1863 (warnings (nreverse delayed-warnings-list))
1864 warning)
1865 (while warnings
1866 (setq warning (pop warnings))
1867 (if (equal warning (car warnings))
1868 (setq count (1+ count))
1869 (when (> count 1)
1870 (setcdr warning (cons (format "%s [%d times]" (cadr warning) count)
1871 (cddr warning)))
1872 (setq count 1))
1873 (apply 'display-warning warning))))
1863 (setq delayed-warnings-list nil)) 1874 (setq delayed-warnings-list nil))
1864 1875
1865(defvar delayed-warnings-hook '(display-delayed-warnings) 1876(defvar delayed-warnings-hook '(display-delayed-warnings)