From 4c41a8acc0e3877404ab99e56420bcdd4e27bdc2 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 14 Dec 2020 15:16:13 +0100 Subject: [PATCH] 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. --- lisp/emacs-lisp/warnings.el | 7 +++++-- lisp/url/url-proxy.el | 2 +- 2 files changed, 6 insertions(+), 3 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) diff --git a/lisp/url/url-proxy.el b/lisp/url/url-proxy.el index 698a87098ba..ad04a2d94a3 100644 --- a/lisp/url/url-proxy.el +++ b/lisp/url/url-proxy.el @@ -59,7 +59,7 @@ ((string-match "^socks +" proxy) (concat "socks://" (substring proxy (match-end 0)))) (t - (display-warning 'url (format "Unknown proxy directive: %s" proxy) 'critical) + (display-warning 'url (format "Unknown proxy directive: %s" proxy) :error) nil)))) (autoload 'url-http "url-http") -- 2.39.2