aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-10-11 22:06:52 +0000
committerChong Yidong2008-10-11 22:06:52 +0000
commitc4795b11bc8e06e1d495b6937a7ceff844796848 (patch)
treef82a2d3d05a044bc3c50314cbf2244ee07ee97e5
parentf76103b7405ce6f5c0cdc27e7dae6e20d547a751 (diff)
downloademacs-c4795b11bc8e06e1d495b6937a7ceff844796848.tar.gz
emacs-c4795b11bc8e06e1d495b6937a7ceff844796848.zip
(display-warning): Issue a message if called during daemon
initialization.
-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 a6c77d4c5a0..fdfe8a9efd0 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
268 (goto-char warning-series))) 268 (goto-char warning-series)))
269 (if (nth 2 level-info) 269 (if (nth 2 level-info)
270 (funcall (nth 2 level-info))) 270 (funcall (nth 2 level-info)))
271 (if noninteractive 271 (cond (noninteractive
272 ;; Noninteractively, take the text we inserted 272 ;; Noninteractively, take the text we inserted
273 ;; in the warnings buffer and print it. 273 ;; in the warnings buffer and print it.
274 ;; Do this unconditionally, since there is no way 274 ;; Do this unconditionally, since there is no way
@@ -280,17 +280,28 @@ See also `warning-series', `warning-prefix-function' and
280 (goto-char end) 280 (goto-char end)
281 (if (bolp) 281 (if (bolp)
282 (forward-char -1)) 282 (forward-char -1))
283 (message "%s" (buffer-substring start (point))))) 283 (message "%s" (buffer-substring start (point))))))
284 ;; Interactively, decide whether the warning merits 284 ((and (daemonp) (null after-init-time))
285 ;; immediate display. 285 ;; Warnings assigned during daemon initialization go into
286 (or (< (warning-numeric-level level) 286 ;; the messages buffer.
287 (warning-numeric-level warning-minimum-level)) 287 (message "%s"
288 (warning-suppress-p type warning-suppress-types) 288 (with-current-buffer buffer
289 (let ((window (display-buffer buffer))) 289 (save-excursion
290 (when (and (markerp warning-series) 290 (goto-char end)
291 (eq (marker-buffer warning-series) buffer)) 291 (if (bolp)
292 (set-window-start window warning-series)) 292 (forward-char -1))
293 (sit-for 0))))))) 293 (buffer-substring start (point))))))
294 (t
295 ;; Interactively, decide whether the warning merits
296 ;; immediate display.
297 (or (< (warning-numeric-level level)
298 (warning-numeric-level warning-minimum-level))
299 (warning-suppress-p type warning-suppress-types)
300 (let ((window (display-buffer buffer)))
301 (when (and (markerp warning-series)
302 (eq (marker-buffer warning-series) buffer))
303 (set-window-start window warning-series))
304 (sit-for 0))))))))
294 305
295;;;###autoload 306;;;###autoload
296(defun lwarn (type level message &rest args) 307(defun lwarn (type level message &rest args)