1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

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.
This commit is contained in:
Stefan Kangas 2020-12-14 15:16:13 +01:00
parent f1dae2551c
commit 4c41a8acc0
2 changed files with 6 additions and 3 deletions

View file

@ -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)

View file

@ -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")