diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2011-04-28 21:35:20 +0200 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2011-04-28 21:35:20 +0200 |
commit | 638f053a0eb0c69390c29346ac465f30abd80a88 (patch) | |
tree | c15ffc9513f1c0dde205dad566573b7b990e0ca8 /lisp/subr.el | |
parent | f042970d4c3c5b93ce302a6447b7b998649325f5 (diff) | |
download | emacs-638f053a0eb0c69390c29346ac465f30abd80a88.tar.gz |
Add delayed warnings support.
* etc/NEWS: Document `delayed-warnings-list' and `delayed-warnings-hook'.
* lisp/subr.el (display-delayed-warnings): New function.
(delayed-warnings-hook): New variable.
* src/keyboard.c (Qdelayed_warnings_hook): Define.
(command_loop_1): Run `delayed-warnings-hook' if Vdelayed_warnings_list
is non-nil.
(syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
(syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r-- | lisp/subr.el | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index e374b56d2a8..7f0066548a4 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1772,6 +1772,19 @@ This makes or adds to an entry on `after-load-alist'. FILE should be the name of a library, with no directory name." (eval-after-load file (read))) (make-obsolete 'eval-next-after-load `eval-after-load "23.2") + +(defun display-delayed-warnings () + "Display delayed warnings from `delayed-warnings-list'. +This is the default value of `delayed-warnings-hook'." + (dolist (warning (nreverse delayed-warnings-list)) + (apply 'display-warning warning)) + (setq delayed-warnings-list nil)) + +(defvar delayed-warnings-hook '(display-delayed-warnings) + "Normal hook run to process delayed warnings. +Functions in this hook should access the `delayed-warnings-list' +variable (which see) and remove from it the warnings they process.") + ;;;; Process stuff. @@ -2522,7 +2535,7 @@ Note: :data and :device are currently not supported on Windows." (concat "\"" result (substring argument start) "\""))) ((and (eq system-type 'windows-nt) (w32-shell-dos-semantics)) - + ;; First, quote argument so that CommandLineToArgvW will ;; understand it. See ;; http://msdn.microsoft.com/en-us/library/17w5ykft%28v=vs.85%29.aspx |