diff options
author | Stefan Kangas <stefan@marxist.se> | 2020-12-14 15:16:13 +0100 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2020-12-14 15:16:13 +0100 |
commit | 4c41a8acc0e3877404ab99e56420bcdd4e27bdc2 (patch) | |
tree | 2760bd31b70a6aa17ea818a483b34b44dbb423c0 /lisp/emacs-lisp/warnings.el | |
parent | f1dae2551c9b30f1f1333416df195b0907c54f4f (diff) | |
download | emacs-4c41a8acc0e3877404ab99e56420bcdd4e27bdc2.tar.gz emacs-4c41a8acc0e3877404ab99e56420bcdd4e27bdc2.tar.bz2 emacs-4c41a8acc0e3877404ab99e56420bcdd4e27bdc2.zip |
Make XEmacs compat variable warning-level-aliases obsolete
* lisp/emacs-lisp/warnings.el (warning-level-aliases): Make obsolete.
(display-warning): Warn when using one of the warning levels defined
in above obsolete variable. (Bug#44849)
* lisp/url/url-proxy.el (url-find-proxy-for-url): Replace obsolete
warning type 'critical with :error.
Diffstat (limited to 'lisp/emacs-lisp/warnings.el')
-rw-r--r-- | lisp/emacs-lisp/warnings.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index f525ea433ad..28458847cc2 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el @@ -67,6 +67,7 @@ Level :debug is ignored by default (see `warning-minimum-level').") Each element looks like (ALIAS . LEVEL) and defines ALIAS as equivalent to LEVEL. LEVEL must be defined in `warning-levels'; it may not itself be an alias.") +(make-obsolete-variable 'warning-level-aliases 'warning-levels "28.1") (define-obsolete-variable-alias 'display-warning-minimum-level 'warning-minimum-level "28.1") @@ -256,8 +257,10 @@ entirely by setting `warning-suppress-types' or (setq level :warning)) (unless buffer-name (setq buffer-name "*Warnings*")) - (if (assq level warning-level-aliases) - (setq level (cdr (assq level warning-level-aliases)))) + (with-suppressed-warnings ((obsolete warning-level-aliases)) + (when-let ((new (cdr (assq level warning-level-aliases)))) + (warn "Warning level `%s' is obsolete; use `%s' instead" level new) + (setq level new))) (or (< (warning-numeric-level level) (warning-numeric-level warning-minimum-log-level)) (warning-suppress-p type warning-suppress-log-types) |