diff options
| author | Juanma Barranquero | 2012-01-23 02:10:50 +0100 |
|---|---|---|
| committer | Juanma Barranquero | 2012-01-23 02:10:50 +0100 |
| commit | d1a5c3b45081c237658c6f6b74bbd6bc986acb60 (patch) | |
| tree | bed862c67fda5e5450fbfcc1be0945d826145054 | |
| parent | a5509865d7a0dd40bfb6217693ca2684a517d6d0 (diff) | |
| download | emacs-d1a5c3b45081c237658c6f6b74bbd6bc986acb60.tar.gz emacs-d1a5c3b45081c237658c6f6b74bbd6bc986acb60.zip | |
lisp/subr.el (display-delayed-warnings): Collapse identical adjacent messages.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/subr.el | 15 |
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 @@ | |||
| 1 | 2012-01-23 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * subr.el (display-delayed-warnings): | ||
| 4 | Collapse identical adjacent messages. | ||
| 5 | |||
| 1 | 2012-01-22 Michael Albinus <michael.albinus@gmx.de> | 6 | 2012-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'. |
| 1860 | Collapse identical adjacent messages into one (plus count). | ||
| 1860 | This is the default value of `delayed-warnings-hook'." | 1861 | This 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) |