comparison lisp/w3/url-vars.el @ 124:9b50b4588a93 r20-1b15

Import from CVS: tag r20-1b15
author cvs
date Mon, 13 Aug 2007 09:26:39 +0200
parents d2f30a177268
children 34a5b81f86ba
comparison
equal deleted inserted replaced
123:c77884c6318d 124:9b50b4588a93
1 ;;; url-vars.el --- Variables for Uniform Resource Locator tool 1 ;;; url-vars.el --- Variables for Uniform Resource Locator tool
2 ;; Author: wmperry 2 ;; Author: wmperry
3 ;; Created: 1997/04/10 21:18:12 3 ;; Created: 1997/04/11 14:49:23
4 ;; Version: 1.50 4 ;; Version: 1.52
5 ;; Keywords: comm, data, processes, hypermedia 5 ;; Keywords: comm, data, processes, hypermedia
6 6
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu) 8 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc. 9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
24 ;;; along with GNU Emacs; see the file COPYING. If not, write to the 24 ;;; along with GNU Emacs; see the file COPYING. If not, write to the
25 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 25 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 ;;; Boston, MA 02111-1307, USA. 26 ;;; Boston, MA 02111-1307, USA.
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
28 28
29 (defconst url-version (let ((x "p3.0.81")) 29 (eval-and-compile
30 (condition-case ()
31 (require 'custom)
32 (error nil))
33 (if (and (featurep 'custom) (fboundp 'custom-declare-variable))
34 nil ;; We've got what we needed
35 ;; We have the old custom-library, hack around it!
36 (defmacro defgroup (&rest args)
37 nil)
38 (defmacro defcustom (var value doc &rest args)
39 (` (defvar (, var) (, value) (, doc))))))
40
41 (defconst url-version (let ((x "p3.0.82"))
30 (if (string-match "State: \\([^ \t\n]+\\)" x) 42 (if (string-match "State: \\([^ \t\n]+\\)" x)
31 (substring x (match-beginning 1) (match-end 1)) 43 (substring x (match-beginning 1) (match-end 1))
32 x)) 44 x))
33 "Version # of URL package.") 45 "Version # of URL package.")
46
47 (defgroup url nil
48 "Uniform Resource Locator tool"
49 :group 'hypermedia)
50
51 (defgroup url-file nil
52 "URL storage"
53 :prefix "url-"
54 :group 'url)
55
56 (defgroup url-cache nil
57 "URL cache"
58 :prefix "url-"
59 :prefix "url-cache-"
60 :group 'url)
61
62 (defgroup url-history nil
63 "History variables in the URL package"
64 :prefix "url-"
65 :group 'url)
66
67 (defgroup url-cookie nil
68 "URL cookies"
69 :prefix "url-"
70 :prefix "url-cookie-"
71 :group 'url)
72
73 (defgroup url-mime nil
74 "MIME options of URL"
75 :prefix "url-"
76 :group 'url)
77
78 (defgroup url-hairy nil
79 "Hairy options of URL"
80 :prefix "url-"
81 :group 'url)
82
34 83
35 (defvar url-current-can-be-cached t 84 (defvar url-current-can-be-cached t
36 "*Whether the current URL can be cached.") 85 "*Whether the current URL can be cached.")
37 86
38 (defvar url-current-object nil 87 (defvar url-current-object nil
66 ;; url-current-user 115 ;; url-current-user
67 )) 116 ))
68 117
69 (defvar url-cookie-storage nil "Where cookies are stored.") 118 (defvar url-cookie-storage nil "Where cookies are stored.")
70 (defvar url-cookie-secure-storage nil "Where secure cookies are stored.") 119 (defvar url-cookie-secure-storage nil "Where secure cookies are stored.")
71 (defvar url-cookie-file nil "*Where cookies are stored on disk.") 120 (defcustom url-cookie-file nil "*Where cookies are stored on disk."
72 121 :type '(choice (const :tag "Default" :value nil) file)
73 (defvar url-default-retrieval-proc 'url-default-callback 122 :group 'url-file
74 "*The default action to take when an asynchronous retrieval completes.") 123 :group 'url-cookie)
75 124
76 (defvar url-honor-refresh-requests t 125 (defcustom url-default-retrieval-proc 'url-default-callback
126 "*The default action to take when an asynchronous retrieval completes."
127 :type 'function
128 :group 'url-hairy)
129
130 (defcustom url-honor-refresh-requests t
77 "*Whether to do automatic page reloads at the request of the document 131 "*Whether to do automatic page reloads at the request of the document
78 author or the server via the `Refresh' header in an HTTP/1.0 response. 132 author or the server via the `Refresh' header in an HTTP/1.0 response.
79 If nil, no refresh requests will be honored. 133 If nil, no refresh requests will be honored.
80 If t, all refresh requests will be honored. 134 If t, all refresh requests will be honored.
81 If non-nil and not t, the user will be asked for each refresh request.") 135 If non-nil and not t, the user will be asked for each refresh request."
82 136 :type '(choice (const :tag "off" nil)
83 (defvar url-inhibit-mime-parsing nil 137 (const :tag "on" t)
84 "Whether to parse out (and delete) the MIME headers from a message.") 138 (const :tag "ask" 'ask))
85 139 :group 'url-hairy)
86 (defvar url-automatic-caching nil 140
141 (defcustom url-inhibit-mime-parsing nil
142 "Whether to parse out (and delete) the MIME headers from a message."
143 :type 'boolean
144 :group 'url-mime)
145
146 (defcustom url-automatic-caching nil
87 "*If non-nil, all documents will be automatically cached to the local 147 "*If non-nil, all documents will be automatically cached to the local
88 disk.") 148 disk."
89 149 :type 'boolean
90 (defvar url-cache-expired 150 :group 'url-cache)
151
152 (defcustom url-cache-expired
91 (function (lambda (t1 t2) (>= (- (car t2) (car t1)) 5))) 153 (function (lambda (t1 t2) (>= (- (car t2) (car t1)) 5)))
92 "*A function (`funcall'able) that takes two times as its arguments, and 154 "*A function (`funcall'able) that takes two times as its arguments, and
93 returns non-nil if the second time is 'too old' when compared to the first 155 returns non-nil if the second time is 'too old' when compared to the first
94 time.") 156 time."
157 :type 'function
158 :group 'url-cache)
95 159
96 (defvar url-bug-address "wmperry@cs.indiana.edu" 160 (defvar url-bug-address "wmperry@cs.indiana.edu"
97 "Where to send bug reports.") 161 "Where to send bug reports.")
98 162
99 (defvar url-cookie-confirmation nil 163 (defcustom url-cookie-confirmation nil
100 "*If non-nil, confirmation by the user is required to accept HTTP cookies.") 164 "*If non-nil, confirmation by the user is required to accept HTTP cookies."
101 165 :type 'boolean
102 (defvar url-personal-mail-address nil 166 :group 'url-cookie)
167
168 (defcustom url-personal-mail-address nil
103 "*Your full email address. 169 "*Your full email address.
104 This is what is sent to HTTP/1.0 servers as the FROM field in an HTTP/1.0 170 This is what is sent to HTTP/1.0 servers as the FROM field in an HTTP/1.0
105 request.") 171 request."
106 172 :type '(choice (const nil) string)
107 (defvar url-directory-index-file "index.html" 173 :group 'url)
108 "*The filename to look for when indexing a directory. If this file 174
109 exists, and is readable, then it will be viewed instead of 175 (defcustom url-directory-index-file "index.html"
110 automatically creating the directory listing.") 176 "*The filename to look for when indexing a directory.
111 177 If this file exists, and is readable, then it will be viewed instead of
112 (defvar url-privacy-level '(email) 178 using `dired' to view the directory."
179 :type 'string
180 :group 'url-file)
181
182 (defcustom url-privacy-level '(email)
113 "*How private you want your requests to be. 183 "*How private you want your requests to be.
114 HTTP/1.0 has header fields for various information about the user, including 184 HTTP/1.0 has header fields for various information about the user, including
115 operating system information, email addresses, the last page you visited, etc. 185 operating system information, email addresses, the last page you visited, etc.
116 This variable controls how much of this information is sent. 186 This variable controls how much of this information is sent.
117 187
130 agent -- Do not send the User-Agent string 200 agent -- Do not send the User-Agent string
131 cookie -- never accept HTTP cookies 201 cookie -- never accept HTTP cookies
132 202
133 Samples: 203 Samples:
134 204
135 (setq url-privacy-level 'high) 205 (setq url-privacy-level 'high)
136 (setq url-privacy-level '(email lastloc)) ;; equivalent to 'high 206 (setq url-privacy-level '(email lastloc)) ;; equivalent to 'high
137 (setq url-privacy-level '(os)) 207 (setq url-privacy-level '(os))
138 208
139 ::NOTE:: 209 ::NOTE::
140 This variable controls several other variables and is _NOT_ automatically 210 This variable controls several other variables and is _NOT_ automatically
141 updated. Call the function `url-setup-privacy-info' after modifying this 211 updated. Call the function `url-setup-privacy-info' after modifying this
142 variable. 212 variable."
143 ") 213 :type '(choice (const :tag "None (you believe in the basic goodness of humanity)"
214 :value none)
215 (const :tag "Low (do not reveal last location)"
216 :value low)
217 (const :tag "High (no email address or last location)"
218 :value high)
219 (const :tag "Paranoid (reveal nothing!)"
220 :value paranoid)
221 (checklist :tag "Custom"
222 (const :tag "Email address" :value email)
223 (const :tag "Operating system" :value os)
224 (const :tag "Last location" :value lastloc)
225 (const :tag "Browser identification" :value agent)
226 (const :tag "No cookies" :value cookie)))
227 :group 'url)
144 228
145 (defvar url-history-list nil "List of urls visited this session.") 229 (defvar url-history-list nil "List of urls visited this session.")
146 230
147 (defvar url-inhibit-uncompression nil "Do not do decompression if non-nil.") 231 (defvar url-inhibit-uncompression nil "Do not do decompression if non-nil.")
148 232
149 (defvar url-keep-history nil 233 (defcustom url-keep-history nil
150 "*Controls whether to keep a list of all the URLS being visited. If 234 "*Controls whether to keep a list of all the URLS being visited.
151 non-nil, url will keep track of all the URLS visited. 235 If non-nil, url will keep track of all the URLS visited.
152 If eq to `t', then the list is saved to disk at the end of each emacs 236 If eq to `t', then the list is saved to disk at the end of each emacs
153 session.") 237 session."
154 238 :type 'boolean
155 (defvar url-uncompressor-alist '((".z" . "x-gzip") 239 :group 'url-history)
156 (".gz" . "x-gzip") 240
157 (".uue" . "x-uuencoded") 241 (defcustom url-uncompressor-alist '((".z" . "x-gzip")
158 (".hqx" . "x-hqx") 242 (".gz" . "x-gzip")
159 (".Z" . "x-compress")) 243 (".uue" . "x-uuencoded")
244 (".hqx" . "x-hqx")
245 (".Z" . "x-compress"))
160 "*An assoc list of file extensions and the appropriate 246 "*An assoc list of file extensions and the appropriate
161 content-transfer-encodings for each.") 247 content-transfer-encodings for each."
162 248 :type '(repeat (cons (string :tag "Extension") (string :tag "Encoding")))
163 (defvar url-mail-command 'url-mail 249 :group 'url-mime)
164 "*This function will be called whenever url needs to send mail. It should 250
165 enter a mail-mode-like buffer in the current window. 251 (defcustom url-mail-command 'url-mail
252 "*This function will be called whenever url needs to send mail.
253 It should enter a mail-mode-like buffer in the current window.
166 The commands mail-to and mail-subject should still work in this 254 The commands mail-to and mail-subject should still work in this
167 buffer, and it should use mail-header-separator if possible.") 255 buffer, and it should use mail-header-separator if possible."
168 256 :type 'function
169 (defvar url-proxy-services nil 257 :group 'url)
258
259 (defcustom url-proxy-services nil
170 "*An assoc list of access types and servers that gateway them. 260 "*An assoc list of access types and servers that gateway them.
171 Looks like ((\"http\" . \"hostname:portnumber\") ....) This is set up 261 Looks like ((\"http\" . \"hostname:portnumber\") ....) This is set up
172 from the ACCESS_proxy environment variables in url-do-setup.") 262 from the ACCESS_proxy environment variables in url-do-setup."
173 263 :type '(repeat (cons (string :tag "Protocol")
174 (defvar url-global-history-file nil 264 (string :tag "Proxy"
265 :validate widget-field-validate
266 :valid-regexp "^[a-z.0-9-:]+$")))
267 :group 'url)
268
269 (defcustom url-global-history-file nil
175 "*The global history file used by both Mosaic/X and the url package. 270 "*The global history file used by both Mosaic/X and the url package.
176 This file contains a list of all the URLs you have visited. This file 271 This file contains a list of all the URLs you have visited. This file
177 is parsed at startup and used to provide URL completion.") 272 is parsed at startup and used to provide URL completion."
178 273 :type '(choice (const :tag "Default" :value nil) file)
179 (defvar url-global-history-save-interval 3600 274 :group 'url-history)
275
276 (defcustom url-global-history-save-interval 3600
180 "*The number of seconds between automatic saves of the history list. 277 "*The number of seconds between automatic saves of the history list.
181 Default is 1 hour. Note that if you change this variable after `url-do-setup' 278 Default is 1 hour. Note that if you change this variable after `url-do-setup'
182 has been run, you need to run the `url-setup-save-timer' function manually.") 279 has been run, you need to run the `url-setup-save-timer' function manually."
280 :type 'integer
281 :group 'url-history)
183 282
184 (defvar url-global-history-timer nil) 283 (defvar url-global-history-timer nil)
185 284
186 (defvar url-passwd-entry-func nil 285 (defcustom url-passwd-entry-func nil
187 "*This is a symbol indicating which function to call to read in a 286 "*This is a symbol indicating which function to call to read in a
188 password. It will be set up depending on whether you are running EFS 287 password. It will be set up depending on whether you are running EFS
189 or ange-ftp at startup if it is nil. This function should accept the 288 or ange-ftp at startup if it is nil. This function should accept the
190 prompt string as its first argument, and the default value as its 289 prompt string as its first argument, and the default value as its
191 second argument.") 290 second argument."
192 291 :type '(choice (const :tag "Guess" :value nil)
193 (defvar url-gopher-labels 292 (const :tag "Use Ange-FTP" :value ange-ftp-read-passwd)
293 (const :tag "Use EFS" :value efs-read-passwd)
294 (const :tag "Use Password Package" :value read-passwd)
295 (function :tag "Other"))
296 :group 'url-hairy)
297
298 (defcustom url-gopher-labels
194 '(("0" . "(TXT)") 299 '(("0" . "(TXT)")
195 ("1" . "(DIR)") 300 ("1" . "(DIR)")
196 ("2" . "(CSO)") 301 ("2" . "(CSO)")
197 ("3" . "(ERR)") 302 ("3" . "(ERR)")
198 ("4" . "(MAC)") 303 ("4" . "(MAC)")
209 "*An assoc list of gopher types and how to describe them in the gopher 314 "*An assoc list of gopher types and how to describe them in the gopher
210 menus. These can be any string, but HTML/HTML+ entities should be 315 menus. These can be any string, but HTML/HTML+ entities should be
211 used when necessary, or it could disrupt formatting of the document 316 used when necessary, or it could disrupt formatting of the document
212 later on. It is also a good idea to make sure all the strings are the 317 later on. It is also a good idea to make sure all the strings are the
213 same length after entity references are removed, on a strictly 318 same length after entity references are removed, on a strictly
214 stylistic level.") 319 stylistic level."
215 320 :type '(repeat (cons (string :tag "Type")
216 (defvar url-gopher-icons 321 (string :tag "Description")))
322 :group 'url-hairy)
323
324 (defcustom url-gopher-icons
217 '( 325 '(
218 ("0" . "&text.document;") 326 ("0" . "&text.document;")
219 ("1" . "&folder;") 327 ("1" . "&folder;")
220 ("2" . "&index;") 328 ("2" . "&index;")
221 ("3" . "&stop;") 329 ("3" . "&stop;")
228 ("9" . "&binary.document;") 336 ("9" . "&binary.document;")
229 ("g" . "ℑ") 337 ("g" . "ℑ")
230 ("I" . "ℑ") 338 ("I" . "ℑ")
231 ("s" . "&audio;")) 339 ("s" . "&audio;"))
232 "*An assoc list of gopher types and the graphic entity references to 340 "*An assoc list of gopher types and the graphic entity references to
233 show when possible.") 341 show when possible."
234 342 :type '(repeat (cons (string :tag "Type")
235 (defvar url-standalone-mode nil "*Rely solely on the cache?") 343 (string :tag "Icon")))
236 (defvar url-multiple-p t 344 :group 'url-hairy)
237 "*If non-nil, multiple queries are possible through ` *URL-<i>*' buffers") 345
346 (defcustom url-standalone-mode nil "*Rely solely on the cache?"
347 :type 'boolean
348 :group 'url-cache)
349 (defcustom url-multiple-p t
350 "*If non-nil, multiple queries are possible through ` *URL-<i>*' buffers"
351 :type 'boolean
352 :group 'url-hairy)
238 (defvar url-default-working-buffer " *URL*" " The default buffer to do all of the processing in.") 353 (defvar url-default-working-buffer " *URL*" " The default buffer to do all of the processing in.")
239 (defvar url-working-buffer url-default-working-buffer 354 (defvar url-working-buffer url-default-working-buffer
240 "The buffer to do all of the processing in. 355 "The buffer to do all of the processing in.
241 It defaults to `url-default-working-buffer' and is bound to *URL-<i>* 356 It defaults to `url-default-working-buffer' and is bound to *URL-<i>*
242 buffers when used for multiple requests, cf. `url-multiple-p'") 357 buffers when used for multiple requests, cf. `url-multiple-p'")
254 (concat "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 369 (concat "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
255 "abcdefghijklmnopqrstuvwxyz" 370 "abcdefghijklmnopqrstuvwxyz"
256 "0123456789'()+_,-./=?")) 371 "0123456789'()+_,-./=?"))
257 "Characters allowable in a MIME multipart separator.") 372 "Characters allowable in a MIME multipart separator.")
258 373
259 (defvar url-bad-port-list 374 (defcustom url-bad-port-list
260 '("25" "119" "19") 375 '("25" "119" "19")
261 "*List of ports to warn the user about connecting to. Defaults to just 376 "*List of ports to warn the user about connecting to. Defaults to just
262 the mail, chargen, and NNTP ports so you cannot be tricked into sending 377 the mail, chargen, and NNTP ports so you cannot be tricked into sending
263 fake mail or forging messages by a malicious HTML document.") 378 fake mail or forging messages by a malicious HTML document."
264 379 :type '(repeat (string :tag "Port"))
265 (defvar url-be-anal-about-file-attributes nil 380 :group 'url-hairy)
381
382 (defcustom url-be-anal-about-file-attributes nil
266 "*Whether to use HTTP/1.0 to figure out file attributes 383 "*Whether to use HTTP/1.0 to figure out file attributes
267 or just guess based on file extension, etc.") 384 or just guess based on file extension, etc."
268 385 :type 'boolean
269 (defvar url-be-asynchronous nil 386 :group 'url-mime)
387
388 (defcustom url-be-asynchronous nil
270 "*Controls whether document retrievals over HTTP should be done in 389 "*Controls whether document retrievals over HTTP should be done in
271 the background. This allows you to keep working in other windows 390 the background. This allows you to keep working in other windows
272 while large downloads occur.") 391 while large downloads occur."
392 :type 'boolean
393 :group 'url)
273 (make-variable-buffer-local 'url-be-asynchronous) 394 (make-variable-buffer-local 'url-be-asynchronous)
274 395
275 (defvar url-request-data nil "Any data to send with the next request.") 396 (defvar url-request-data nil "Any data to send with the next request.")
276 397
277 (defvar url-request-extra-headers nil 398 (defvar url-request-extra-headers nil
282 403
283 (defvar url-mime-encoding-string nil 404 (defvar url-mime-encoding-string nil
284 "*String to send to the server in the Accept-encoding: field in HTTP/1.0 405 "*String to send to the server in the Accept-encoding: field in HTTP/1.0
285 requests. This is created automatically from mm-content-transfer-encodings.") 406 requests. This is created automatically from mm-content-transfer-encodings.")
286 407
287 (defvar url-mime-language-string "*" 408 (defcustom url-mime-language-string "*"
288 "*String to send to the server in the Accept-language: field in 409 "*String to send to the server in the Accept-language: field in
289 HTTP/1.0 requests.") 410 HTTP/1.0 requests."
411 :type 'string
412 :group 'url-mime
413 :group 'i18n)
290 414
291 (defvar url-mime-accept-string nil 415 (defvar url-mime-accept-string nil
292 "String to send to the server in the Accept: field in HTTP/1.0 requests. 416 "String to send to the server in the Accept: field in HTTP/1.0 requests.
293 This is created automatically from url-mime-viewers, after the mailcap file 417 This is created automatically from url-mime-viewers, after the mailcap file
294 has been parsed.") 418 has been parsed.")
307 (defvar url-package-name "Unknown" "Version # of package using URL.") 431 (defvar url-package-name "Unknown" "Version # of package using URL.")
308 432
309 (defvar url-system-type nil "What type of system we are on.") 433 (defvar url-system-type nil "What type of system we are on.")
310 (defvar url-os-type nil "What OS we are on.") 434 (defvar url-os-type nil "What OS we are on.")
311 435
312 (defvar url-max-password-attempts 5 436 (defcustom url-max-password-attempts 5
313 "*Maximum number of times a password will be prompted for when a 437 "*Maximum number of times a password will be prompted for when a
314 protected document is denied by the server.") 438 protected document is denied by the server."
315 439 :type 'integer
316 (defvar url-temporary-directory (or (getenv "TMPDIR") "/tmp") 440 :group 'url)
317 "*Where temporary files go.") 441
318 442 (defcustom url-temporary-directory (or (getenv "TMPDIR") "/tmp")
319 (defvar url-show-status t 443 "*Where temporary files go."
444 :type 'directory
445 :group 'url-file)
446
447 (defcustom url-show-status t
320 "*Whether to show a running total of bytes transferred. Can cause a 448 "*Whether to show a running total of bytes transferred. Can cause a
321 large hit if using a remote X display over a slow link, or a terminal 449 large hit if using a remote X display over a slow link, or a terminal
322 with a slow modem.") 450 with a slow modem."
451 :type 'boolean
452 :group 'url)
323 453
324 (defvar url-using-proxy nil 454 (defvar url-using-proxy nil
325 "Either nil or the fully qualified proxy URL in use, e.g. 455 "Either nil or the fully qualified proxy URL in use, e.g.
326 http://www.domain.com/") 456 http://www.domain.com/")
327 457
328 (defvar url-news-server nil 458 (defcustom url-news-server nil
329 "*The default news server to get newsgroups/articles from if no server 459 "*The default news server to get newsgroups/articles from if no server
330 is specified in the URL. Defaults to the environment variable NNTPSERVER 460 is specified in the URL. Defaults to the environment variable NNTPSERVER
331 or \"news\" if NNTPSERVER is undefined.") 461 or \"news\" if NNTPSERVER is undefined."
332 462 :type '(choice (const :tag "None" :value nil) string)
333 (defvar url-gopher-to-mime 463 :group 'url)
464
465 (defcustom url-gopher-to-mime
334 '((?0 . "text/plain") ; It's a file 466 '((?0 . "text/plain") ; It's a file
335 (?1 . "www/gopher") ; Gopher directory 467 (?1 . "www/gopher") ; Gopher directory
336 (?2 . "www/gopher-cso-search") ; CSO search 468 (?2 . "www/gopher-cso-search") ; CSO search
337 (?3 . "text/plain") ; Error 469 (?3 . "text/plain") ; Error
338 (?4 . "application/mac-binhex40") ; Binhexed macintosh file 470 (?4 . "application/mac-binhex40") ; Binhexed macintosh file
343 (?g . "image/gif") ; Gif file 475 (?g . "image/gif") ; Gif file
344 (?I . "image/gif") ; Some sort of image 476 (?I . "image/gif") ; Some sort of image
345 (?h . "text/html") ; HTML source 477 (?h . "text/html") ; HTML source
346 (?s . "audio/basic") ; Sound file 478 (?s . "audio/basic") ; Sound file
347 ) 479 )
348 "*An assoc list of gopher types and their corresponding MIME types.") 480 "*An assoc list of gopher types and their corresponding MIME types."
349 481 :type '(repeat (cons sexp string))
350 (defvar url-use-hypertext-gopher t 482 :group 'url-hairy)
483
484 (defcustom url-use-hypertext-gopher t
351 "*Controls how gopher documents are retrieved. 485 "*Controls how gopher documents are retrieved.
352 If non-nil, the gopher pages will be converted into HTML and parsed 486 If non-nil, the gopher pages will be converted into HTML and parsed
353 just like any other page. If nil, the requests will be passed off to 487 just like any other page. If nil, the requests will be passed off to
354 the gopher.el package by Scott Snyder. Using the gopher.el package 488 the gopher.el package by Scott Snyder. Using the gopher.el package
355 will lose the gopher+ support, and inlined searching.") 489 will lose the gopher+ support, and inlined searching."
490 :type 'boolean
491 :group 'url)
356 492
357 (defvar url-global-history-hash-table nil 493 (defvar url-global-history-hash-table nil
358 "Hash table for global history completion.") 494 "Hash table for global history completion.")
359 495
360 (defvar url-nonrelative-link 496 (defvar url-nonrelative-link
361 "^\\([-a-zA-Z0-9+.]+:\\)" 497 "^\\([-a-zA-Z0-9+.]+:\\)"
362 "A regular expression that will match an absolute URL.") 498 "A regular expression that will match an absolute URL.")
363 499
364 (defvar url-confirmation-func 'y-or-n-p 500 (defcustom url-confirmation-func 'y-or-n-p
365 "*What function to use for asking yes or no functions. Possible 501 "*What function to use for asking yes or no functions. Possible
366 values are 'yes-or-no-p or 'y-or-n-p, or any function that takes a 502 values are 'yes-or-no-p or 'y-or-n-p, or any function that takes a
367 single argument (the prompt), and returns t only if a positive answer 503 single argument (the prompt), and returns t only if a positive answer
368 is gotten.") 504 is gotten."
369 505 :type '(choice (const :tag "Short (y or n)" :value y-or-n-p)
370 (defvar url-gateway-method 'native 506 (const :tag "Long (yes or no)" :value yes-or-no-p)
507 (function :tag "Other"))
508 :group 'url-hairy)
509
510 (defcustom url-gateway-method 'native
371 "*The type of gateway support to use. 511 "*The type of gateway support to use.
372 Should be a symbol specifying how we are to get a connection off of the 512 Should be a symbol specifying how we are to get a connection off of the
373 local machine. 513 local machine.
374 514
375 Currently supported methods: 515 Currently supported methods:
379 'ssl :: Connection should be made with SSL 519 'ssl :: Connection should be made with SSL
380 'tcp :: Use the excellent tcp.el package from gnus. 520 'tcp :: Use the excellent tcp.el package from gnus.
381 This simply does a (require 'tcp), then sets 521 This simply does a (require 'tcp), then sets
382 url-gateway-method to be 'native. 522 url-gateway-method to be 'native.
383 'native :: Use the native open-network-stream in emacs 523 'native :: Use the native open-network-stream in emacs
384 ") 524 "
525 :type '(radio (const :tag "Telnet to gateway host" :value telnet)
526 (const :tag "Rlogin to gateway host" :value rlogin)
527 (const :tag "Use SOCKS proxy" :value socks)
528 (const :tag "Use SSL for all connections" :value ssl)
529 (const :tag "Use the `tcp' package" :value tcp)
530 (const :tag "Direct connection" :value native))
531 :group 'url-hairy)
385 532
386 (defvar url-running-xemacs (string-match "XEmacs" emacs-version) 533 (defvar url-running-xemacs (string-match "XEmacs" emacs-version)
387 "*Got XEmacs?") 534 "*Got XEmacs?")
388 535
389 (defvar url-default-ports '(("http" . "80") 536 (defvar url-default-ports '(("http" . "80")