]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/warnings.el
(display-warning, lwarn): Doc fixes.
[gnu-emacs] / lisp / emacs-lisp / warnings.el
index 343eda970ce875effadd9b32237a984cd6cdf266..a02a8c14ebafa4175c7bacf3aadd24e42853c822 100644 (file)
@@ -1,6 +1,6 @@
 ;;; warnings.el --- log and display warnings
 
-;; Copyright (C) 2002 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: internal
@@ -19,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -76,16 +76,20 @@ If a warning's severity level is lower than this,
 the warning is logged in the warnings buffer, but the buffer
 is not immediately displayed.  See also `warning-minimum-log-level'."
   :group 'warnings
-  :type '(choice (const :emergency) (const :error) (const :warning))
+  :type '(choice (const :emergency) (const :error)
+                 (const :warning) (const :debug))
   :version "22.1")
 (defvaralias 'display-warning-minimum-level 'warning-minimum-level)
 
 (defcustom warning-minimum-log-level :warning
   "Minimum severity level for logging a warning.
 If a warning severity level is lower than this,
-the warning is completely ignored."
+the warning is completely ignored.
+Value must be lower or equal than `warning-minimum-level',
+because warnings not logged aren't displayed either."
   :group 'warnings
-  :type '(choice (const :emergency) (const :error) (const :warning))
+  :type '(choice (const :emergency) (const :error)
+                 (const :warning) (const :debug))
   :version "22.1")
 (defvaralias 'log-warning-minimum-level 'warning-minimum-log-level)
 
@@ -203,7 +207,10 @@ 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.)
 
-LEVEL should be either :warning, :error, or :emergency.
+LEVEL should be either :debug, :warning, :error, or :emergency
+\(but see `warning-minimum-level' and `warning-minimum-log-level').
+Default is :warning.
+
 :emergency -- a problem that will seriously impair Emacs operation soon
              if you do not attend to it promptly.
 :error     -- data or circumstances that are inherently wrong.
@@ -223,7 +230,7 @@ See also `warning-series', `warning-prefix-function' and
   (if (assq level warning-level-aliases)
       (setq level (cdr (assq level warning-level-aliases))))
   (or (< (warning-numeric-level level)
-        (warning-numeric-level warning-minimum-log-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*")))
@@ -286,16 +293,19 @@ See also `warning-series', `warning-prefix-function' and
 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).
+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.)
 
-LEVEL should be either :warning, :error, or :emergency.
+LEVEL should be either :debug, :warning, :error, or :emergency
+\(but see `warning-minimum-level' and `warning-minimum-log-level').
+
 :emergency -- a problem that will seriously impair Emacs operation soon
              if you do not attend to it promptly.
 :error     -- invalid data or circumstances.
-:warning   -- suspicious data or circumstances."
+:warning   -- suspicious data or circumstances.
+:debug     -- info for debugging only."
   (display-warning type (apply 'format message args) level))
 
 ;;;###autoload