Mercurial > hg > xemacs-beta
comparison lisp/w3/url-file.el @ 16:0293115a14e9 r19-15b91
Import from CVS: tag r19-15b91
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:49:20 +0200 |
parents | 9ee227acff29 |
children | 859a2309aef8 |
comparison
equal
deleted
inserted
replaced
15:ad457d5f7d04 | 16:0293115a14e9 |
---|---|
1 ;;; url-file.el --- File retrieval code | 1 ;;; url-file.el --- File retrieval code |
2 ;; Author: wmperry | 2 ;; Author: wmperry |
3 ;; Created: 1996/12/30 14:25:26 | 3 ;; Created: 1997/01/24 14:32:50 |
4 ;; Version: 1.7 | 4 ;; Version: 1.9 |
5 ;; Keywords: comm, data, processes | 5 ;; Keywords: comm, data, processes |
6 | 6 |
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
8 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu) | 8 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu) |
9 ;;; Copyright (c) 1996 Free Software Foundation, Inc. | 9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc. |
10 ;;; | 10 ;;; |
11 ;;; This file is not part of GNU Emacs, but the same permissions apply. | 11 ;;; This file is not part of GNU Emacs, but the same permissions apply. |
12 ;;; | 12 ;;; |
13 ;;; GNU Emacs is free software; you can redistribute it and/or modify | 13 ;;; GNU Emacs is free software; you can redistribute it and/or modify |
14 ;;; it under the terms of the GNU General Public License as published by | 14 ;;; it under the terms of the GNU General Public License as published by |
192 | 192 |
193 (defun url-file (url) | 193 (defun url-file (url) |
194 ;; Find a file | 194 ;; Find a file |
195 (let* ((urlobj (url-generic-parse-url url)) | 195 (let* ((urlobj (url-generic-parse-url url)) |
196 (user (url-user urlobj)) | 196 (user (url-user urlobj)) |
197 (pass (url-password urlobj)) | |
197 (site (url-host urlobj)) | 198 (site (url-host urlobj)) |
198 (file (url-unhex-string (url-filename urlobj))) | 199 (file (url-unhex-string (url-filename urlobj))) |
199 (dest (url-target urlobj)) | 200 (dest (url-target urlobj)) |
200 (filename (if (or user (not (url-host-is-local-p site))) | 201 (filename (if (or user (not (url-host-is-local-p site))) |
201 (concat "/" (or user "anonymous") "@" site ":" file) | 202 (concat "/" (or user "anonymous") "@" site ":" file) |
209 (if (= (aref file y) ?\\ ) | 210 (if (= (aref file y) ?\\ ) |
210 (aset file y ?/)) | 211 (aset file y ?/)) |
211 (setq y (1+ y))))) | 212 (setq y (1+ y))))) |
212 | 213 |
213 (url-clear-tmp-buffer) | 214 (url-clear-tmp-buffer) |
215 (and user pass | |
216 (cond | |
217 ((featurep 'ange-ftp) | |
218 (ange-ftp-set-passwd site user pass)) | |
219 ((or (featurep 'efs) (featurep 'efs-auto)) | |
220 (efs-set-passwd site user pass)) | |
221 (t | |
222 nil))) | |
214 (cond | 223 (cond |
215 ((file-directory-p filename) | 224 ((file-directory-p filename) |
216 (if url-use-hypertext-dired | 225 (if url-use-hypertext-dired |
217 (progn | 226 (progn |
218 (if (string-match "/$" filename) | 227 (if (string-match "/$" filename) |