emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/warnings.el


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/warnings.el
Date: Tue, 23 Jul 2002 23:54:58 -0400

Index: emacs/lisp/warnings.el
diff -c emacs/lisp/warnings.el:1.3 emacs/lisp/warnings.el:1.4
*** emacs/lisp/warnings.el:1.3  Tue Jul 23 15:24:03 2002
--- emacs/lisp/warnings.el      Tue Jul 23 23:54:58 2002
***************
*** 30,45 ****
  ;;; Code:
  
  (defvar warning-levels
!   '((:emergency "Emergency: " ding)
!     (:error "Error: ")
!     (:warning "Warning: ")
!     (:debug "Debug: "))
    "List of severity level definitions for `define-warnings'.
  Each element looks like (LEVEL STRING FUNCTION) and
  defines LEVEL as a severity level.  STRING is the description
  to use in the buffer, and FUNCTION (which may be omitted)
  if non-nil is a function to call with no arguments
! to get the user's attention.
  
  :debug level is ignored by default (see `warning-minimum-level').")
  (put 'warning-levels 'risky-local-variable t)
--- 30,46 ----
  ;;; Code:
  
  (defvar warning-levels
!   '((:emergency "Emergency%s: " ding)
!     (:error "Error%s: ")
!     (:warning "Warning%s: ")
!     (:debug "Debug%s: "))
    "List of severity level definitions for `define-warnings'.
  Each element looks like (LEVEL STRING FUNCTION) and
  defines LEVEL as a severity level.  STRING is the description
  to use in the buffer, and FUNCTION (which may be omitted)
  if non-nil is a function to call with no arguments
! to get the user's attention.  STRING should use `%s' to
! specify where to put the warning group information.
  
  :debug level is ignored by default (see `warning-minimum-level').")
  (put 'warning-levels 'risky-local-variable t)
***************
*** 78,84 ****
    :version "21.4")
  (defvaralias 'log-warning-minimum-level 'warning-minimum-log-level)
  
! (defcustom warning-suppress-log 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.
--- 79,85 ----
    :version "21.4")
  (defvaralias 'log-warning-minimum-level 'warning-minimum-log-level)
  
! (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.
***************
*** 91,97 ****
    :type '(repeat (repeat symbol))
    :version "21.4")
  
! (defcustom warning-suppress 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
--- 92,98 ----
    :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
***************
*** 101,107 ****
  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'."
    :group 'warnings
    :type '(repeat (repeat symbol))
    :version "21.4")
--- 102,108 ----
  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
    :type '(repeat (repeat symbol))
    :version "21.4")
***************
*** 133,138 ****
--- 134,144 ----
  (defvar warning-fill-prefix nil
    "Non-nil means fill each warning text using this string as `fill-prefix'.")
  
+ (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-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."
***************
*** 191,197 ****
        (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)
        (let* ((groupname (if (consp group) (car group) group))
             (buffer (get-buffer-create (or buffer-name "*Warnings*")))
             (level-info (assq level warning-levels))
--- 197,203 ----
        (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))
***************
*** 209,215 ****
          (if warning-prefix-function
              (setq level-info (funcall warning-prefix-function
                                        level level-info)))
!         (insert (nth 1 level-info) message)
          (newline)
          (when (and warning-fill-prefix (not (string-match "\n" message)))
            (let ((fill-prefix warning-fill-prefix)
--- 215,223 ----
          (if warning-prefix-function
              (setq level-info (funcall warning-prefix-function
                                        level level-info)))
!         (setq group-string (format warning-group-format groupname))
!         (insert (format (nth 1 level-info) group-string)
!                 message)
          (newline)
          (when (and warning-fill-prefix (not (string-match "\n" message)))
            (let ((fill-prefix warning-fill-prefix)
***************
*** 231,237 ****
          ;; immediate display.
          (or (< (warning-numeric-level level)
                 (warning-numeric-level warning-minimum-level)) 
!             (warning-suppress-p group warning-suppress)
              (let ((window (display-buffer buffer)))
                (when warning-series
                  (set-window-start window warning-series))
--- 239,245 ----
          ;; 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 warning-series
                  (set-window-start window warning-series))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]