14
|
1 ;;; url-vars.el --- Variables for Uniform Resource Locator tool
|
|
2 ;; Author: wmperry
|
26
|
3 ;; Created: 1997/02/18 23:35:21
|
|
4 ;; Version: 1.28
|
14
|
5 ;; Keywords: comm, data, processes, hypermedia
|
|
6
|
|
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
8 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
|
16
|
9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
|
14
|
10 ;;;
|
|
11 ;;; This file is not part of GNU Emacs, but the same permissions apply.
|
|
12 ;;;
|
|
13 ;;; GNU Emacs is free software; you can redistribute it and/or modify
|
|
14 ;;; it under the terms of the GNU General Public License as published by
|
|
15 ;;; the Free Software Foundation; either version 2, or (at your option)
|
|
16 ;;; any later version.
|
|
17 ;;;
|
|
18 ;;; GNU Emacs is distributed in the hope that it will be useful,
|
|
19 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
21 ;;; GNU General Public License for more details.
|
|
22 ;;;
|
|
23 ;;; You should have received a copy of the GNU General Public License
|
|
24 ;;; along with GNU Emacs; see the file COPYING. If not, write to the
|
|
25 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
26 ;;; Boston, MA 02111-1307, USA.
|
|
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
28
|
|
29 (defconst url-version (let ((x "Exp"))
|
|
30 (if (string-match "State: \\([^ \t\n]+\\)" x)
|
|
31 (substring x (match-beginning 1) (match-end 1))
|
|
32 x))
|
|
33 "Version # of URL package.")
|
|
34
|
|
35 (defvar url-current-can-be-cached t
|
|
36 "*Whether the current URL can be cached.")
|
|
37
|
|
38 (defvar url-current-object nil
|
|
39 "A parsed representation of the current url")
|
|
40
|
|
41 (defvar url-current-callback-func nil
|
|
42 "*The callback function for the current buffer.")
|
|
43
|
|
44 (defvar url-current-callback-data nil
|
|
45 "*The data to be passed to the callback function. This should be a list,
|
|
46 each item in the list will be an argument to the url-current-callback-func.")
|
|
47
|
|
48 (mapcar 'make-variable-buffer-local '(
|
|
49 url-current-callback-data
|
|
50 url-current-callback-func
|
|
51 url-current-can-be-cached
|
|
52 url-current-content-length
|
|
53 url-current-isindex
|
|
54 url-current-mime-encoding
|
|
55 url-current-mime-headers
|
|
56 url-current-mime-type
|
|
57 url-current-mime-viewer
|
|
58 url-current-object
|
|
59 url-current-referer
|
26
|
60
|
|
61 ;; obsolete
|
|
62 ;; url-current-file
|
|
63 ;; url-current-port
|
|
64 ;; url-current-server
|
|
65 ;; url-current-type
|
|
66 ;; url-current-user
|
14
|
67 ))
|
|
68
|
16
|
69 (defvar url-cookie-storage nil "Where cookies are stored.")
|
|
70 (defvar url-cookie-secure-storage nil "Where secure cookies are stored.")
|
|
71 (defvar url-cookie-file nil "*Where cookies are stored on disk.")
|
|
72
|
14
|
73 (defvar url-default-retrieval-proc 'url-default-callback
|
|
74 "*The default action to take when an asynchronous retrieval completes.")
|
|
75
|
|
76 (defvar url-honor-refresh-requests t
|
|
77 "*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.
|
|
79 If nil, no refresh requests will be honored.
|
|
80 If t, all refresh requests will be honored.
|
|
81 If non-nil and not t, the user will be asked for each refresh request.")
|
|
82
|
|
83 (defvar url-inhibit-mime-parsing nil
|
|
84 "Whether to parse out (and delete) the MIME headers from a message.")
|
|
85
|
|
86 (defvar url-automatic-caching nil
|
|
87 "*If non-nil, all documents will be automatically cached to the local
|
|
88 disk.")
|
|
89
|
|
90 (defvar url-cache-expired
|
|
91 (function (lambda (t1 t2) (>= (- (car t2) (car t1)) 5)))
|
|
92 "*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
|
|
94 time.")
|
|
95
|
26
|
96 (defvar url-bug-address "wmperry@cs.indiana.edu"
|
|
97 "Where to send bug reports.")
|
14
|
98
|
|
99 (defvar url-cookie-confirmation nil
|
26
|
100 "*If non-nil, confirmation by the user is required to accept HTTP cookies.")
|
14
|
101
|
|
102 (defvar url-personal-mail-address nil
|
26
|
103 "*Your full email address.
|
|
104 This is what is sent to HTTP/1.0 servers as the FROM field in an HTTP/1.0
|
|
105 request.")
|
14
|
106
|
|
107 (defvar url-directory-index-file "index.html"
|
|
108 "*The filename to look for when indexing a directory. If this file
|
|
109 exists, and is readable, then it will be viewed instead of
|
|
110 automatically creating the directory listing.")
|
|
111
|
|
112 (defvar url-privacy-level 'none
|
|
113 "*How private you want your requests to be.
|
|
114 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.
|
|
116 This variable controls how much of this information is sent.
|
|
117
|
|
118 This should a symbol or a list.
|
|
119 Valid values if a symbol are:
|
|
120 none -- Send all information
|
|
121 low -- Don't send the last location
|
|
122 high -- Don't send the email address or last location
|
|
123 paranoid -- Don't send anything
|
|
124
|
|
125 If a list, this should be a list of symbols of what NOT to send.
|
|
126 Valid symbols are:
|
|
127 email -- the email address
|
|
128 os -- the operating system info
|
|
129 lastloc -- the last location
|
|
130 agent -- Do not send the User-Agent string
|
|
131 cookie -- never accept HTTP cookies
|
|
132
|
|
133 Samples:
|
|
134
|
|
135 (setq url-privacy-level 'high)
|
|
136 (setq url-privacy-level '(email lastloc)) ;; equivalent to 'high
|
|
137 (setq url-privacy-level '(os))
|
|
138
|
|
139 ::NOTE::
|
|
140 This variable controls several other variables and is _NOT_ automatically
|
|
141 updated. Call the function `url-setup-privacy-info' after modifying this
|
|
142 variable.
|
|
143 ")
|
|
144
|
|
145 (defvar url-history-list nil "List of urls visited this session.")
|
|
146
|
|
147 (defvar url-inhibit-uncompression nil "Do not do decompression if non-nil.")
|
|
148
|
|
149 (defvar url-keep-history nil
|
|
150 "*Controls whether to keep a list of all the URLS being visited. If
|
|
151 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
|
|
153 session.")
|
|
154
|
|
155 (defvar url-uncompressor-alist '((".z" . "x-gzip")
|
26
|
156 (".gz" . "x-gzip")
|
|
157 (".uue" . "x-uuencoded")
|
|
158 (".hqx" . "x-hqx")
|
|
159 (".Z" . "x-compress"))
|
14
|
160 "*An assoc list of file extensions and the appropriate
|
|
161 content-transfer-encodings for each.")
|
|
162
|
|
163 (defvar url-mail-command 'url-mail
|
|
164 "*This function will be called whenever url needs to send mail. It should
|
|
165 enter a mail-mode-like buffer in the current window.
|
|
166 The commands mail-to and mail-subject should still work in this
|
|
167 buffer, and it should use mail-header-separator if possible.")
|
|
168
|
|
169 (defvar url-proxy-services nil
|
|
170 "*An assoc list of access types and servers that gateway them.
|
16
|
171 Looks like ((\"http\" . \"hostname:portnumber\") ....) This is set up
|
14
|
172 from the ACCESS_proxy environment variables in url-do-setup.")
|
|
173
|
|
174 (defvar url-global-history-file nil
|
|
175 "*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
|
|
177 is parsed at startup and used to provide URL completion.")
|
|
178
|
|
179 (defvar url-global-history-save-interval 3600
|
|
180 "*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'
|
|
182 has been run, you need to run the `url-setup-save-timer' function manually.")
|
|
183
|
|
184 (defvar url-global-history-timer nil)
|
|
185
|
|
186 (defvar url-passwd-entry-func nil
|
|
187 "*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
|
|
189 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
|
|
191 second argument.")
|
|
192
|
|
193 (defvar url-gopher-labels
|
|
194 '(("0" . "(TXT)")
|
|
195 ("1" . "(DIR)")
|
|
196 ("2" . "(CSO)")
|
|
197 ("3" . "(ERR)")
|
|
198 ("4" . "(MAC)")
|
|
199 ("5" . "(PCB)")
|
|
200 ("6" . "(UUX)")
|
|
201 ("7" . "(???)")
|
|
202 ("8" . "(TEL)")
|
|
203 ("T" . "(TN3)")
|
|
204 ("9" . "(BIN)")
|
|
205 ("g" . "(GIF)")
|
|
206 ("I" . "(IMG)")
|
|
207 ("h" . "(WWW)")
|
|
208 ("s" . "(SND)"))
|
|
209 "*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
|
|
211 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
|
|
213 same length after entity references are removed, on a strictly
|
|
214 stylistic level.")
|
|
215
|
|
216 (defvar url-gopher-icons
|
|
217 '(
|
|
218 ("0" . "&text.document;")
|
|
219 ("1" . "&folder;")
|
|
220 ("2" . "&index;")
|
|
221 ("3" . "&stop;")
|
|
222 ("4" . "&binhex.document;")
|
|
223 ("5" . "&binhex.document;")
|
|
224 ("6" . "&uuencoded.document;")
|
|
225 ("7" . "&index;")
|
|
226 ("8" . "&telnet;")
|
|
227 ("T" . "&tn3270;")
|
|
228 ("9" . "&binary.document;")
|
|
229 ("g" . "ℑ")
|
|
230 ("I" . "ℑ")
|
|
231 ("s" . "&audio;"))
|
|
232 "*An assoc list of gopher types and the graphic entity references to
|
|
233 show when possible.")
|
|
234
|
|
235 (defvar url-standalone-mode nil "*Rely solely on the cache?")
|
|
236 (defvar url-multiple-p t
|
|
237 "*If non-nil, multiple queries are possible through ` *URL-<i>*' buffers")
|
|
238 (defvar url-default-working-buffer " *URL*" " The default buffer to do all of the processing in.")
|
26
|
239 (defvar url-working-buffer url-default-working-buffer
|
|
240 "The buffer to do all of the processing in.
|
|
241 It defaults to `url-default-working-buffer' and is bound to *URL-<i>*
|
|
242 buffers when used for multiple requests, cf. `url-multiple-p'")
|
14
|
243 (defvar url-current-referer nil "Referer of this page.")
|
|
244 (defvar url-current-content-length nil "Current content length.")
|
|
245 (defvar url-current-isindex nil "Is the current document a searchable index?")
|
|
246 (defvar url-current-mime-encoding nil "MIME encoding of current document.")
|
|
247 (defvar url-current-mime-headers nil "An alist of MIME headers.")
|
|
248 (defvar url-current-mime-type nil "MIME type of current document.")
|
|
249 (defvar url-current-mime-viewer nil "How to view the current MIME doc.")
|
|
250 (defvar url-current-passwd-count 0 "How many times password has failed.")
|
|
251 (defvar url-gopher-types "0123456789+gIThws:;<"
|
|
252 "A string containing character representations of all the gopher types.")
|
|
253 (defvar url-mime-separator-chars (mapcar 'identity
|
|
254 (concat "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
255 "abcdefghijklmnopqrstuvwxyz"
|
|
256 "0123456789'()+_,-./=?"))
|
|
257 "Characters allowable in a MIME multipart separator.")
|
|
258
|
|
259 (defvar url-bad-port-list
|
|
260 '("25" "119" "19")
|
|
261 "*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
|
|
263 fake mail or forging messages by a malicious HTML document.")
|
|
264
|
|
265 (defvar url-be-anal-about-file-attributes nil
|
|
266 "*Whether to use HTTP/1.0 to figure out file attributes
|
|
267 or just guess based on file extension, etc.")
|
|
268
|
|
269 (defvar url-be-asynchronous nil
|
|
270 "*Controls whether document retrievals over HTTP should be done in
|
|
271 the background. This allows you to keep working in other windows
|
|
272 while large downloads occur.")
|
|
273 (make-variable-buffer-local 'url-be-asynchronous)
|
|
274
|
|
275 (defvar url-request-data nil "Any data to send with the next request.")
|
|
276
|
|
277 (defvar url-request-extra-headers nil
|
|
278 "A list of extra headers to send with the next request. Should be
|
|
279 an assoc list of headers/contents.")
|
|
280
|
|
281 (defvar url-request-method nil "The method to use for the next request.")
|
|
282
|
|
283 (defvar url-mime-encoding-string nil
|
26
|
284 "*String to send to the server in the Accept-encoding: field in HTTP/1.0
|
14
|
285 requests. This is created automatically from mm-content-transfer-encodings.")
|
|
286
|
|
287 (defvar url-mime-language-string "*"
|
26
|
288 "*String to send to the server in the Accept-language: field in
|
14
|
289 HTTP/1.0 requests.")
|
|
290
|
|
291 (defvar url-mime-accept-string nil
|
|
292 "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
|
|
294 has been parsed.")
|
|
295
|
|
296 (defvar url-history-changed-since-last-save nil
|
|
297 "Whether the history list has changed since the last save operation.")
|
|
298
|
|
299 (defvar url-proxy-basic-authentication nil
|
|
300 "Internal structure - do not modify!")
|
|
301
|
|
302 (defvar url-registered-protocols nil
|
|
303 "Internal structure - do not modify! See `url-register-protocol'")
|
|
304
|
|
305 (defvar url-package-version "Unknown" "Version # of package using URL.")
|
|
306
|
|
307 (defvar url-package-name "Unknown" "Version # of package using URL.")
|
|
308
|
|
309 (defvar url-system-type nil "What type of system we are on.")
|
|
310 (defvar url-os-type nil "What OS we are on.")
|
|
311
|
|
312 (defvar url-max-password-attempts 5
|
|
313 "*Maximum number of times a password will be prompted for when a
|
|
314 protected document is denied by the server.")
|
|
315
|
|
316 (defvar url-temporary-directory "/tmp" "*Where temporary files go.")
|
|
317
|
|
318 (defvar url-show-status t
|
|
319 "*Whether to show a running total of bytes transferred. Can cause a
|
|
320 large hit if using a remote X display over a slow link, or a terminal
|
|
321 with a slow modem.")
|
|
322
|
|
323 (defvar url-using-proxy nil
|
|
324 "Either nil or the fully qualified proxy URL in use, e.g.
|
|
325 http://www.domain.com/")
|
|
326
|
|
327 (defvar url-news-server nil
|
|
328 "*The default news server to get newsgroups/articles from if no server
|
|
329 is specified in the URL. Defaults to the environment variable NNTPSERVER
|
|
330 or \"news\" if NNTPSERVER is undefined.")
|
|
331
|
|
332 (defvar url-gopher-to-mime
|
|
333 '((?0 . "text/plain") ; It's a file
|
|
334 (?1 . "www/gopher") ; Gopher directory
|
|
335 (?2 . "www/gopher-cso-search") ; CSO search
|
|
336 (?3 . "text/plain") ; Error
|
|
337 (?4 . "application/mac-binhex40") ; Binhexed macintosh file
|
|
338 (?5 . "application/pc-binhex40") ; DOS binary archive of some sort
|
|
339 (?6 . "archive/x-uuencode") ; Unix uuencoded file
|
|
340 (?7 . "www/gopher-search") ; Gopher search!
|
|
341 (?9 . "application/octet-stream") ; Binary file!
|
|
342 (?g . "image/gif") ; Gif file
|
|
343 (?I . "image/gif") ; Some sort of image
|
|
344 (?h . "text/html") ; HTML source
|
|
345 (?s . "audio/basic") ; Sound file
|
|
346 )
|
|
347 "*An assoc list of gopher types and their corresponding MIME types.")
|
|
348
|
|
349 (defvar url-use-hypertext-gopher t
|
|
350 "*Controls how gopher documents are retrieved.
|
|
351 If non-nil, the gopher pages will be converted into HTML and parsed
|
|
352 just like any other page. If nil, the requests will be passed off to
|
|
353 the gopher.el package by Scott Snyder. Using the gopher.el package
|
|
354 will lose the gopher+ support, and inlined searching.")
|
|
355
|
|
356 (defvar url-global-history-hash-table nil
|
|
357 "Hash table for global history completion.")
|
|
358
|
|
359 (defvar url-nonrelative-link
|
|
360 "^\\([-a-zA-Z0-9+.]+:\\)"
|
|
361 "A regular expression that will match an absolute URL.")
|
|
362
|
|
363 (defvar url-confirmation-func 'y-or-n-p
|
|
364 "*What function to use for asking yes or no functions. Possible
|
|
365 values are 'yes-or-no-p or 'y-or-n-p, or any function that takes a
|
|
366 single argument (the prompt), and returns t only if a positive answer
|
|
367 is gotten.")
|
|
368
|
|
369 (defvar url-gateway-method 'native
|
|
370 "*The type of gateway support to use.
|
|
371 Should be a symbol specifying how we are to get a connection off of the
|
|
372 local machine.
|
|
373
|
|
374 Currently supported methods:
|
16
|
375 'telnet :: Run telnet in a subprocess to connect
|
|
376 'rlogin :: Rlogin to another machine to connect
|
|
377 'socks :: Connects through a socks server
|
|
378 'ssl :: Connection should be made with SSL
|
14
|
379 'tcp :: Use the excellent tcp.el package from gnus.
|
|
380 This simply does a (require 'tcp), then sets
|
16
|
381 url-gateway-method to be 'native.
|
|
382 'native :: Use the native open-network-stream in emacs
|
|
383 ")
|
14
|
384
|
|
385 (defvar url-running-xemacs (string-match "XEmacs" emacs-version)
|
26
|
386 "*Got XEmacs?")
|
14
|
387
|
|
388 (defvar url-default-ports '(("http" . "80")
|
|
389 ("gopher" . "70")
|
|
390 ("telnet" . "23")
|
|
391 ("news" . "119")
|
|
392 ("https" . "443")
|
|
393 ("shttp" . "80"))
|
|
394 "An assoc list of protocols and default port #s")
|
|
395
|
|
396 (defvar url-setup-done nil "*Has setup configuration been done?")
|
|
397
|
|
398 (defvar url-source nil
|
|
399 "*Whether to force a sourcing of the next buffer. This forces local
|
|
400 files to be read into a buffer, no matter what. Gets around the
|
|
401 optimization that if you are passing it to a viewer, just make a
|
|
402 symbolic link, which looses if you want the source for inlined
|
|
403 images/etc.")
|
|
404
|
|
405 (defconst weekday-alist
|
|
406 '(("Sunday" . 0) ("Monday" . 1) ("Tuesday" . 2) ("Wednesday" . 3)
|
|
407 ("Thursday" . 4) ("Friday" . 5) ("Saturday" . 6)
|
|
408 ("Tues" . 2) ("Thurs" . 4)
|
|
409 ("Sun" . 0) ("Mon" . 1) ("Tue" . 2) ("Wed" . 3)
|
|
410 ("Thu" . 4) ("Fri" . 5) ("Sat" . 6)))
|
|
411
|
|
412 (defconst monthabbrev-alist
|
|
413 '(("Jan" . 1) ("Feb" . 2) ("Mar" . 3) ("Apr" . 4) ("May" . 5) ("Jun" . 6)
|
|
414 ("Jul" . 7) ("Aug" . 8) ("Sep" . 9) ("Oct" . 10) ("Nov" . 11) ("Dec" . 12))
|
|
415 )
|
|
416
|
|
417 (defvar url-lazy-message-time 0)
|
|
418
|
|
419 (defvar url-extensions-header "Security/Digest Security/SSL")
|
|
420
|
|
421 (defvar url-mailserver-syntax-table
|
|
422 (copy-syntax-table emacs-lisp-mode-syntax-table)
|
|
423 "*A syntax table for parsing the mailserver URL")
|
|
424
|
|
425 (modify-syntax-entry ?' "\"" url-mailserver-syntax-table)
|
|
426 (modify-syntax-entry ?` "\"" url-mailserver-syntax-table)
|
|
427 (modify-syntax-entry ?< "(>" url-mailserver-syntax-table)
|
|
428 (modify-syntax-entry ?> ")<" url-mailserver-syntax-table)
|
|
429 (modify-syntax-entry ?/ " " url-mailserver-syntax-table)
|
|
430
|
|
431 ;;; Make OS/2 happy - yeeks
|
|
432 (defvar tcp-binary-process-input-services nil
|
|
433 "*Make OS/2 happy with our CRLF pairs...")
|
|
434
|
|
435 (provide 'url-vars)
|