diff lisp/w3/url.el @ 144:318232e2a3f0 r20-2b6

Import from CVS: tag r20-2b6
author cvs
date Mon, 13 Aug 2007 09:34:14 +0200
parents 6608ceec7cf8
children 5a88923fcbfe
line wrap: on
line diff
--- a/lisp/w3/url.el	Mon Aug 13 09:33:20 2007 +0200
+++ b/lisp/w3/url.el	Mon Aug 13 09:34:14 2007 +0200
@@ -1,13 +1,13 @@
 ;;; url.el --- Uniform Resource Locator retrieval tool
 ;; Author: wmperry
-;; Created: 1997/04/22 15:08:38
-;; Version: 1.76
+;; Created: 1997/05/08 22:17:40
+;; Version: 1.78
 ;; Keywords: comm, data, processes, hypermedia
 
 ;;; LCD Archive Entry:
 ;;; url|William M. Perry|wmperry@cs.indiana.edu|
 ;;; Functions for retrieving/manipulating URLs|
-;;; 1997/04/22 15:08:38|1.76|Location Undetermined
+;;; 1997/05/08 22:17:40|1.78|Location Undetermined
 ;;;
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1356,7 +1356,7 @@
     (message "Retrieval for %s complete." buf))))
 
 (defun url-sentinel (proc string)
-  (let* ((buf (process-buffer proc))
+  (let* ((buf (if (processp proc) (process-buffer proc) proc))
 	 (url-working-buffer (and buf (get-buffer buf)))
 	 status)
     (if (not url-working-buffer)
@@ -1372,10 +1372,12 @@
 	       ((url-mime-response-p)
 		(setq status (url-parse-mime-headers))))
 	      (if (not url-current-mime-type)
-		  (setq url-current-mime-type (mm-extension-to-mime
-					       (url-file-extension
-						(url-filename
- 						 url-current-object))))))))
+		  (setq url-current-mime-type (or
+					       (mm-extension-to-mime
+						(url-file-extension
+						 (url-filename
+						  url-current-object)))
+					       "text/plain"))))))
       (if (member status '(401 301 302 303 204))
 	  nil
 	(funcall url-default-retrieval-proc (buffer-name url-working-buffer)))))
@@ -1957,7 +1959,7 @@
 	      "<address>" url-bug-address "</address>"))
     (cond
      ((and url-be-asynchronous (not cached)
-	   (member type '("http" "https" "proxy")))
+	   (member type '("http" "https" "proxy" "file" "ftp")))
       nil)
      ((and url-be-asynchronous (get-buffer url-working-buffer))
       (funcall url-default-retrieval-proc (buffer-name)))
@@ -1969,12 +1971,10 @@
 		 (not (equal type "http")))
 	     url-current-object
 	     (not url-current-mime-type))
-	(if (url-buffer-is-hypertext)
-	    (setq url-current-mime-type "text/html")
-	  (setq url-current-mime-type (mm-extension-to-mime
-				       (url-file-extension
-					(url-filename
-					 url-current-object))))))
+	(setq url-current-mime-type (mm-extension-to-mime
+				     (url-file-extension
+				      (url-filename
+				       url-current-object)))))
     (if (not url-be-asynchronous)
 	(url-store-in-cache url-working-buffer))
     (if (not url-global-history-hash-table)