diff options
| author | Richard M. Stallman | 2003-08-06 01:09:33 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-08-06 01:09:33 +0000 |
| commit | 10b6c9320f8c37bb4258841f2e5dcbb5ff72887b (patch) | |
| tree | 751be274ef61ba0cc3746735d00186664a735f10 | |
| parent | 9e31e67b6f2286a3ce34cf4633875a2ec16664cf (diff) | |
| download | emacs-10b6c9320f8c37bb4258841f2e5dcbb5ff72887b.tar.gz emacs-10b6c9320f8c37bb4258841f2e5dcbb5ff72887b.zip | |
Doc fixes, args renamed.
(warning-type-format): Renamed from warning-group-format.
| -rw-r--r-- | lisp/emacs-lisp/warnings.el | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index 4d0354236a8..0c9255a93e0 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el | |||
| @@ -43,7 +43,7 @@ | |||
| 43 | Each element looks like (LEVEL STRING FUNCTION) and | 43 | Each element looks like (LEVEL STRING FUNCTION) and |
| 44 | defines LEVEL as a severity level. STRING specifies the | 44 | defines LEVEL as a severity level. STRING specifies the |
| 45 | description of this level. STRING should use `%s' to | 45 | description of this level. STRING should use `%s' to |
| 46 | specify where to put the warning group information, | 46 | specify where to put the warning type information, |
| 47 | or it can omit the `%s' so as not to include that information. | 47 | or it can omit the `%s' so as not to include that information. |
| 48 | 48 | ||
| 49 | The optional FUNCTION, if non-nil, is a function to call | 49 | The optional FUNCTION, if non-nil, is a function to call |
| @@ -91,26 +91,26 @@ the warning is completely ignored." | |||
| 91 | 91 | ||
| 92 | (defcustom warning-suppress-log-types nil | 92 | (defcustom warning-suppress-log-types nil |
| 93 | "List of warning types that should not be logged. | 93 | "List of warning types that should not be logged. |
| 94 | If any element of this list matches the GROUP argument to `display-warning', | 94 | If any element of this list matches the TYPE argument to `display-warning', |
| 95 | the warning is completely ignored. | 95 | the warning is completely ignored. |
| 96 | The element must match the first elements of GROUP. | 96 | The element must match the first elements of TYPE. |
| 97 | Thus, (foo bar) as an element matches (foo bar) | 97 | Thus, (foo bar) as an element matches (foo bar) |
| 98 | or (foo bar ANYTHING...) as GROUP. | 98 | or (foo bar ANYTHING...) as TYPE. |
| 99 | If GROUP is a symbol FOO, that is equivalent to the list (FOO), | 99 | If TYPE is a symbol FOO, that is equivalent to the list (FOO), |
| 100 | so only the element (FOO) will match it." | 100 | so only the element (FOO) will match it." |
| 101 | :group 'warnings | 101 | :group 'warnings |
| 102 | :type '(repeat (repeat symbol)) | 102 | :type '(repeat (repeat symbol)) |
| 103 | :version "21.4") | 103 | :version "21.4") |
| 104 | 104 | ||
| 105 | (defcustom warning-suppress-types nil | 105 | (defcustom warning-suppress-types nil |
| 106 | "Custom groups for warnings not to display immediately. | 106 | "List of warning types not to display immediately. |
| 107 | If any element of this list matches the GROUP argument to `display-warning', | 107 | If any element of this list matches the TYPE argument to `display-warning', |
| 108 | the warning is logged nonetheless, but the warnings buffer is | 108 | the warning is logged nonetheless, but the warnings buffer is |
| 109 | not immediately displayed. | 109 | not immediately displayed. |
| 110 | The element must match an initial segment of the list GROUP. | 110 | The element must match an initial segment of the list TYPE. |
| 111 | Thus, (foo bar) as an element matches (foo bar) | 111 | Thus, (foo bar) as an element matches (foo bar) |
| 112 | or (foo bar ANYTHING...) as GROUP. | 112 | or (foo bar ANYTHING...) as TYPE. |
| 113 | If GROUP is a symbol FOO, that is equivalent to the list (FOO), | 113 | If TYPE is a symbol FOO, that is equivalent to the list (FOO), |
| 114 | so only the element (FOO) will match it. | 114 | so only the element (FOO) will match it. |
| 115 | See also `warning-suppress-log-types'." | 115 | See also `warning-suppress-log-types'." |
| 116 | :group 'warnings | 116 | :group 'warnings |
| @@ -155,9 +155,9 @@ also call that function before the next warning.") | |||
| 155 | ;;; safely, testing the existing value, before they call one of the | 155 | ;;; safely, testing the existing value, before they call one of the |
| 156 | ;;; warnings functions. | 156 | ;;; warnings functions. |
| 157 | ;;;###autoload | 157 | ;;;###autoload |
| 158 | (defvar warning-group-format " (%s)" | 158 | (defvar warning-type-format " (%s)" |
| 159 | "Format for displaying the warning group in the warning message. | 159 | "Format for displaying the warning type in the warning message. |
| 160 | The result of formatting the group this way gets included in the | 160 | The result of formatting the type this way gets included in the |
| 161 | message under the control of the string in `warning-levels'.") | 161 | message under the control of the string in `warning-levels'.") |
| 162 | 162 | ||
| 163 | (defun warning-numeric-level (level) | 163 | (defun warning-numeric-level (level) |
| @@ -166,19 +166,19 @@ message under the control of the string in `warning-levels'.") | |||
| 166 | (link (memq elt warning-levels))) | 166 | (link (memq elt warning-levels))) |
| 167 | (length link))) | 167 | (length link))) |
| 168 | 168 | ||
| 169 | (defun warning-suppress-p (group suppress-list) | 169 | (defun warning-suppress-p (type suppress-list) |
| 170 | "Non-nil if a warning with group GROUP should be suppressed. | 170 | "Non-nil if a warning with type TYPE should be suppressed. |
| 171 | SUPPRESS-LIST is the list of kinds of warnings to suppress." | 171 | SUPPRESS-LIST is the list of kinds of warnings to suppress." |
| 172 | (let (some-match) | 172 | (let (some-match) |
| 173 | (dolist (elt suppress-list) | 173 | (dolist (elt suppress-list) |
| 174 | (if (symbolp group) | 174 | (if (symbolp type) |
| 175 | ;; If GROUP is a symbol, the ELT must be (GROUP). | 175 | ;; If TYPE is a symbol, the ELT must be (TYPE). |
| 176 | (if (and (consp elt) | 176 | (if (and (consp elt) |
| 177 | (eq (car elt) group) | 177 | (eq (car elt) type) |
| 178 | (null (cdr elt))) | 178 | (null (cdr elt))) |
| 179 | (setq some-match t)) | 179 | (setq some-match t)) |
| 180 | ;; If GROUP is a list, ELT must match it or some initial segment of it. | 180 | ;; If TYPE is a list, ELT must match it or some initial segment of it. |
| 181 | (let ((tem1 group) | 181 | (let ((tem1 type) |
| 182 | (tem2 elt) | 182 | (tem2 elt) |
| 183 | (match t)) | 183 | (match t)) |
| 184 | ;; Check elements of ELT until we run out of them. | 184 | ;; Check elements of ELT until we run out of them. |
| @@ -187,7 +187,7 @@ SUPPRESS-LIST is the list of kinds of warnings to suppress." | |||
| 187 | (setq match nil)) | 187 | (setq match nil)) |
| 188 | (setq tem1 (cdr tem1) | 188 | (setq tem1 (cdr tem1) |
| 189 | tem2 (cdr tem2))) | 189 | tem2 (cdr tem2))) |
| 190 | ;; If ELT is an initial segment of GROUP, MATCH is t now. | 190 | ;; If ELT is an initial segment of TYPE, MATCH is t now. |
| 191 | ;; So set SOME-MATCH. | 191 | ;; So set SOME-MATCH. |
| 192 | (if match | 192 | (if match |
| 193 | (setq some-match t))))) | 193 | (setq some-match t))))) |
| @@ -196,10 +196,10 @@ SUPPRESS-LIST is the list of kinds of warnings to suppress." | |||
| 196 | some-match)) | 196 | some-match)) |
| 197 | 197 | ||
| 198 | ;;;###autoload | 198 | ;;;###autoload |
| 199 | (defun display-warning (group message &optional level buffer-name) | 199 | (defun display-warning (type message &optional level buffer-name) |
| 200 | "Display a warning message, MESSAGE. | 200 | "Display a warning message, MESSAGE. |
| 201 | GROUP should be a custom group name (a symbol), | 201 | TYPE is the warning type: either a custom group name (a symbol), |
| 202 | or else a list of symbols whose first element is a custom group name. | 202 | or a list of symbols whose first element is a custom group name. |
| 203 | \(The rest of the symbols represent subcategories, for warning purposes | 203 | \(The rest of the symbols represent subcategories, for warning purposes |
| 204 | only, and you can use whatever symbols you like.) | 204 | only, and you can use whatever symbols you like.) |
| 205 | 205 | ||
| @@ -224,8 +224,8 @@ See also `warning-series', `warning-prefix-function' and | |||
| 224 | (setq level (cdr (assq level warning-level-aliases)))) | 224 | (setq level (cdr (assq level warning-level-aliases)))) |
| 225 | (or (< (warning-numeric-level level) | 225 | (or (< (warning-numeric-level level) |
| 226 | (warning-numeric-level warning-minimum-log-level)) | 226 | (warning-numeric-level warning-minimum-log-level)) |
| 227 | (warning-suppress-p group warning-suppress-log-types) | 227 | (warning-suppress-p type warning-suppress-log-types) |
| 228 | (let* ((groupname (if (consp group) (car group) group)) | 228 | (let* ((typename (if (consp type) (car type) type)) |
| 229 | (buffer (get-buffer-create (or buffer-name "*Warnings*"))) | 229 | (buffer (get-buffer-create (or buffer-name "*Warnings*"))) |
| 230 | (level-info (assq level warning-levels)) | 230 | (level-info (assq level warning-levels)) |
| 231 | start end) | 231 | start end) |
| @@ -243,7 +243,7 @@ See also `warning-series', `warning-prefix-function' and | |||
| 243 | (setq level-info (funcall warning-prefix-function | 243 | (setq level-info (funcall warning-prefix-function |
| 244 | level level-info))) | 244 | level level-info))) |
| 245 | (insert (format (nth 1 level-info) | 245 | (insert (format (nth 1 level-info) |
| 246 | (format warning-group-format groupname)) | 246 | (format warning-type-format typename)) |
| 247 | message) | 247 | message) |
| 248 | (newline) | 248 | (newline) |
| 249 | (when (and warning-fill-prefix (not (string-match "\n" message))) | 249 | (when (and warning-fill-prefix (not (string-match "\n" message))) |
| @@ -273,7 +273,7 @@ See also `warning-series', `warning-prefix-function' and | |||
| 273 | ;; immediate display. | 273 | ;; immediate display. |
| 274 | (or (< (warning-numeric-level level) | 274 | (or (< (warning-numeric-level level) |
| 275 | (warning-numeric-level warning-minimum-level)) | 275 | (warning-numeric-level warning-minimum-level)) |
| 276 | (warning-suppress-p group warning-suppress-types) | 276 | (warning-suppress-p type warning-suppress-types) |
| 277 | (let ((window (display-buffer buffer))) | 277 | (let ((window (display-buffer buffer))) |
| 278 | (when (and (markerp warning-series) | 278 | (when (and (markerp warning-series) |
| 279 | (eq (marker-buffer warning-series) buffer)) | 279 | (eq (marker-buffer warning-series) buffer)) |
| @@ -281,13 +281,13 @@ See also `warning-series', `warning-prefix-function' and | |||
| 281 | (sit-for 0))))))) | 281 | (sit-for 0))))))) |
| 282 | 282 | ||
| 283 | ;;;###autoload | 283 | ;;;###autoload |
| 284 | (defun lwarn (group level message &rest args) | 284 | (defun lwarn (type level message &rest args) |
| 285 | "Display a warning message made from (format MESSAGE ARGS...). | 285 | "Display a warning message made from (format MESSAGE ARGS...). |
| 286 | Aside from generating the message with `format', | 286 | Aside from generating the message with `format', |
| 287 | this is equivalent to `display-warning'. | 287 | this is equivalent to `display-warning'. |
| 288 | 288 | ||
| 289 | GROUP should be a custom group name (a symbol). | 289 | TYPE is the warning type: either a custom group name (a symbol). |
| 290 | or else a list of symbols whose first element is a custom group name. | 290 | or a list of symbols whose first element is a custom group name. |
| 291 | \(The rest of the symbols represent subcategories and | 291 | \(The rest of the symbols represent subcategories and |
| 292 | can be whatever you like.) | 292 | can be whatever you like.) |
| 293 | 293 | ||
| @@ -296,14 +296,14 @@ LEVEL should be either :warning, :error, or :emergency. | |||
| 296 | if you do not attend to it promptly. | 296 | if you do not attend to it promptly. |
| 297 | :error -- invalid data or circumstances. | 297 | :error -- invalid data or circumstances. |
| 298 | :warning -- suspicious data or circumstances." | 298 | :warning -- suspicious data or circumstances." |
| 299 | (display-warning group (apply 'format message args) level)) | 299 | (display-warning type (apply 'format message args) level)) |
| 300 | 300 | ||
| 301 | ;;;###autoload | 301 | ;;;###autoload |
| 302 | (defun warn (message &rest args) | 302 | (defun warn (message &rest args) |
| 303 | "Display a warning message made from (format MESSAGE ARGS...). | 303 | "Display a warning message made from (format MESSAGE ARGS...). |
| 304 | Aside from generating the message with `format', | 304 | Aside from generating the message with `format', |
| 305 | this is equivalent to `display-warning', using | 305 | this is equivalent to `display-warning', using |
| 306 | `emacs' as the group and `:warning' as the level." | 306 | `emacs' as the type and `:warning' as the level." |
| 307 | (display-warning 'emacs (apply 'format message args))) | 307 | (display-warning 'emacs (apply 'format message args))) |
| 308 | 308 | ||
| 309 | (provide 'warnings) | 309 | (provide 'warnings) |