[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/warnings.el
From: |
Richard M. Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/warnings.el |
Date: |
Tue, 05 Aug 2003 21:09:33 -0400 |
Index: emacs/lisp/emacs-lisp/warnings.el
diff -c emacs/lisp/emacs-lisp/warnings.el:1.1
emacs/lisp/emacs-lisp/warnings.el:1.2
*** emacs/lisp/emacs-lisp/warnings.el:1.1 Fri May 30 19:27:19 2003
--- emacs/lisp/emacs-lisp/warnings.el Tue Aug 5 21:09:33 2003
***************
*** 43,49 ****
Each element looks like (LEVEL STRING FUNCTION) and
defines LEVEL as a severity level. STRING specifies the
description of this level. STRING should use `%s' to
! specify where to put the warning group information,
or it can omit the `%s' so as not to include that information.
The optional FUNCTION, if non-nil, is a function to call
--- 43,49 ----
Each element looks like (LEVEL STRING FUNCTION) and
defines LEVEL as a severity level. STRING specifies the
description of this level. STRING should use `%s' to
! specify where to put the warning type information,
or it can omit the `%s' so as not to include that information.
The optional FUNCTION, if non-nil, is a function to call
***************
*** 91,116 ****
(defcustom warning-suppress-log-types nil
"List of warning types that should not be logged.
! If any element of this list matches the GROUP argument to `display-warning',
the warning is completely ignored.
! The element must match the first elements of GROUP.
Thus, (foo bar) as an element matches (foo bar)
! or (foo bar ANYTHING...) as GROUP.
! If GROUP is a symbol FOO, that is equivalent to the list (FOO),
so only the element (FOO) will match it."
:group 'warnings
:type '(repeat (repeat symbol))
:version "21.4")
(defcustom warning-suppress-types nil
! "Custom groups for warnings not to display immediately.
! If any element of this list matches the GROUP argument to `display-warning',
the warning is logged nonetheless, but the warnings buffer is
not immediately displayed.
! The element must match an initial segment of the list GROUP.
Thus, (foo bar) as an element matches (foo bar)
! or (foo bar ANYTHING...) as GROUP.
! If GROUP is a symbol FOO, that is equivalent to the list (FOO),
so only the element (FOO) will match it.
See also `warning-suppress-log-types'."
:group 'warnings
--- 91,116 ----
(defcustom warning-suppress-log-types nil
"List of warning types that should not be logged.
! If any element of this list matches the TYPE argument to `display-warning',
the warning is completely ignored.
! The element must match the first elements of TYPE.
Thus, (foo bar) as an element matches (foo bar)
! or (foo bar ANYTHING...) as TYPE.
! If TYPE is a symbol FOO, that is equivalent to the list (FOO),
so only the element (FOO) will match it."
:group 'warnings
:type '(repeat (repeat symbol))
:version "21.4")
(defcustom warning-suppress-types nil
! "List of warning types not to display immediately.
! If any element of this list matches the TYPE argument to `display-warning',
the warning is logged nonetheless, but the warnings buffer is
not immediately displayed.
! The element must match an initial segment of the list TYPE.
Thus, (foo bar) as an element matches (foo bar)
! or (foo bar ANYTHING...) as TYPE.
! If TYPE is a symbol FOO, that is equivalent to the list (FOO),
so only the element (FOO) will match it.
See also `warning-suppress-log-types'."
:group 'warnings
***************
*** 155,163 ****
;;; safely, testing the existing value, before they call one of the
;;; warnings functions.
;;;###autoload
! (defvar warning-group-format " (%s)"
! "Format for displaying the warning group in the warning message.
! The result of formatting the group this way gets included in the
message under the control of the string in `warning-levels'.")
(defun warning-numeric-level (level)
--- 155,163 ----
;;; safely, testing the existing value, before they call one of the
;;; warnings functions.
;;;###autoload
! (defvar warning-type-format " (%s)"
! "Format for displaying the warning type in the warning message.
! The result of formatting the type this way gets included in the
message under the control of the string in `warning-levels'.")
(defun warning-numeric-level (level)
***************
*** 166,184 ****
(link (memq elt warning-levels)))
(length link)))
! (defun warning-suppress-p (group suppress-list)
! "Non-nil if a warning with group GROUP should be suppressed.
SUPPRESS-LIST is the list of kinds of warnings to suppress."
(let (some-match)
(dolist (elt suppress-list)
! (if (symbolp group)
! ;; If GROUP is a symbol, the ELT must be (GROUP).
(if (and (consp elt)
! (eq (car elt) group)
(null (cdr elt)))
(setq some-match t))
! ;; If GROUP is a list, ELT must match it or some initial segment of it.
! (let ((tem1 group)
(tem2 elt)
(match t))
;; Check elements of ELT until we run out of them.
--- 166,184 ----
(link (memq elt warning-levels)))
(length link)))
! (defun warning-suppress-p (type suppress-list)
! "Non-nil if a warning with type TYPE should be suppressed.
SUPPRESS-LIST is the list of kinds of warnings to suppress."
(let (some-match)
(dolist (elt suppress-list)
! (if (symbolp type)
! ;; If TYPE is a symbol, the ELT must be (TYPE).
(if (and (consp elt)
! (eq (car elt) type)
(null (cdr elt)))
(setq some-match t))
! ;; If TYPE is a list, ELT must match it or some initial segment of it.
! (let ((tem1 type)
(tem2 elt)
(match t))
;; Check elements of ELT until we run out of them.
***************
*** 187,193 ****
(setq match nil))
(setq tem1 (cdr tem1)
tem2 (cdr tem2)))
! ;; If ELT is an initial segment of GROUP, MATCH is t now.
;; So set SOME-MATCH.
(if match
(setq some-match t)))))
--- 187,193 ----
(setq match nil))
(setq tem1 (cdr tem1)
tem2 (cdr tem2)))
! ;; If ELT is an initial segment of TYPE, MATCH is t now.
;; So set SOME-MATCH.
(if match
(setq some-match t)))))
***************
*** 196,205 ****
some-match))
;;;###autoload
! (defun display-warning (group message &optional level buffer-name)
"Display a warning message, MESSAGE.
! GROUP should be a custom group name (a symbol),
! or else a list of symbols whose first element is a custom group name.
\(The rest of the symbols represent subcategories, for warning purposes
only, and you can use whatever symbols you like.)
--- 196,205 ----
some-match))
;;;###autoload
! (defun display-warning (type message &optional level buffer-name)
"Display a warning message, MESSAGE.
! TYPE is the warning type: either a custom group name (a symbol),
! or a list of symbols whose first element is a custom group name.
\(The rest of the symbols represent subcategories, for warning purposes
only, and you can use whatever symbols you like.)
***************
*** 224,231 ****
(setq level (cdr (assq level warning-level-aliases))))
(or (< (warning-numeric-level level)
(warning-numeric-level warning-minimum-log-level))
! (warning-suppress-p group warning-suppress-log-types)
! (let* ((groupname (if (consp group) (car group) group))
(buffer (get-buffer-create (or buffer-name "*Warnings*")))
(level-info (assq level warning-levels))
start end)
--- 224,231 ----
(setq level (cdr (assq level warning-level-aliases))))
(or (< (warning-numeric-level level)
(warning-numeric-level warning-minimum-log-level))
! (warning-suppress-p type warning-suppress-log-types)
! (let* ((typename (if (consp type) (car type) type))
(buffer (get-buffer-create (or buffer-name "*Warnings*")))
(level-info (assq level warning-levels))
start end)
***************
*** 243,249 ****
(setq level-info (funcall warning-prefix-function
level level-info)))
(insert (format (nth 1 level-info)
! (format warning-group-format groupname))
message)
(newline)
(when (and warning-fill-prefix (not (string-match "\n" message)))
--- 243,249 ----
(setq level-info (funcall warning-prefix-function
level level-info)))
(insert (format (nth 1 level-info)
! (format warning-type-format typename))
message)
(newline)
(when (and warning-fill-prefix (not (string-match "\n" message)))
***************
*** 273,279 ****
;; immediate display.
(or (< (warning-numeric-level level)
(warning-numeric-level warning-minimum-level))
! (warning-suppress-p group warning-suppress-types)
(let ((window (display-buffer buffer)))
(when (and (markerp warning-series)
(eq (marker-buffer warning-series) buffer))
--- 273,279 ----
;; 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))
***************
*** 281,293 ****
(sit-for 0)))))))
;;;###autoload
! (defun lwarn (group level message &rest args)
"Display a warning message made from (format MESSAGE ARGS...).
Aside from generating the message with `format',
this is equivalent to `display-warning'.
! GROUP should be a custom group name (a symbol).
! or else a list of symbols whose first element is a custom group name.
\(The rest of the symbols represent subcategories and
can be whatever you like.)
--- 281,293 ----
(sit-for 0)))))))
;;;###autoload
! (defun lwarn (type level message &rest args)
"Display a warning message made from (format MESSAGE ARGS...).
Aside from generating the message with `format',
this is equivalent to `display-warning'.
! TYPE is the warning type: either a custom group name (a symbol).
! or a list of symbols whose first element is a custom group name.
\(The rest of the symbols represent subcategories and
can be whatever you like.)
***************
*** 296,309 ****
if you do not attend to it promptly.
:error -- invalid data or circumstances.
:warning -- suspicious data or circumstances."
! (display-warning group (apply 'format message args) level))
;;;###autoload
(defun warn (message &rest args)
"Display a warning message made from (format MESSAGE ARGS...).
Aside from generating the message with `format',
this is equivalent to `display-warning', using
! `emacs' as the group and `:warning' as the level."
(display-warning 'emacs (apply 'format message args)))
(provide 'warnings)
--- 296,309 ----
if you do not attend to it promptly.
:error -- invalid data or circumstances.
:warning -- suspicious data or circumstances."
! (display-warning type (apply 'format message args) level))
;;;###autoload
(defun warn (message &rest args)
"Display a warning message made from (format MESSAGE ARGS...).
Aside from generating the message with `format',
this is equivalent to `display-warning', using
! `emacs' as the type and `:warning' as the level."
(display-warning 'emacs (apply 'format message args)))
(provide 'warnings)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/warnings.el,
Richard M. Stallman <=