1 ;;; url-about.el --- Show internal URLs
3 ;; Copyright (C) 2001, 2004-2014 Free Software Foundation, Inc.
5 ;; Keywords: comm, data, processes, hypermedia
7 ;; This file is part of GNU Emacs.
9 ;; GNU Emacs is free software: you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation, either version 3 of the License, or
12 ;; (at your option) any later version.
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
29 (defun url-probe-protocols ()
30 "Return a list of all potential URL schemes."
31 (or (get 'url-extension-protocols
'probed
)
32 (mapc (lambda (s) (url-scheme-get-property s
'name
))
33 (or (get 'url-extension-protocols
'schemes
)
34 (let ((schemes '("info" "man" "rlogin" "telnet"
35 "tn3270" "data" "snews")))
38 (if (string-match "url-\\(.*\\).el$" f
)
39 (push (match-string 1 f
) schemes
)))
40 (directory-files d nil
"^url-.*\\.el$")))
42 (put 'url-extension-protocols
'schemes schemes
)
45 (defvar url-scheme-registry
)
47 (defun url-about-protocols (url)
51 " <title>Supported Protocols</title>\n"
54 " <h1>Supported Protocols - URL v" url-version
"</h1>\n"
55 " <table width='100%' border='1'>\n"
62 (if (string= k
"proxy")
63 ;; Ignore the proxy setting... its magic!
66 ;; The name of the protocol
67 (insert " <td valign=top>" (or (url-scheme-get-property k
'name
) k
) "\n")
69 ;; Now the properties. Currently just asynchronous
70 ;; status, default port number, and proxy status.
71 (insert " <td valign=top>"
72 (if (url-scheme-get-property k
'asynchronous-p
) "As" "S")
74 (if (url-scheme-get-property k
'default-port
)
75 (format "Default Port: %d<br>\n"
76 (url-scheme-get-property k
'default-port
)) "")
77 (if (assoc k url-proxy-services
)
78 (format "Proxy: %s<br>\n" (assoc k url-proxy-services
)) ""))
79 ;; Now the description...
80 (insert " <td valign=top>"
81 (or (url-scheme-get-property k
'description
) "N/A"))))
82 (sort (let (x) (maphash (lambda (k v
) (push k x
)) url-scheme-registry
) x
) 'string-lessp
))
87 (defun url-about (url)
89 (let* ((item (downcase (url-filename url
)))
90 (func (intern (format "url-about-%s" item
))))
93 (set-buffer (generate-new-buffer " *about-data*"))
94 (insert "Content-type: text/plain\n\n")
97 (error "URL does not know about `%s'" item
))))
101 ;;; url-about.el ends here