14
|
1 ;;; url-vars.el --- Variables for Uniform Resource Locator tool
|
|
2 ;; Author: wmperry
|
124
|
3 ;; Created: 1997/04/11 14:49:23
|
|
4 ;; Version: 1.52
|
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
|
124
|
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"))
|
14
|
42 (if (string-match "State: \\([^ \t\n]+\\)" x)
|
|
43 (substring x (match-beginning 1) (match-end 1))
|
|
44 x))
|
|
45 "Version # of URL package.")
|
|
46
|
124
|
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
|
|
83
|
14
|
84 (defvar url-current-can-be-cached t
|
|
85 "*Whether the current URL can be cached.")
|
|
86
|
|
87 (defvar url-current-object nil
|
|
88 "A parsed representation of the current url")
|
|
89
|
|
90 (defvar url-current-callback-func nil
|
|
91 "*The callback function for the current buffer.")
|
|
92
|
|
93 (defvar url-current-callback-data nil
|
|
94 "*The data to be passed to the callback function. This should be a list,
|
|
95 each item in the list will be an argument to the url-current-callback-func.")
|
|
96
|
|
97 (mapcar 'make-variable-buffer-local '(
|
|
98 url-current-callback-data
|
|
99 url-current-callback-func
|
|
100 url-current-can-be-cached
|
|
101 url-current-content-length
|
|
102 url-current-isindex
|
|
103 url-current-mime-encoding
|
|
104 url-current-mime-headers
|
|
105 url-current-mime-type
|
|
106 url-current-mime-viewer
|
|
107 url-current-object
|
|
108 url-current-referer
|
102
|
109
|
|
110 ;; obsolete
|
|
111 ;; url-current-file
|
|
112 ;; url-current-port
|
|
113 ;; url-current-server
|
|
114 ;; url-current-type
|
|
115 ;; url-current-user
|
14
|
116 ))
|
|
117
|
16
|
118 (defvar url-cookie-storage nil "Where cookies are stored.")
|
|
119 (defvar url-cookie-secure-storage nil "Where secure cookies are stored.")
|
124
|
120 (defcustom url-cookie-file nil "*Where cookies are stored on disk."
|
|
121 :type '(choice (const :tag "Default" :value nil) file)
|
|
122 :group 'url-file
|
|
123 :group 'url-cookie)
|
16
|
124
|
124
|
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)
|
14
|
129
|
124
|
130 (defcustom url-honor-refresh-requests t
|
14
|
131 "*Whether to do automatic page reloads at the request of the document
|
|
132 author or the server via the `Refresh' header in an HTTP/1.0 response.
|
|
133 If nil, no refresh requests will be honored.
|
|
134 If t, all refresh requests will be honored.
|
124
|
135 If non-nil and not t, the user will be asked for each refresh request."
|
|
136 :type '(choice (const :tag "off" nil)
|
|
137 (const :tag "on" t)
|
|
138 (const :tag "ask" 'ask))
|
|
139 :group 'url-hairy)
|
14
|
140
|
124
|
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
|
14
|
147 "*If non-nil, all documents will be automatically cached to the local
|
124
|
148 disk."
|
|
149 :type 'boolean
|
|
150 :group 'url-cache)
|
14
|
151
|
124
|
152 (defcustom url-cache-expired
|
14
|
153 (function (lambda (t1 t2) (>= (- (car t2) (car t1)) 5)))
|
|
154 "*A function (`funcall'able) that takes two times as its arguments, and
|
|
155 returns non-nil if the second time is 'too old' when compared to the first
|
124
|
156 time."
|
|
157 :type 'function
|
|
158 :group 'url-cache)
|
14
|
159
|
102
|
160 (defvar url-bug-address "wmperry@cs.indiana.edu"
|
|
161 "Where to send bug reports.")
|
14
|
162
|
124
|
163 (defcustom url-cookie-confirmation nil
|
|
164 "*If non-nil, confirmation by the user is required to accept HTTP cookies."
|
|
165 :type 'boolean
|
|
166 :group 'url-cookie)
|
14
|
167
|
124
|
168 (defcustom url-personal-mail-address nil
|
102
|
169 "*Your full email address.
|
|
170 This is what is sent to HTTP/1.0 servers as the FROM field in an HTTP/1.0
|
124
|
171 request."
|
|
172 :type '(choice (const nil) string)
|
|
173 :group 'url)
|
14
|
174
|
124
|
175 (defcustom url-directory-index-file "index.html"
|
|
176 "*The filename to look for when indexing a directory.
|
|
177 If this file exists, and is readable, then it will be viewed instead of
|
|
178 using `dired' to view the directory."
|
|
179 :type 'string
|
|
180 :group 'url-file)
|
14
|
181
|
124
|
182 (defcustom url-privacy-level '(email)
|
14
|
183 "*How private you want your requests to be.
|
|
184 HTTP/1.0 has header fields for various information about the user, including
|
|
185 operating system information, email addresses, the last page you visited, etc.
|
|
186 This variable controls how much of this information is sent.
|
|
187
|
|
188 This should a symbol or a list.
|
|
189 Valid values if a symbol are:
|
|
190 none -- Send all information
|
|
191 low -- Don't send the last location
|
|
192 high -- Don't send the email address or last location
|
|
193 paranoid -- Don't send anything
|
|
194
|
|
195 If a list, this should be a list of symbols of what NOT to send.
|
|
196 Valid symbols are:
|
|
197 email -- the email address
|
|
198 os -- the operating system info
|
|
199 lastloc -- the last location
|
|
200 agent -- Do not send the User-Agent string
|
|
201 cookie -- never accept HTTP cookies
|
|
202
|
|
203 Samples:
|
|
204
|
124
|
205 (setq url-privacy-level 'high)
|
|
206 (setq url-privacy-level '(email lastloc)) ;; equivalent to 'high
|
|
207 (setq url-privacy-level '(os))
|
14
|
208
|
|
209 ::NOTE::
|
|
210 This variable controls several other variables and is _NOT_ automatically
|
|
211 updated. Call the function `url-setup-privacy-info' after modifying this
|
124
|
212 variable."
|
|
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)
|
14
|
228
|
|
229 (defvar url-history-list nil "List of urls visited this session.")
|
|
230
|
|
231 (defvar url-inhibit-uncompression nil "Do not do decompression if non-nil.")
|
|
232
|
124
|
233 (defcustom url-keep-history nil
|
|
234 "*Controls whether to keep a list of all the URLS being visited.
|
|
235 If non-nil, url will keep track of all the URLS visited.
|
14
|
236 If eq to `t', then the list is saved to disk at the end of each emacs
|
124
|
237 session."
|
|
238 :type 'boolean
|
|
239 :group 'url-history)
|
14
|
240
|
124
|
241 (defcustom url-uncompressor-alist '((".z" . "x-gzip")
|
|
242 (".gz" . "x-gzip")
|
|
243 (".uue" . "x-uuencoded")
|
|
244 (".hqx" . "x-hqx")
|
|
245 (".Z" . "x-compress"))
|
14
|
246 "*An assoc list of file extensions and the appropriate
|
124
|
247 content-transfer-encodings for each."
|
|
248 :type '(repeat (cons (string :tag "Extension") (string :tag "Encoding")))
|
|
249 :group 'url-mime)
|
14
|
250
|
124
|
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.
|
14
|
254 The commands mail-to and mail-subject should still work in this
|
124
|
255 buffer, and it should use mail-header-separator if possible."
|
|
256 :type 'function
|
|
257 :group 'url)
|
14
|
258
|
124
|
259 (defcustom url-proxy-services nil
|
14
|
260 "*An assoc list of access types and servers that gateway them.
|
16
|
261 Looks like ((\"http\" . \"hostname:portnumber\") ....) This is set up
|
124
|
262 from the ACCESS_proxy environment variables in url-do-setup."
|
|
263 :type '(repeat (cons (string :tag "Protocol")
|
|
264 (string :tag "Proxy"
|
|
265 :validate widget-field-validate
|
|
266 :valid-regexp "^[a-z.0-9-:]+$")))
|
|
267 :group 'url)
|
14
|
268
|
124
|
269 (defcustom url-global-history-file nil
|
14
|
270 "*The global history file used by both Mosaic/X and the url package.
|
|
271 This file contains a list of all the URLs you have visited. This file
|
124
|
272 is parsed at startup and used to provide URL completion."
|
|
273 :type '(choice (const :tag "Default" :value nil) file)
|
|
274 :group 'url-history)
|
14
|
275
|
124
|
276 (defcustom url-global-history-save-interval 3600
|
14
|
277 "*The number of seconds between automatic saves of the history list.
|
|
278 Default is 1 hour. Note that if you change this variable after `url-do-setup'
|
124
|
279 has been run, you need to run the `url-setup-save-timer' function manually."
|
|
280 :type 'integer
|
|
281 :group 'url-history)
|
14
|
282
|
|
283 (defvar url-global-history-timer nil)
|
|
284
|
124
|
285 (defcustom url-passwd-entry-func nil
|
14
|
286 "*This is a symbol indicating which function to call to read in a
|
|
287 password. It will be set up depending on whether you are running EFS
|
|
288 or ange-ftp at startup if it is nil. This function should accept the
|
|
289 prompt string as its first argument, and the default value as its
|
124
|
290 second argument."
|
|
291 :type '(choice (const :tag "Guess" :value nil)
|
|
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)
|
14
|
297
|
124
|
298 (defcustom url-gopher-labels
|
14
|
299 '(("0" . "(TXT)")
|
|
300 ("1" . "(DIR)")
|
|
301 ("2" . "(CSO)")
|
|
302 ("3" . "(ERR)")
|
|
303 ("4" . "(MAC)")
|
|
304 ("5" . "(PCB)")
|
|
305 ("6" . "(UUX)")
|
|
306 ("7" . "(???)")
|
|
307 ("8" . "(TEL)")
|
|
308 ("T" . "(TN3)")
|
|
309 ("9" . "(BIN)")
|
|
310 ("g" . "(GIF)")
|
|
311 ("I" . "(IMG)")
|
|
312 ("h" . "(WWW)")
|
|
313 ("s" . "(SND)"))
|
|
314 "*An assoc list of gopher types and how to describe them in the gopher
|
|
315 menus. These can be any string, but HTML/HTML+ entities should be
|
|
316 used when necessary, or it could disrupt formatting of the document
|
|
317 later on. It is also a good idea to make sure all the strings are the
|
|
318 same length after entity references are removed, on a strictly
|
124
|
319 stylistic level."
|
|
320 :type '(repeat (cons (string :tag "Type")
|
|
321 (string :tag "Description")))
|
|
322 :group 'url-hairy)
|
14
|
323
|
124
|
324 (defcustom url-gopher-icons
|
14
|
325 '(
|
|
326 ("0" . "&text.document;")
|
|
327 ("1" . "&folder;")
|
|
328 ("2" . "&index;")
|
|
329 ("3" . "&stop;")
|
|
330 ("4" . "&binhex.document;")
|
|
331 ("5" . "&binhex.document;")
|
|
332 ("6" . "&uuencoded.document;")
|
|
333 ("7" . "&index;")
|
|
334 ("8" . "&telnet;")
|
|
335 ("T" . "&tn3270;")
|
|
336 ("9" . "&binary.document;")
|
|
337 ("g" . "ℑ")
|
|
338 ("I" . "ℑ")
|
|
339 ("s" . "&audio;"))
|
|
340 "*An assoc list of gopher types and the graphic entity references to
|
124
|
341 show when possible."
|
|
342 :type '(repeat (cons (string :tag "Type")
|
|
343 (string :tag "Icon")))
|
|
344 :group 'url-hairy)
|
14
|
345
|
124
|
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)
|
14
|
353 (defvar url-default-working-buffer " *URL*" " The default buffer to do all of the processing in.")
|
102
|
354 (defvar url-working-buffer url-default-working-buffer
|
|
355 "The buffer to do all of the processing in.
|
|
356 It defaults to `url-default-working-buffer' and is bound to *URL-<i>*
|
|
357 buffers when used for multiple requests, cf. `url-multiple-p'")
|
14
|
358 (defvar url-current-referer nil "Referer of this page.")
|
|
359 (defvar url-current-content-length nil "Current content length.")
|
|
360 (defvar url-current-isindex nil "Is the current document a searchable index?")
|
|
361 (defvar url-current-mime-encoding nil "MIME encoding of current document.")
|
|
362 (defvar url-current-mime-headers nil "An alist of MIME headers.")
|
|
363 (defvar url-current-mime-type nil "MIME type of current document.")
|
|
364 (defvar url-current-mime-viewer nil "How to view the current MIME doc.")
|
|
365 (defvar url-current-passwd-count 0 "How many times password has failed.")
|
|
366 (defvar url-gopher-types "0123456789+gIThws:;<"
|
|
367 "A string containing character representations of all the gopher types.")
|
|
368 (defvar url-mime-separator-chars (mapcar 'identity
|
|
369 (concat "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
370 "abcdefghijklmnopqrstuvwxyz"
|
|
371 "0123456789'()+_,-./=?"))
|
|
372 "Characters allowable in a MIME multipart separator.")
|
|
373
|
124
|
374 (defcustom url-bad-port-list
|
14
|
375 '("25" "119" "19")
|
|
376 "*List of ports to warn the user about connecting to. Defaults to just
|
|
377 the mail, chargen, and NNTP ports so you cannot be tricked into sending
|
124
|
378 fake mail or forging messages by a malicious HTML document."
|
|
379 :type '(repeat (string :tag "Port"))
|
|
380 :group 'url-hairy)
|
14
|
381
|
124
|
382 (defcustom url-be-anal-about-file-attributes nil
|
14
|
383 "*Whether to use HTTP/1.0 to figure out file attributes
|
124
|
384 or just guess based on file extension, etc."
|
|
385 :type 'boolean
|
|
386 :group 'url-mime)
|
14
|
387
|
124
|
388 (defcustom url-be-asynchronous nil
|
14
|
389 "*Controls whether document retrievals over HTTP should be done in
|
|
390 the background. This allows you to keep working in other windows
|
124
|
391 while large downloads occur."
|
|
392 :type 'boolean
|
|
393 :group 'url)
|
14
|
394 (make-variable-buffer-local 'url-be-asynchronous)
|
|
395
|
|
396 (defvar url-request-data nil "Any data to send with the next request.")
|
|
397
|
|
398 (defvar url-request-extra-headers nil
|
|
399 "A list of extra headers to send with the next request. Should be
|
|
400 an assoc list of headers/contents.")
|
|
401
|
|
402 (defvar url-request-method nil "The method to use for the next request.")
|
|
403
|
|
404 (defvar url-mime-encoding-string nil
|
102
|
405 "*String to send to the server in the Accept-encoding: field in HTTP/1.0
|
14
|
406 requests. This is created automatically from mm-content-transfer-encodings.")
|
|
407
|
124
|
408 (defcustom url-mime-language-string "*"
|
102
|
409 "*String to send to the server in the Accept-language: field in
|
124
|
410 HTTP/1.0 requests."
|
|
411 :type 'string
|
|
412 :group 'url-mime
|
|
413 :group 'i18n)
|
14
|
414
|
|
415 (defvar url-mime-accept-string nil
|
|
416 "String to send to the server in the Accept: field in HTTP/1.0 requests.
|
|
417 This is created automatically from url-mime-viewers, after the mailcap file
|
|
418 has been parsed.")
|
|
419
|
|
420 (defvar url-history-changed-since-last-save nil
|
|
421 "Whether the history list has changed since the last save operation.")
|
|
422
|
|
423 (defvar url-proxy-basic-authentication nil
|
|
424 "Internal structure - do not modify!")
|
|
425
|
|
426 (defvar url-registered-protocols nil
|
|
427 "Internal structure - do not modify! See `url-register-protocol'")
|
|
428
|
|
429 (defvar url-package-version "Unknown" "Version # of package using URL.")
|
|
430
|
|
431 (defvar url-package-name "Unknown" "Version # of package using URL.")
|
|
432
|
|
433 (defvar url-system-type nil "What type of system we are on.")
|
|
434 (defvar url-os-type nil "What OS we are on.")
|
|
435
|
124
|
436 (defcustom url-max-password-attempts 5
|
14
|
437 "*Maximum number of times a password will be prompted for when a
|
124
|
438 protected document is denied by the server."
|
|
439 :type 'integer
|
|
440 :group 'url)
|
14
|
441
|
124
|
442 (defcustom url-temporary-directory (or (getenv "TMPDIR") "/tmp")
|
|
443 "*Where temporary files go."
|
|
444 :type 'directory
|
|
445 :group 'url-file)
|
14
|
446
|
124
|
447 (defcustom url-show-status t
|
14
|
448 "*Whether to show a running total of bytes transferred. Can cause a
|
|
449 large hit if using a remote X display over a slow link, or a terminal
|
124
|
450 with a slow modem."
|
|
451 :type 'boolean
|
|
452 :group 'url)
|
14
|
453
|
|
454 (defvar url-using-proxy nil
|
|
455 "Either nil or the fully qualified proxy URL in use, e.g.
|
|
456 http://www.domain.com/")
|
|
457
|
124
|
458 (defcustom url-news-server nil
|
14
|
459 "*The default news server to get newsgroups/articles from if no server
|
|
460 is specified in the URL. Defaults to the environment variable NNTPSERVER
|
124
|
461 or \"news\" if NNTPSERVER is undefined."
|
|
462 :type '(choice (const :tag "None" :value nil) string)
|
|
463 :group 'url)
|
14
|
464
|
124
|
465 (defcustom url-gopher-to-mime
|
14
|
466 '((?0 . "text/plain") ; It's a file
|
|
467 (?1 . "www/gopher") ; Gopher directory
|
|
468 (?2 . "www/gopher-cso-search") ; CSO search
|
|
469 (?3 . "text/plain") ; Error
|
|
470 (?4 . "application/mac-binhex40") ; Binhexed macintosh file
|
|
471 (?5 . "application/pc-binhex40") ; DOS binary archive of some sort
|
|
472 (?6 . "archive/x-uuencode") ; Unix uuencoded file
|
|
473 (?7 . "www/gopher-search") ; Gopher search!
|
|
474 (?9 . "application/octet-stream") ; Binary file!
|
|
475 (?g . "image/gif") ; Gif file
|
|
476 (?I . "image/gif") ; Some sort of image
|
|
477 (?h . "text/html") ; HTML source
|
|
478 (?s . "audio/basic") ; Sound file
|
|
479 )
|
124
|
480 "*An assoc list of gopher types and their corresponding MIME types."
|
|
481 :type '(repeat (cons sexp string))
|
|
482 :group 'url-hairy)
|
14
|
483
|
124
|
484 (defcustom url-use-hypertext-gopher t
|
14
|
485 "*Controls how gopher documents are retrieved.
|
|
486 If non-nil, the gopher pages will be converted into HTML and parsed
|
|
487 just like any other page. If nil, the requests will be passed off to
|
|
488 the gopher.el package by Scott Snyder. Using the gopher.el package
|
124
|
489 will lose the gopher+ support, and inlined searching."
|
|
490 :type 'boolean
|
|
491 :group 'url)
|
14
|
492
|
|
493 (defvar url-global-history-hash-table nil
|
|
494 "Hash table for global history completion.")
|
|
495
|
|
496 (defvar url-nonrelative-link
|
|
497 "^\\([-a-zA-Z0-9+.]+:\\)"
|
|
498 "A regular expression that will match an absolute URL.")
|
|
499
|
124
|
500 (defcustom url-confirmation-func 'y-or-n-p
|
14
|
501 "*What function to use for asking yes or no functions. Possible
|
|
502 values are 'yes-or-no-p or 'y-or-n-p, or any function that takes a
|
|
503 single argument (the prompt), and returns t only if a positive answer
|
124
|
504 is gotten."
|
|
505 :type '(choice (const :tag "Short (y or n)" :value y-or-n-p)
|
|
506 (const :tag "Long (yes or no)" :value yes-or-no-p)
|
|
507 (function :tag "Other"))
|
|
508 :group 'url-hairy)
|
14
|
509
|
124
|
510 (defcustom url-gateway-method 'native
|
14
|
511 "*The type of gateway support to use.
|
|
512 Should be a symbol specifying how we are to get a connection off of the
|
|
513 local machine.
|
|
514
|
|
515 Currently supported methods:
|
16
|
516 'telnet :: Run telnet in a subprocess to connect
|
|
517 'rlogin :: Rlogin to another machine to connect
|
|
518 'socks :: Connects through a socks server
|
|
519 'ssl :: Connection should be made with SSL
|
14
|
520 'tcp :: Use the excellent tcp.el package from gnus.
|
|
521 This simply does a (require 'tcp), then sets
|
16
|
522 url-gateway-method to be 'native.
|
|
523 'native :: Use the native open-network-stream in emacs
|
124
|
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)
|
14
|
532
|
|
533 (defvar url-running-xemacs (string-match "XEmacs" emacs-version)
|
102
|
534 "*Got XEmacs?")
|
14
|
535
|
|
536 (defvar url-default-ports '(("http" . "80")
|
|
537 ("gopher" . "70")
|
|
538 ("telnet" . "23")
|
|
539 ("news" . "119")
|
|
540 ("https" . "443")
|
|
541 ("shttp" . "80"))
|
|
542 "An assoc list of protocols and default port #s")
|
|
543
|
|
544 (defvar url-setup-done nil "*Has setup configuration been done?")
|
|
545
|
|
546 (defvar url-source nil
|
|
547 "*Whether to force a sourcing of the next buffer. This forces local
|
|
548 files to be read into a buffer, no matter what. Gets around the
|
|
549 optimization that if you are passing it to a viewer, just make a
|
|
550 symbolic link, which looses if you want the source for inlined
|
|
551 images/etc.")
|
|
552
|
|
553 (defconst weekday-alist
|
|
554 '(("Sunday" . 0) ("Monday" . 1) ("Tuesday" . 2) ("Wednesday" . 3)
|
|
555 ("Thursday" . 4) ("Friday" . 5) ("Saturday" . 6)
|
|
556 ("Tues" . 2) ("Thurs" . 4)
|
|
557 ("Sun" . 0) ("Mon" . 1) ("Tue" . 2) ("Wed" . 3)
|
|
558 ("Thu" . 4) ("Fri" . 5) ("Sat" . 6)))
|
|
559
|
|
560 (defconst monthabbrev-alist
|
|
561 '(("Jan" . 1) ("Feb" . 2) ("Mar" . 3) ("Apr" . 4) ("May" . 5) ("Jun" . 6)
|
|
562 ("Jul" . 7) ("Aug" . 8) ("Sep" . 9) ("Oct" . 10) ("Nov" . 11) ("Dec" . 12))
|
|
563 )
|
|
564
|
|
565 (defvar url-lazy-message-time 0)
|
|
566
|
|
567 (defvar url-extensions-header "Security/Digest Security/SSL")
|
|
568
|
|
569 (defvar url-mailserver-syntax-table
|
|
570 (copy-syntax-table emacs-lisp-mode-syntax-table)
|
|
571 "*A syntax table for parsing the mailserver URL")
|
|
572
|
|
573 (modify-syntax-entry ?' "\"" url-mailserver-syntax-table)
|
|
574 (modify-syntax-entry ?` "\"" url-mailserver-syntax-table)
|
|
575 (modify-syntax-entry ?< "(>" url-mailserver-syntax-table)
|
|
576 (modify-syntax-entry ?> ")<" url-mailserver-syntax-table)
|
|
577 (modify-syntax-entry ?/ " " url-mailserver-syntax-table)
|
|
578
|
122
|
579 (defvar url-handle-no-scheme-hook nil
|
|
580 "*Hooks to be run until one can successfully transform an incomplete URL.
|
|
581
|
|
582 Each hook is called with a single argument URL and should return a tranformed
|
|
583 url with a valid scheme (e.g., \"gnu\" --> \"http://www.gnu.org/\"), or nil
|
|
584 otherwise.")
|
|
585
|
14
|
586 ;;; Make OS/2 happy - yeeks
|
|
587 (defvar tcp-binary-process-input-services nil
|
|
588 "*Make OS/2 happy with our CRLF pairs...")
|
|
589
|
|
590 (provide 'url-vars)
|