emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 4c41a8a: Make XEmacs compat variable warning-level-aliases obsole


From: Stefan Kangas
Subject: master 4c41a8a: Make XEmacs compat variable warning-level-aliases obsolete
Date: Mon, 14 Dec 2020 08:16:26 -0500 (EST)

branch: master
commit 4c41a8acc0e3877404ab99e56420bcdd4e27bdc2
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    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 f525ea43..2845884 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 698a870..ad04a2d 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")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]