aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2020-11-19 17:41:18 +0100
committerStefan Kangas2020-11-19 20:43:51 +0100
commit1ac6330fce34beaead60f1c5c7573950e9014780 (patch)
treec05f306d6eafa0184b376551affadea79e1dede7
parent75555b5b6bc517911404fc769b02f583e40f6c35 (diff)
downloademacs-1ac6330fce34beaead60f1c5c7573950e9014780.tar.gz
emacs-1ac6330fce34beaead60f1c5c7573950e9014780.zip
Remove some compat code from url.el
* lisp/url/url.el (url-warn): Make into obsolete alias for display-warning. * lisp/url/url-auth.el (url-register-auth-scheme): * lisp/url/url-news.el (url-news-open-host): * lisp/url/url-proxy.el (url-find-proxy-for-url): Adjust callers.
-rw-r--r--lisp/url/url-auth.el3
-rw-r--r--lisp/url/url-news.el3
-rw-r--r--lisp/url/url-proxy.el3
-rw-r--r--lisp/url/url.el14
4 files changed, 4 insertions, 19 deletions
diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el
index fd800cd9782..bcb48aa455d 100644
--- a/lisp/url/url-auth.el
+++ b/lisp/url/url-auth.el
@@ -23,7 +23,6 @@
23 23
24(require 'url-vars) 24(require 'url-vars)
25(require 'url-parse) 25(require 'url-parse)
26(autoload 'url-warn "url")
27(autoload 'auth-source-search "auth-source") 26(autoload 'auth-source-search "auth-source")
28 27
29(defsubst url-auth-user-prompt (url realm) 28(defsubst url-auth-user-prompt (url realm)
@@ -540,7 +539,7 @@ RATING a rating between 1 and 10 of the strength of the authentication.
540 (t rating))) 539 (t rating)))
541 (node (assoc type url-registered-auth-schemes))) 540 (node (assoc type url-registered-auth-schemes)))
542 (if (not (fboundp function)) 541 (if (not (fboundp function))
543 (url-warn 542 (display-warning
544 'security 543 'security
545 (format-message 544 (format-message
546 "Tried to register `%s' as an auth scheme, but it is not a function!" 545 "Tried to register `%s' as an auth scheme, but it is not a function!"
diff --git a/lisp/url/url-news.el b/lisp/url/url-news.el
index 9ef17cccd77..78a6aa94839 100644
--- a/lisp/url/url-news.el
+++ b/lisp/url/url-news.el
@@ -25,7 +25,6 @@
25(require 'url-util) 25(require 'url-util)
26(require 'url-parse) 26(require 'url-parse)
27(require 'nntp) 27(require 'nntp)
28(autoload 'url-warn "url")
29(autoload 'gnus-group-read-ephemeral-group "gnus-group") 28(autoload 'gnus-group-read-ephemeral-group "gnus-group")
30 29
31;; Unused. 30;; Unused.
@@ -42,7 +41,7 @@
42 (nntp-send-command "^.*\r?\n" "AUTHINFO USER" user) 41 (nntp-send-command "^.*\r?\n" "AUTHINFO USER" user)
43 (nntp-send-command "^.*\r?\n" "AUTHINFO PASS" pass) 42 (nntp-send-command "^.*\r?\n" "AUTHINFO PASS" pass)
44 (if (not (nntp-server-opened host)) 43 (if (not (nntp-server-opened host))
45 (url-warn 'url (format "NNTP authentication to `%s' as `%s' failed" 44 (display-warning 'url (format "NNTP authentication to `%s' as `%s' failed"
46 host user)))))) 45 host user))))))
47 46
48(defun url-news-fetch-message-id (host message-id) 47(defun url-news-fetch-message-id (host message-id)
diff --git a/lisp/url/url-proxy.el b/lisp/url/url-proxy.el
index 9513c3973a1..698a87098ba 100644
--- a/lisp/url/url-proxy.el
+++ b/lisp/url/url-proxy.el
@@ -22,7 +22,6 @@
22;;; Code: 22;;; Code:
23 23
24(require 'url-parse) 24(require 'url-parse)
25(autoload 'url-warn "url")
26 25
27(defun url-default-find-proxy-for-url (urlobj host) 26(defun url-default-find-proxy-for-url (urlobj host)
28 (cond 27 (cond
@@ -60,7 +59,7 @@
60 ((string-match "^socks +" proxy) 59 ((string-match "^socks +" proxy)
61 (concat "socks://" (substring proxy (match-end 0)))) 60 (concat "socks://" (substring proxy (match-end 0))))
62 (t 61 (t
63 (url-warn 'url (format "Unknown proxy directive: %s" proxy) 'critical) 62 (display-warning 'url (format "Unknown proxy directive: %s" proxy) 'critical)
64 nil)))) 63 nil))))
65 64
66(autoload 'url-http "url-http") 65(autoload 'url-http "url-http")
diff --git a/lisp/url/url.el b/lisp/url/url.el
index 33a5ebcdccc..5188007a58b 100644
--- a/lisp/url/url.el
+++ b/lisp/url/url.el
@@ -365,19 +365,7 @@ how long to wait for a response before giving up."
365 (if (buffer-live-p buff) 365 (if (buffer-live-p buff)
366 (kill-buffer buff))))) 366 (kill-buffer buff)))))
367 367
368(cond 368(define-obsolete-function-alias 'url-warn #'display-warning "28.1")
369 ((fboundp 'display-warning)
370 (defalias 'url-warn 'display-warning))
371 ((fboundp 'warn)
372 (defun url-warn (class message &optional level)
373 (warn "(%s/%s) %s" class (or level 'warning) message)))
374 (t
375 (defun url-warn (class message &optional level)
376 (with-current-buffer (get-buffer-create "*URL-WARNINGS*")
377 (goto-char (point-max))
378 (save-excursion
379 (insert (format "(%s/%s) %s\n" class (or level 'warning) message)))
380 (display-buffer (current-buffer))))))
381 369
382(provide 'url) 370(provide 'url)
383 371