comparison lisp/emacs-lisp/warnings.el @ 63537:5bcd8e3411e3

(display-warning, lwarn, warning-minimum-log-level): Doc fixes. (warning-minimum-level, warning-minimum-log-level): Add :debug to defcustom's choices.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 17 Jun 2005 11:47:31 +0000
parents aac0a33f5772
children 18a818a2ee7c b7da78284d4c
comparison
equal deleted inserted replaced
63536:c5eb082e2743 63537:5bcd8e3411e3
74 "Minimum severity level for displaying the warning buffer. 74 "Minimum severity level for displaying the warning buffer.
75 If a warning's severity level is lower than this, 75 If a warning's severity level is lower than this,
76 the warning is logged in the warnings buffer, but the buffer 76 the warning is logged in the warnings buffer, but the buffer
77 is not immediately displayed. See also `warning-minimum-log-level'." 77 is not immediately displayed. See also `warning-minimum-log-level'."
78 :group 'warnings 78 :group 'warnings
79 :type '(choice (const :emergency) (const :error) (const :warning)) 79 :type '(choice (const :emergency) (const :error)
80 (const :warning) (const :debug))
80 :version "22.1") 81 :version "22.1")
81 (defvaralias 'display-warning-minimum-level 'warning-minimum-level) 82 (defvaralias 'display-warning-minimum-level 'warning-minimum-level)
82 83
83 (defcustom warning-minimum-log-level :warning 84 (defcustom warning-minimum-log-level :warning
84 "Minimum severity level for logging a warning. 85 "Minimum severity level for logging a warning.
85 If a warning severity level is lower than this, 86 If a warning severity level is lower than this,
86 the warning is completely ignored." 87 the warning is completely ignored.
88 Value must be lower or equal than `warning-minimum-level',
89 because warnings not logged aren't displayed either."
87 :group 'warnings 90 :group 'warnings
88 :type '(choice (const :emergency) (const :error) (const :warning)) 91 :type '(choice (const :emergency) (const :error)
92 (const :warning) (const :debug))
89 :version "22.1") 93 :version "22.1")
90 (defvaralias 'log-warning-minimum-level 'warning-minimum-log-level) 94 (defvaralias 'log-warning-minimum-level 'warning-minimum-log-level)
91 95
92 (defcustom warning-suppress-log-types nil 96 (defcustom warning-suppress-log-types nil
93 "List of warning types that should not be logged. 97 "List of warning types that should not be logged.
201 TYPE is the warning type: either a custom group name (a symbol), 205 TYPE is the warning type: either a custom group name (a symbol),
202 or a list of symbols whose first element is a custom group name. 206 or a list of symbols whose first element is a custom group name.
203 \(The rest of the symbols represent subcategories, for warning purposes 207 \(The rest of the symbols represent subcategories, for warning purposes
204 only, and you can use whatever symbols you like.) 208 only, and you can use whatever symbols you like.)
205 209
206 LEVEL should be either :warning, :error, or :emergency. 210 LEVEL should be either :debug, :warning, :error, or :emergency
211 \(but see `warning-minimum-level' and `warning-minimum-log-level').
212
207 :emergency -- a problem that will seriously impair Emacs operation soon 213 :emergency -- a problem that will seriously impair Emacs operation soon
208 if you do not attend to it promptly. 214 if you do not attend to it promptly.
209 :error -- data or circumstances that are inherently wrong. 215 :error -- data or circumstances that are inherently wrong.
210 :warning -- data or circumstances that are not inherently wrong, 216 :warning -- data or circumstances that are not inherently wrong,
211 but raise suspicion of a possible problem. 217 but raise suspicion of a possible problem.
221 (unless level 227 (unless level
222 (setq level :warning)) 228 (setq level :warning))
223 (if (assq level warning-level-aliases) 229 (if (assq level warning-level-aliases)
224 (setq level (cdr (assq level warning-level-aliases)))) 230 (setq level (cdr (assq level warning-level-aliases))))
225 (or (< (warning-numeric-level level) 231 (or (< (warning-numeric-level level)
226 (warning-numeric-level warning-minimum-log-level)) 232 (warning-numeric-level warning-minimum-log-level))
227 (warning-suppress-p type warning-suppress-log-types) 233 (warning-suppress-p type warning-suppress-log-types)
228 (let* ((typename (if (consp type) (car type) type)) 234 (let* ((typename (if (consp type) (car type) type))
229 (buffer (get-buffer-create (or buffer-name "*Warnings*"))) 235 (buffer (get-buffer-create (or buffer-name "*Warnings*")))
230 (level-info (assq level warning-levels)) 236 (level-info (assq level warning-levels))
231 start end) 237 start end)
289 TYPE is the warning type: either a custom group name (a symbol). 295 TYPE is the warning type: either a custom group name (a symbol).
290 or a list of symbols whose first element is a custom group name. 296 or a list of symbols whose first element is a custom group name.
291 \(The rest of the symbols represent subcategories and 297 \(The rest of the symbols represent subcategories and
292 can be whatever you like.) 298 can be whatever you like.)
293 299
294 LEVEL should be either :warning, :error, or :emergency. 300 LEVEL should be either :debug, :warning, :error, or :emergency
301 \(but see `warning-minimum-level' and `warning-minimum-log-level').
302
295 :emergency -- a problem that will seriously impair Emacs operation soon 303 :emergency -- a problem that will seriously impair Emacs operation soon
296 if you do not attend to it promptly. 304 if you do not attend to it promptly.
297 :error -- invalid data or circumstances. 305 :error -- invalid data or circumstances.
298 :warning -- suspicious data or circumstances." 306 :warning -- suspicious data or circumstances.
307 :debug -- info for debugging only."
299 (display-warning type (apply 'format message args) level)) 308 (display-warning type (apply 'format message args) level))
300 309
301 ;;;###autoload 310 ;;;###autoload
302 (defun warn (message &rest args) 311 (defun warn (message &rest args)
303 "Display a warning message made from (format MESSAGE ARGS...). 312 "Display a warning message made from (format MESSAGE ARGS...).