]> code.delx.au - gnu-emacs/blobdiff - lisp/url/url-vars.el
* url-auth.el (url-digest-auth): Don't show prompt if
[gnu-emacs] / lisp / url / url-vars.el
index 68076e7d3db99615412146b35eac3788d4cfa1e1..aba40c6372688b34419d67d53bc6174bf6ac4f79 100644 (file)
@@ -1,27 +1,28 @@
 ;;; url-vars.el --- Variables for Uniform Resource Locator tool
+
+;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004,
+;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
 ;; Keywords: comm, data, processes, hypermedia
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Copyright (c) 1993 - 1996 by William M. Perry <wmperry@cs.indiana.edu>
-;;; Copyright (c) 1996, 97, 98, 99, 2001 Free Software Foundation, Inc.
-;;;
-;;; This file is part of GNU Emacs.
-;;;
-;;; GNU Emacs is free software; you can redistribute it and/or modify
-;;; it under the terms of the GNU General Public License as published by
-;;; the Free Software Foundation; either version 2, or (at your option)
-;;; any later version.
-;;;
-;;; GNU Emacs is distributed in the hope that it will be useful,
-;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;;; Boston, MA 02111-1307, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Code:
 
 (require 'mm-util)
 
   "Version number of URL package.")
 
 (defgroup url nil
-  "Uniform Resource Locator tool"
-  :version "21.4"
+  "Uniform Resource Locator tool."
+  :version "22.1"
   :group 'hypermedia)
 
 (defgroup url-file nil
-  "URL storage"
+  "URL storage."
   :prefix "url-"
   :group 'url)
 
 (defgroup url-cache nil
-  "URL cache"
+  "URL cache."
   :prefix "url-"
   :prefix "url-cache-"
   :group 'url)
 
 (defgroup url-mime nil
-  "MIME options of URL"
+  "MIME options of URL."
   :prefix "url-"
   :group 'url)
 
 (defgroup url-hairy nil
-  "Hairy options of URL"
+  "Hairy options of URL."
   :prefix "url-"
   :group 'url)
 
@@ -111,9 +112,8 @@ using `dired' to view the directory."
   :type 'string
   :group 'url-file)
 
-;; Fixme: this should have a setter which calls url-setup-privacy-info.
 (defcustom url-privacy-level '(email)
-  "*How private you want your requests to be.
+  "How private you want your requests to be.
 HTTP has header fields for various information about the user, including
 operating system information, email addresses, the last page you visited, etc.
 This variable controls how much of this information is sent.
@@ -143,6 +143,8 @@ Samples:
 This variable controls several other variables and is _NOT_ automatically
 updated.  Call the function `url-setup-privacy-info' after modifying this
 variable."
+  :initialize 'custom-initialize-default
+  :set (lambda (sym val) (set-default sym val) (url-setup-privacy-info))
   :type '(radio (const :tag "None (you believe in the basic goodness of humanity)"
                       :value none)
                (const :tag "Low (do not reveal last location)"
@@ -173,9 +175,7 @@ variable."
                       (string :tag "Encoding")))
   :group 'url-mime)
 
-(defcustom url-mail-command (if (fboundp 'compose-mail)
-                               'compose-mail
-                             'url-mail)
+(defcustom url-mail-command 'compose-mail
   "*This function will be called whenever url needs to send mail.
 It should enter a mail-mode-like buffer in the current window.
 The commands `mail-to' and `mail-subject' should still work in this
@@ -192,19 +192,6 @@ from the ACCESS_proxy environment variables."
                       (string :tag "Proxy")))
   :group 'url)
 
-(defcustom url-passwd-entry-func nil
-  "*Symbol indicating which function to call to read in a password.
-It will be set up depending on whether you are running EFS or ange-ftp
-at startup if it is nil.  This function should accept the prompt
-string as its first argument, and the default value as its second
-argument."
-  :type '(choice (const :tag "Guess" :value nil)
-                (const :tag "Use Ange-FTP" :value ange-ftp-read-passwd)
-                (const :tag "Use EFS"      :value efs-read-passwd)
-                (const :tag "Use Password Package" :value read-passwd)
-                (function :tag "Other"))
-  :group 'url-hairy)
-
 (defcustom url-standalone-mode nil
   "*Rely solely on the cache?"
   :type 'boolean
@@ -241,24 +228,6 @@ Should be an assoc list of headers/contents.")
 (defvar url-mime-encoding-string nil
   "*String to send in the Accept-encoding: field in HTTP requests.")
 
-;; `mm-mime-mule-charset-alist' in Gnus 5.8/9 contains elements whose
-;; cars aren't valid MIME charsets/coding systems, at least in Emacs.
-;; This gets it correct by construction in Emacs.  Fixme: DTRT for
-;; XEmacs -- its `coding-system-list' doesn't have the BASE-ONLY arg.
-(when (and (not (featurep 'xemacs))
-          (fboundp 'coding-system-list))
-  (setq mm-mime-mule-charset-alist
-       (apply
-        'nconc
-        (mapcar
-         (lambda (cs)
-           (when (and (coding-system-get cs 'mime-charset)
-                      (not (eq t (coding-system-get cs 'safe-charsets))))
-             (list (cons (coding-system-get cs 'mime-charset)
-                         (delq 'ascii
-                               (coding-system-get cs 'safe-charsets))))))
-         (coding-system-list 'base-only)))))
-
 ;; Perhaps the first few should actually be given decreasing `q's and
 ;; the list should be trimmed significantly.
 ;; Fixme: do something sane if we don't have `sort-coding-systems'
@@ -310,7 +279,7 @@ get the first available language (as opposed to the default)."
 (defvar url-package-version nil
   "Version number of package using URL.")
 
-(defvar url-package-name nil "Version number of package using URL.")
+(defvar url-package-name nil "Name of package using URL.")
 
 (defvar url-system-type nil
   "What type of system we are on.")
@@ -351,6 +320,12 @@ undefined."
   "\\`\\([-a-zA-Z0-9+.]+:\\)"
   "A regular expression that will match an absolute URL.")
 
+(defcustom url-max-redirections 30
+  "*The maximum number of redirection requests to honor in a HTTP connection.
+A negative number means to honor an unlimited number of redirection requests."
+  :type 'integer
+  :group 'url)
+
 (defcustom url-confirmation-func 'y-or-n-p
   "*What function to use for asking yes or no functions.
 Possible values are `yes-or-no-p' or `y-or-n-p', or any function that
@@ -369,25 +344,27 @@ Currently supported methods:
 `telnet': Run telnet in a subprocess to connect;
 `rlogin': Rlogin to another machine to connect;
 `socks': Connect through a socks server;
-`ssl': Connect with SSL;
+`tls': Connect with TLS;
+`ssl': Connect with SSL (deprecated, use `tls' instead);
 `native': Connect directy."
   :type '(radio (const :tag "Telnet to gateway host" :value telnet)
                (const :tag "Rlogin to gateway host" :value rlogin)
                (const :tag "Use SOCKS proxy" :value socks)
-               (const :tag "Use SSL for all connections" :value ssl)
+               (const :tag "Use SSL/TLS for all connections" :value tls)
+               (const :tag "Use SSL for all connections (obsolete)" :value ssl)
                (const :tag "Direct connection" :value native))
   :group 'url-hairy)
 
 (defvar url-setup-done nil "Has setup configuration been done?")
 
-(defconst weekday-alist
+(defconst url-weekday-alist
   '(("Sunday" . 0) ("Monday" . 1) ("Tuesday" . 2) ("Wednesday" . 3)
     ("Thursday" . 4) ("Friday" . 5) ("Saturday" . 6)
     ("Tues" . 2) ("Thurs" . 4)
     ("Sun" . 0) ("Mon" . 1) ("Tue" . 2) ("Wed" . 3)
     ("Thu" . 4) ("Fri" . 5) ("Sat" . 6)))
 
-(defconst monthabbrev-alist
+(defconst url-monthabbrev-alist
   '(("Jan" . 1) ("Feb" . 2) ("Mar" . 3) ("Apr" . 4) ("May" . 5) ("Jun" . 6)
     ("Jul" . 7) ("Aug" . 8) ("Sep" . 9) ("Oct" . 10) ("Nov" . 11)
     ("Dec" . 12)))
@@ -417,13 +394,15 @@ Currently supported methods:
 (defconst url-working-buffer " *url-work")
 
 (defvar url-gateway-unplugged nil
-  "Non-nil means don't open new network connexions.
+  "Non-nil means don't open new network connections.
 This should be set, e.g. by mail user agents rendering HTML to avoid
 `bugs' which call home.")
 
 (defun url-vars-unload-hook ()
   (remove-hook 'set-language-environment-hook 'url-set-mime-charset-string))
 
+(add-hook 'url-vars-unload-hook 'url-vars-unload-hook)
+
 (provide 'url-vars)
 
 ;;; arch-tag: 29205e5f-c5ce-433c-8d5d-38cbaed64b49