comparison lisp/efs/efs-netrc.el @ 40:7e54bd776075 r19-15b103

Import from CVS: tag r19-15b103
author cvs
date Mon, 13 Aug 2007 08:54:25 +0200
parents 8fc7fe29b841
children 8b8b7f3559a2
comparison
equal deleted inserted replaced
39:06f275776fba 40:7e54bd776075
1 ;; -*-Emacs-Lisp-*- 1 ;; -*-Emacs-Lisp-*-
2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3 ;; 3 ;;
4 ;; File: efs-netrc.el 4 ;; File: efs-netrc.el
5 ;; Release: $efs release: 1.15 $ 5 ;; Release: $efs release: 1.15 $
6 ;; Version: $Revision: 1.1 $ 6 ;; Version: $Revision: 1.2 $
7 ;; RCS: 7 ;; RCS:
8 ;; Description: Parses ~/.netrc file, and does completion in /. 8 ;; Description: Parses ~/.netrc file, and does completion in /.
9 ;; Author: Sandy Rutherford <sandy@ibm550.sissa.it> 9 ;; Author: Sandy Rutherford <sandy@ibm550.sissa.it>
10 ;; Created: Fri Jan 28 19:32:47 1994 by sandy on ibm550 10 ;; Created: Fri Jan 28 19:32:47 1994 by sandy on ibm550
11 ;; Modified: Sun Nov 27 18:38:50 1994 by sandy on gandalf
12 ;; Language: Emacs-Lisp 11 ;; Language: Emacs-Lisp
13 ;; 12 ;;
14 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 13 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15 14
16 ;;; This file is part of efs. See efs.el for copyright 15 ;;; This file is part of efs. See efs.el for copyright
31 ;;;; ------------------------------------------------------------ 30 ;;;; ------------------------------------------------------------
32 31
33 (defconst efs-netrc-version 32 (defconst efs-netrc-version
34 (concat (substring "$efs release: 1.15 $" 14 -2) 33 (concat (substring "$efs release: 1.15 $" 14 -2)
35 "/" 34 "/"
36 (substring "$Revision: 1.1 $" 11 -2))) 35 (substring "$Revision: 1.2 $" 11 -2)))
37 36
38 ;; Make the byte compiler happy. 37 ;; Make the byte compiler happy.
39 (defvar dired-directory) 38 (defvar dired-directory)
40 39
41 ;;;; ------------------------------------------------------------ 40 ;;;; ------------------------------------------------------------
56 55
57 ;;;; ------------------------------------------------------------ 56 ;;;; ------------------------------------------------------------
58 ;;;; Host / User / Account mapping support. 57 ;;;; Host / User / Account mapping support.
59 ;;;; ------------------------------------------------------------ 58 ;;;; ------------------------------------------------------------
60 59
60 ;;;###autoload
61 (defun efs-set-passwd (host user passwd) 61 (defun efs-set-passwd (host user passwd)
62 "For a given HOST and USER, set or change the associated PASSWORD." 62 "For a given HOST and USER, set or change the associated PASSWORD."
63 (interactive (list (read-string "Host: ") 63 (interactive (list (read-string "Host: ")
64 (read-string "User: ") 64 (read-string "User: ")
65 (read-passwd "Password: "))) 65 (read-passwd "Password: ")))
368 (if (and (null res) 368 (if (and (null res)
369 (string-match "^1[0-8]\\.\\|^[0-9]\\." emacs-version)) 369 (string-match "^1[0-8]\\.\\|^[0-9]\\." emacs-version))
370 (list nil) 370 (list nil)
371 res)))) 371 res))))
372 372
373 ;;;###autoload
373 (defun efs-root-file-name-all-completions (file dir) 374 (defun efs-root-file-name-all-completions (file dir)
374 ;; Generates all completions in the root directory. 375 ;; Generates all completions in the root directory.
375 (let ((file-name-handler-alist (efs-file-name-handler-alist-sans-fn 376 (let ((file-name-handler-alist (efs-file-name-handler-alist-sans-fn
376 'efs-root-handler-function))) 377 'efs-root-handler-function)))
377 (nconc (all-completions file (efs-generate-root-prefixes)) 378 (nconc (all-completions file (efs-generate-root-prefixes))
378 (file-name-all-completions file dir)))) 379 (file-name-all-completions file dir))))
379 380
380 381
382 ;;;###autoload
381 (defun efs-root-file-name-completion (file dir) 383 (defun efs-root-file-name-completion (file dir)
382 ;; Calculates completions in the root directory to include remote hosts. 384 ;; Calculates completions in the root directory to include remote hosts.
383 (let ((file-name-handler-alist (efs-file-name-handler-alist-sans-fn 385 (let ((file-name-handler-alist (efs-file-name-handler-alist-sans-fn
384 'efs-root-handler-function))) 386 'efs-root-handler-function)))
385 (try-completion 387 (try-completion