Mercurial > emacs
comparison lisp/ange-ftp.el @ 21822:37c1ced8578a
(file-name-handler-alist): Instead of substituting,
add regexps for file names with drive letters,
author | Geoff Voelker <voelker@cs.washington.edu> |
---|---|
date | Wed, 29 Apr 1998 04:31:03 +0000 |
parents | 805366038d27 |
children | 1173cfe8b7bd |
comparison
equal
deleted
inserted
replaced
21821:9e82920b194d | 21822:37c1ced8578a |
---|---|
4062 | 4062 |
4063 ;;; This regexp takes care of real ange-ftp file names (with a slash | 4063 ;;; This regexp takes care of real ange-ftp file names (with a slash |
4064 ;;; and colon). | 4064 ;;; and colon). |
4065 ;;; Don't allow the host name to end in a period--some systems use /.: | 4065 ;;; Don't allow the host name to end in a period--some systems use /.: |
4066 ;;;###autoload | 4066 ;;;###autoload |
4067 (let ((pattern (if (memq system-type '(ms-dos windows-nt)) | 4067 (or (assoc "^/[^/:]*[^/:.]:" file-name-handler-alist) |
4068 "^[a-zA-Z]:/[^/:]*[^/:.]:" | 4068 (setq file-name-handler-alist |
4069 "^/[^/:]*[^/:.]:"))) | 4069 (cons '("^/[^/:]*[^/:.]:" . ange-ftp-hook-function) |
4070 (or (assoc pattern file-name-handler-alist) | 4070 file-name-handler-alist))) |
4071 (setq file-name-handler-alist | 4071 |
4072 (cons (cons pattern 'ange-ftp-hook-function) | 4072 ;;; Real ange-ftp file names prefixed with a drive letter. |
4073 file-name-handler-alist)))) | 4073 ;;;###autoload |
4074 (and (memq system-type '(ms-dos windows-nt)) | |
4075 (or (assoc "^[a-zA-Z]:/[^/:]*[^/:.]:" file-name-handler-alist) | |
4076 (setq file-name-handler-alist | |
4077 (cons '("^[a-zA-Z]:/[^/:]*[^/:.]:" . ange-ftp-hook-function) | |
4078 file-name-handler-alist)))) | |
4074 | 4079 |
4075 ;;; This regexp recognizes and absolute filenames with only one component, | 4080 ;;; This regexp recognizes and absolute filenames with only one component, |
4076 ;;; for the sake of hostname completion. | 4081 ;;; for the sake of hostname completion. |
4077 ;;;###autoload | 4082 ;;;###autoload |
4078 (let ((pattern (if (memq system-type '(ms-dos windows-nt)) | 4083 (or (assoc "^/[^/:]*\\'" file-name-handler-alist) |
4079 "^[a-zA-Z]:/[^/:]*\\'" | 4084 (setq file-name-handler-alist |
4080 "^/[^/:]*\\'"))) | 4085 (cons '("^/[^/:]*\\'" . ange-ftp-completion-hook-function) |
4081 (or (assoc pattern file-name-handler-alist) | 4086 file-name-handler-alist))) |
4082 (setq file-name-handler-alist | 4087 |
4083 (cons (cons pattern 'ange-ftp-completion-hook-function) | 4088 ;;; Absolute file names prefixed with a drive letter. |
4084 file-name-handler-alist)))) | 4089 ;;;###autoload |
4090 (and (memq system-type '(ms-dos windows-nt)) | |
4091 (or (assoc "^[a-zA-Z]:/[^/:]*\\'" file-name-handler-alist) | |
4092 (setq file-name-handler-alist | |
4093 (cons '("^[a-zA-Z]:/[^/:]*\\'" . | |
4094 ange-ftp-completion-hook-function) | |
4095 file-name-handler-alist)))) | |
4085 | 4096 |
4086 ;;; The above two forms are sufficient to cause this file to be loaded | 4097 ;;; The above two forms are sufficient to cause this file to be loaded |
4087 ;;; if the user ever uses a file name with a colon in it. | 4098 ;;; if the user ever uses a file name with a colon in it. |
4088 | 4099 |
4089 ;;; This sets the mode | 4100 ;;; This sets the mode |