diff lisp/w3/url-file.el @ 102:a145efe76779 r20-1b3

Import from CVS: tag r20-1b3
author cvs
date Mon, 13 Aug 2007 09:15:49 +0200
parents 0d2f883870bc
children cca96a509cfe
line wrap: on
line diff
--- a/lisp/w3/url-file.el	Mon Aug 13 09:15:13 2007 +0200
+++ b/lisp/w3/url-file.el	Mon Aug 13 09:15:49 2007 +0200
@@ -1,7 +1,7 @@
 ;;; url-file.el --- File retrieval code
 ;; Author: wmperry
-;; Created: 1997/02/10 16:16:46
-;; Version: 1.13
+;; Created: 1997/02/19 23:38:31
+;; Version: 1.15
 ;; Keywords: comm, data, processes
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -136,82 +136,6 @@
     (kill-buffer (current-buffer))
     (find-file dir)
     (url-dired-minor-mode t)))
-;   (let ((files (directory-files dir nil)) file
-;	  div attr mod-time size typ title desc)
-;      (save-excursion
-;	(if (string-match "/\\([^/]+\\)/$" dir)
-;	    (setq title (concat ".../" (url-match dir 1) "/"))
-;	  (setq title "/"))
-;	(setq div (1- (length files)))
-;	(set-buffer url-working-buffer)
-;	(erase-buffer)
-;	(insert "<html>\n"
-;		" <head>\n"
-;		"  <title>" title "</title>\n"
-;		" </head>\n"
-;		" <body>\n"
-;		"   <h1 align=center> Index of " title "</h1>\n"
-;		"   <table border=0>\n"
-;		"    <tr><th>Name<th>Last Modified<th>Size</tr>\n"
-;		"    <tr><td colspan=3><hr></tr>\n")
-;	(while files
-;	  (url-lazy-message "Building directory list... (%d%%)"
-;			    (/ (* 100 (- div (length files))) div))
-;	  (setq file (expand-file-name (car files) dir)
-;		attr (file-attributes file)
-;		file (car files)
-;		mod-time (nth 5 attr)
-;		size (nth 7 attr)
-;		typ (or (mm-extension-to-mime (url-file-extension file)) ""))
-;	  (setq file (url-hexify-string file))
-;	  (if (equal '(0 0) mod-time)	; Set to null if unknown or
-;	      (setq mod-time "Unknown")
-;	    (setq mod-time (current-time-string mod-time)))
-;	  (if (or (equal size 0) (equal size -1) (null size))
-;	      (setq size "-")
-;	    (setq size
-;		  (cond
-;		   ((< size 1024) "1K")
-;		   ((< size 1048576) (concat (int-to-string
-;					      (max 1 (/ size 1024))) "K"))
-;		   (t
-;		    (let* ((megs (max 1 (/ size 1048576)))
-;			   (kilo (/ (- size (* megs 1048576)) 1024)))
-;		      (concat (int-to-string megs)
-;			      (if (> kilo 0)
-;				  (concat "." (int-to-string kilo))
-;				"") "M"))))))
-;	  (cond
-;	   ((or (equal "." (car files))
-;		(equal "/.." (car files)))
-;	    (setq desc nil))
-;	   ((equal ".." (car files))
-;	    (if (not (= ?/ (aref file (1- (length file)))))
-;		(setq file (concat file "/"))))
-;	   ((stringp (nth 0 attr))	; Symbolic link handling
-;	    (setq desc "[LNK]"))
-;	   ((nth 0 attr)		; Directory handling
-;	    (setq desc "[DIR]"))
-;	   ((string-match "image" typ)
-;	    (setq desc "[IMG]"))
-;	   ((string-match "application" typ)
-;	    (setq desc "[APP]"))
-;	   ((string-match "text" typ)
-;	    (setq desc "[TXT]"))
-;	   ((auto-save-file-name-p (car files))
-;	    (setq desc "[BAK]"))
-;	   (t
-;	    (setq desc "[UNK]")))
-;	  (if desc
-;	      (insert "<tr><td>" desc " <a href=\"./" file "\">" (car files)
-;		      "</a><td>" mod-time "<td><p align=right>" size
-;		      "</tr>\n"))
-;	  (setq files (cdr files)))
-;	(insert "   </table>\n"
-;		" </body>\n"
-;		"</html>\n"
-;		"<!-- Automatically generated by URL v" url-version
-;		" -->\n")))
 
 (defun url-host-is-local-p (host)
   "Return t iff HOST references our local machine."
@@ -240,15 +164,6 @@
 		       (concat "/" (or user "anonymous") "@" site ":" file)
 		     file)))
 
-    (if (and file (url-host-is-local-p site)
-	     (memq system-type '(ms-windows ms-dos windows-nt os2)))
-	(let ((x (1- (length file)))
-	      (y 0))
-	  (while (<= y x)
-	    (if (= (aref file y) ?\\ )
-		(aset file y ?/))
-	    (setq y (1+ y)))))
-
     (url-clear-tmp-buffer)
     (and user pass
 	 (cond
@@ -315,14 +230,8 @@
 	      (error
 	       (url-save-error errobj)
 	       (url-retrieve (concat "www://error/nofile/" file))))))))
-    (setq url-current-type (if site "ftp" "file")
-	  url-current-object urlobj
-	  url-find-this-link dest
-	  url-current-user user
-	  url-current-server site
-	  url-current-mime-type (mm-extension-to-mime
-				 (url-file-extension file))
-	  url-current-file file)))
+    (setq url-current-mime-type (mm-extension-to-mime
+				 (url-file-extension file)))))
 
 (fset 'url-ftp 'url-file)