aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp/warnings.el
diff options
context:
space:
mode:
authorChong Yidong <[email protected]>2008-10-11 22:06:52 +0000
committerChong Yidong <[email protected]>2008-10-11 22:06:52 +0000
commitc4795b11bc8e06e1d495b6937a7ceff844796848 (patch)
treef82a2d3d05a044bc3c50314cbf2244ee07ee97e5 /lisp/emacs-lisp/warnings.el
parentf76103b7405ce6f5c0cdc27e7dae6e20d547a751 (diff)
(display-warning): Issue a message if called during daemon
initialization.
Diffstat (limited to 'lisp/emacs-lisp/warnings.el')
-rw-r--r--lisp/emacs-lisp/warnings.el35
1 files changed, 23 insertions, 12 deletions
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index a6c77d4c5a..fdfe8a9efd 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -268,7 +268,7 @@ See also `warning-series', `warning-prefix-function' and
(goto-char warning-series)))
(if (nth 2 level-info)
(funcall (nth 2 level-info)))
- (if noninteractive
+ (cond (noninteractive
;; Noninteractively, take the text we inserted
;; in the warnings buffer and print it.
;; Do this unconditionally, since there is no way
@@ -280,17 +280,28 @@ See also `warning-series', `warning-prefix-function' and
(goto-char end)
(if (bolp)
(forward-char -1))
- (message "%s" (buffer-substring start (point)))))
- ;; Interactively, decide whether the warning merits
- ;; immediate display.
- (or (< (warning-numeric-level level)
- (warning-numeric-level warning-minimum-level))
- (warning-suppress-p type warning-suppress-types)
- (let ((window (display-buffer buffer)))
- (when (and (markerp warning-series)
- (eq (marker-buffer warning-series) buffer))
- (set-window-start window warning-series))
- (sit-for 0)))))))
+ (message "%s" (buffer-substring start (point))))))
+ ((and (daemonp) (null after-init-time))
+ ;; Warnings assigned during daemon initialization go into
+ ;; the messages buffer.
+ (message "%s"
+ (with-current-buffer buffer
+ (save-excursion
+ (goto-char end)
+ (if (bolp)
+ (forward-char -1))
+ (buffer-substring start (point))))))
+ (t
+ ;; Interactively, decide whether the warning merits
+ ;; immediate display.
+ (or (< (warning-numeric-level level)
+ (warning-numeric-level warning-minimum-level))
+ (warning-suppress-p type warning-suppress-types)
+ (let ((window (display-buffer buffer)))
+ (when (and (markerp warning-series)
+ (eq (marker-buffer warning-series) buffer))
+ (set-window-start window warning-series))
+ (sit-for 0))))))))
;;;###autoload
(defun lwarn (type level message &rest args)