;;; 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, 2009, 2010 Free Software Foundation, Inc.
;; Author: Bill Perry <wmperry@gnu.org>
;; Keywords: comm, data, processes, hypermedia
;; This file is part of GNU Emacs.
;;
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; 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.
-;;
+;; the Free Software Foundation, either version 3 of the License, 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.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
(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")))
+
+(defcustom url-configuration-directory
+ (locate-user-emacs-file "url/" ".url/")
+ "Directory used by the URL package for cookies, history, etc."
+ :type 'directory
+ :group 'url)
(defun url-do-setup ()
- "Setup the url package.
+ "Setup the URL package.
This is to avoid conflict with user settings if URL is dumped with
Emacs."
(unless url-setup-done
;; 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.