(top-level): Don't require cl when compiling.
[bpt/emacs.git] / lisp / url / url-methods.el
index 89325e6..94dcd49 100644 (file)
@@ -1,30 +1,30 @@
 ;;; url-methods.el --- Load URL schemes as needed
-;; Author: $Author: monnier $
-;; Created: $Date: 2004/04/04 03:10:58 $
-;; Version: $Revision: 1.2 $
+
+;; Copyright (C) 1996, 1997, 1998, 1999, 2004,
+;;   2005, 2006, 2007 Free Software Foundation, Inc.
+
 ;; Keywords: comm, data, processes, hypermedia
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Copyright (c) 1993 - 1996, 2004 by William M. Perry <wmperry@cs.indiana.edu>
-;;; Copyright (c) 1996 - 1999 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.
+
+;;; Commentary:
+
+;;; Code:
 
 (eval-when-compile
   (require 'cl))
         (cur-proxy (assoc scheme url-proxy-services))
         (urlobj nil))
 
+    ;; If env-proxy is an empty string, treat it as if it were nil
+    (when (and (stringp env-proxy)
+              (string= env-proxy ""))
+      (setq env-proxy nil))
+
     ;; Store any proxying information - this will not overwrite an old
     ;; entry, so that people can still set this information in their
     ;; .emacs file
      ;; First check if its something like hostname:port
      ((string-match "^\\([^:]+\\):\\([0-9]+\\)$" env-proxy)
       (setq urlobj (url-generic-parse-url nil)) ; Get a blank object
-      (url-set-type urlobj "http")
-      (url-set-host urlobj (match-string 1 env-proxy))
-      (url-set-port urlobj (string-to-number (match-string 2 env-proxy))))
+      (setf (url-type urlobj) "http")
+      (setf (url-host urlobj) (match-string 1 env-proxy))
+      (setf (url-port urlobj) (string-to-number (match-string 2 env-proxy))))
      ;; Then check if its a fully specified URL
      ((string-match url-nonrelative-link env-proxy)
       (setq urlobj (url-generic-parse-url env-proxy))
-      (url-set-type urlobj "http")
-      (url-set-target urlobj nil))
+      (setf (url-type urlobj) "http")
+      (setf (url-target urlobj) nil))
      ;; Finally, fall back on the assumption that its just a hostname
      (t
       (setq urlobj (url-generic-parse-url nil)) ; Get a blank object
-      (url-set-type urlobj "http")
-      (url-set-host urlobj env-proxy)))
+      (setf (url-type urlobj) "http")
+      (setf (url-host urlobj) env-proxy)))
 
      (if (and (not cur-proxy) urlobj)
         (progn
@@ -147,4 +152,5 @@ it has not already been loaded."
 
 (provide 'url-methods)
 
-;;; arch-tag: 336863f8-5a07-4906-9be5-b3c6bcebbe67
+;; arch-tag: 336863f8-5a07-4906-9be5-b3c6bcebbe67
+;;; url-methods.el ends here