comparison lisp/warnings.el @ 47109:796b2ef84d40

(warning-series): Now can be a marker, not an integer. (display-warning): Handle new value for warning-series.
author Richard M. Stallman <rms@gnu.org>
date Thu, 29 Aug 2002 16:46:11 +0000
parents fa2c544d95fd
children b4cd4023d957
comparison
equal deleted inserted replaced
47108:256bfac4f5b5 47109:796b2ef84d40
129 ;;; safely, testing the existing value, before they call one of the 129 ;;; safely, testing the existing value, before they call one of the
130 ;;; warnings functions. 130 ;;; warnings functions.
131 ;;;###autoload 131 ;;;###autoload
132 (defvar warning-series nil 132 (defvar warning-series nil
133 "Non-nil means treat multiple `display-warning' calls as a series. 133 "Non-nil means treat multiple `display-warning' calls as a series.
134 An integer is a position in the warnings buffer 134 A marker indicates a position in the warnings buffer
135 which is the start of the current series. 135 which is the start of the current series; it means that
136 t means the next warning begins a series (and stores an integer here). 136 additional warnings in the same buffer should not move point.
137 t means the next warning begins a series (and stores a marker here).
137 A symbol with a function definition is like t, except 138 A symbol with a function definition is like t, except
138 also call that function before the next warning.") 139 also call that function before the next warning.")
139 (put 'warning-series 'risky-local-variable t) 140 (put 'warning-series 'risky-local-variable t)
140 141
141 ;;; The autoload cookie is so that programs can bind this variable 142 ;;; The autoload cookie is so that programs can bind this variable
225 start end) 226 start end)
226 (with-current-buffer buffer 227 (with-current-buffer buffer
227 (goto-char (point-max)) 228 (goto-char (point-max))
228 (when (and warning-series (symbolp warning-series)) 229 (when (and warning-series (symbolp warning-series))
229 (setq warning-series 230 (setq warning-series
230 (prog1 (point) 231 (prog1 (point-marker)
231 (unless (eq warning-series t) 232 (unless (eq warning-series t)
232 (funcall warning-series))))) 233 (funcall warning-series)))))
233 (unless (bolp) 234 (unless (bolp)
234 (newline)) 235 (newline))
235 (setq start (point)) 236 (setq start (point))
243 (when (and warning-fill-prefix (not (string-match "\n" message))) 244 (when (and warning-fill-prefix (not (string-match "\n" message)))
244 (let ((fill-prefix warning-fill-prefix) 245 (let ((fill-prefix warning-fill-prefix)
245 (fill-column 78)) 246 (fill-column 78))
246 (fill-region start (point)))) 247 (fill-region start (point))))
247 (setq end (point)) 248 (setq end (point))
248 (when warning-series 249 (when (and (markerp warning-series)
250 (eq (marker-buffer warning-series) buffer))
249 (goto-char warning-series))) 251 (goto-char warning-series)))
250 (if (nth 2 level-info) 252 (if (nth 2 level-info)
251 (funcall (nth 2 level-info))) 253 (funcall (nth 2 level-info)))
252 (if noninteractive 254 (if noninteractive
253 ;; Noninteractively, take the text we inserted 255 ;; Noninteractively, take the text we inserted
260 ;; immediate display. 262 ;; immediate display.
261 (or (< (warning-numeric-level level) 263 (or (< (warning-numeric-level level)
262 (warning-numeric-level warning-minimum-level)) 264 (warning-numeric-level warning-minimum-level))
263 (warning-suppress-p group warning-suppress-types) 265 (warning-suppress-p group warning-suppress-types)
264 (let ((window (display-buffer buffer))) 266 (let ((window (display-buffer buffer)))
265 (when warning-series 267 (when (and (markerp warning-series)
268 (eq (marker-buffer warning-series) buffer))
266 (set-window-start window warning-series)) 269 (set-window-start window warning-series))
267 (sit-for 0))))))) 270 (sit-for 0)))))))
268 271
269 ;;;###autoload 272 ;;;###autoload
270 (defun lwarn (group level message &rest args) 273 (defun lwarn (group level message &rest args)