* url-handlers.el (file-remote-p): Add handler.
[bpt/emacs.git] / lisp / url / url.el
index 4cdf781..34b3f65 100644 (file)
@@ -1,7 +1,7 @@
 ;;; url.el --- Uniform Resource Locator retrieval tool
 
 ;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004,
-;;   2005, 2006, 2007  Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 
 ;; Author: Bill Perry <wmperry@gnu.org>
 ;; Keywords: comm, data, processes, hypermedia
@@ -10,7 +10,7 @@
 ;;
 ;; 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)
+;; 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,
 (require 'url-parse)
 (require 'url-util)
 
-;; Fixme: customize? convert-standard-filename?
-(defvar url-configuration-directory
-  (cond
-   ((file-directory-p "~/.url") "~/.url")
-   ((file-directory-p user-emacs-directory)
-    (concat user-emacs-directory "url"))
-   (t "~/.url")))
+
+;; FIXME convert-standard-filename?
+(defcustom url-configuration-directory
+  (if (and (file-directory-p user-emacs-directory)
+           (not (file-directory-p "~/.url")))
+      (expand-file-name "url" user-emacs-directory)
+    "~/.url")
+  "Directory used by the URL package for cookies, history, etc."
+  :type 'directory
+  :group 'url)
 
 (defun url-do-setup ()
   "Setup the url package.
@@ -241,7 +244,9 @@ no further processing).  URL is either a string or a parsed URL."
                ;; XXX: The callback must always be called.  Any
                ;; exception is a bug that should be fixed, not worked
                ;; around.
-                (setq retrieval-done t))
+               (progn ;; Call delete-process so we run any sentinel now.
+                 (delete-process proc)
+                 (setq retrieval-done t)))
             ;; We used to use `sit-for' here, but in some cases it wouldn't
             ;; work because apparently pending keyboard input would always
             ;; interrupt it before it got a chance to handle process input.