;;; url-methods.el --- Load URL schemes as needed
-;; Copyright (C) 1996-1999, 2004-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1999, 2004-2016 Free Software Foundation, Inc.
;; Keywords: comm, data, processes, hypermedia
;;; Code:
-(eval-when-compile
- (require 'cl))
-
;; This loads up some of the small, silly URLs that I really don't
;; want to bother putting in their own separate files.
(require 'url-parse)
(defun url-scheme-default-loader (url &optional callback cbargs)
"Signal an error for an unknown URL scheme."
- (error "Unkown URL scheme: %s" (url-type url)))
+ (error "Unknown URL scheme: %s" (url-type url)))
(defvar url-scheme--registering-proxy nil)
;; Store any proxying information - this will not overwrite an old
;; entry, so that people can still set this information in their
- ;; .emacs file
+ ;; init file
(cond
(cur-proxy nil) ; Keep their old settings
((null env-proxy) nil) ; No proxy setup
(let* ((stub (concat "url-" scheme))
(loader (intern stub)))
(condition-case ()
- (require loader)
+ ;; url-https.el was merged into url-http because of 8+3
+ ;; filename limitations, so we have to do this dance.
+ (require (if (equal "https" scheme) 'url-http loader))
(error nil))
(if (fboundp loader)
(progn
(let ((symbol (intern-soft (format "%s-%s" stub (car cell))))
(type (cdr cell)))
(if symbol
- (case type
- (function
+ (pcase type
+ (`function
;; Store the symbol name of a function
(if (fboundp symbol)
(setq desc (plist-put desc (car cell) symbol))))
- (variable
+ (`variable
;; Store the VALUE of a variable
(if (boundp symbol)
(setq desc (plist-put desc (car cell)
(symbol-value symbol)))))
- (otherwise
+ (_
(error "Malformed url-scheme-methods entry: %S"
cell))))))
(puthash scheme desc url-scheme-registry)))))